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.
This commit is contained in:
parent
4e68b06fed
commit
6b17507b76
5 changed files with 66 additions and 23 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue