diff options
author | Torbjörn Andersson | 2012-02-24 22:20:50 +0100 |
---|---|---|
committer | Torbjörn Andersson | 2012-02-24 22:20:50 +0100 |
commit | 6b17507b76e3ac1efd8aa5dc12684a233d52046b (patch) | |
tree | 79601a5fef6664642c4fe585b243f4d321d00ede /gui/dialog.cpp | |
parent | 4e68b06fed3d2f0f2b8236cb7424cab4321f7b2d (diff) | |
download | scummvm-rg350-6b17507b76e3ac1efd8aa5dc12684a233d52046b.tar.gz scummvm-rg350-6b17507b76e3ac1efd8aa5dc12684a233d52046b.tar.bz2 scummvm-rg350-6b17507b76e3ac1efd8aa5dc12684a233d52046b.zip |
GUI: Fix "clear" buttons after theme switch (bug #3482459)
Because the "clear" buttons are very different between themes (in
the Modern theme they have a graphical symbol, while in the Classic
theme they have a letter), they have to be removed and re-added
when reflowing the layout. This is patterned after how the
LauncherDialog class handles the larger changes in layout.
Removing widgets from a tab turned out to be trickier than I first
thought, so I had to move the removeWidget() method from Dialog to
GuiObject.
Diffstat (limited to 'gui/dialog.cpp')
-rw-r--r-- | gui/dialog.cpp | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/gui/dialog.cpp b/gui/dialog.cpp index 0522b40b46..fd15ba5e09 100644 --- a/gui/dialog.cpp +++ b/gui/dialog.cpp @@ -334,25 +334,7 @@ void Dialog::removeWidget(Widget *del) { if (del == _dragWidget) _dragWidget = NULL; - Widget *w = _firstWidget; - - if (del == _firstWidget) { - Widget *del_next = del->_next; - del->_next = 0; - _firstWidget = del_next; - return; - } - - w = _firstWidget; - while (w) { - if (w->_next == del) { - Widget *del_next = del->_next; - del->_next = 0; - w->_next = del_next; - return; - } - w = w->_next; - } + GuiObject::removeWidget(del); } } // End of namespace GUI |