Fix scrolling bug at the bottom of palette list the first time it popups

This commit is contained in:
David Capello 2016-09-05 13:02:52 -03:00
parent 7fe6037862
commit 6e5d312bdf

View File

@ -1,5 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2001-2015 David Capello // Copyright (C) 2001-2016 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
// the End-User License Agreement for Aseprite. // the End-User License Agreement for Aseprite.
@ -205,8 +205,7 @@ void ResourcesListBox::onTick()
insertChild(getItemsCount()-1, listItem); insertChild(getItemsCount()-1, listItem);
layout(); layout();
View* view = View::getView(this); if (View* view = View::getView(this))
if (view)
view->updateView(); view->updateView();
resource.release(); resource.release();
@ -215,15 +214,18 @@ void ResourcesListBox::onTick()
void ResourcesListBox::stop() void ResourcesListBox::stop()
{ {
m_resourcesTimer.stop();
if (m_loadingItem) { if (m_loadingItem) {
removeChild(m_loadingItem); removeChild(m_loadingItem);
layout();
delete m_loadingItem; delete m_loadingItem;
m_loadingItem = NULL; m_loadingItem = nullptr;
invalidate(); if (View* view = View::getView(this))
view->updateView();
} }
m_resourcesTimer.stop();
} }
} // namespace app } // namespace app