Ticket #5956: clear-buttons.diff
File clear-buttons.diff, 4.5 KB (added by , 13 years ago) |
---|
-
gui/dialog.cpp
diff --git a/gui/dialog.cpp b/gui/dialog.cpp index 0522b40..e8c82b3 100644
a b void Dialog::removeWidget(Widget *del) { 334 334 if (del == _dragWidget) 335 335 _dragWidget = NULL; 336 336 337 Widget *w = _firstWidget; 338 339 if (del == _firstWidget) { 340 Widget *del_next = del->_next; 341 del->_next = 0; 342 _firstWidget = del_next; 343 return; 344 } 345 346 w = _firstWidget; 347 while (w) { 348 if (w->_next == del) { 349 Widget *del_next = del->_next; 350 del->_next = 0; 351 w->_next = del_next; 352 return; 353 } 354 w = w->_next; 355 } 337 GuiObject::removeWidget(del); 356 338 } 357 339 358 340 } // End of namespace GUI -
gui/object.cpp
diff --git a/gui/object.cpp b/gui/object.cpp index 2ec42df..73c4f74 100644
a b void GuiObject::reflowLayout() { 59 59 } 60 60 } 61 61 62 void GuiObject::removeWidget(Widget *del) { 63 if (del == _firstWidget) { 64 Widget *del_next = del->next(); 65 del->setNext(0); 66 _firstWidget = del_next; 67 return; 68 } 69 70 Widget *w = _firstWidget; 71 while (w) { 72 if (w->next() == del) { 73 Widget *del_next = del->next(); 74 del->setNext(0); 75 w->setNext(del_next); 76 return; 77 } 78 w = w->next(); 79 } 80 } 81 62 82 } // End of namespace GUI -
gui/object.h
diff --git a/gui/object.h b/gui/object.h index 34ff0d4..bce3cd7 100644
a b public: 83 83 84 84 virtual void reflowLayout(); 85 85 86 virtual void removeWidget(Widget *widget); 87 86 88 protected: 87 89 virtual void releaseFocus() = 0; 88 90 }; -
gui/options.cpp
diff --git a/gui/options.cpp b/gui/options.cpp index 4fa5a82..afa1b83 100644
a b static const char *outputRateLabels[] = { _s("<default>"), _s("8 kHz"), _s("11kH 79 79 static const int outputRateValues[] = { 0, 8000, 11025, 22050, 44100, 48000, -1 }; 80 80 81 81 OptionsDialog::OptionsDialog(const Common::String &domain, int x, int y, int w, int h) 82 : Dialog(x, y, w, h), _domain(domain), _graphicsTabId(-1), _ tabWidget(0) {82 : Dialog(x, y, w, h), _domain(domain), _graphicsTabId(-1), _midiTabId(-1), _pathsTabId(-1), _tabWidget(0) { 83 83 init(); 84 84 } 85 85 … … GlobalOptionsDialog::GlobalOptionsDialog() 1090 1090 // 1091 1091 // 3) The MIDI tab 1092 1092 // 1093 tab->addTab(_("MIDI"));1093 _midiTabId = tab->addTab(_("MIDI")); 1094 1094 addMIDIControls(tab, "GlobalOptions_MIDI."); 1095 1095 1096 1096 // … … GlobalOptionsDialog::GlobalOptionsDialog() 1103 1103 // 5) The Paths tab 1104 1104 // 1105 1105 if (g_system->getOverlayWidth() > 320) 1106 tab->addTab(_("Paths"));1106 _pathsTabId = tab->addTab(_("Paths")); 1107 1107 else 1108 tab->addTab(_c("Paths", "lowres"));1108 _pathsTabId = tab->addTab(_c("Paths", "lowres")); 1109 1109 1110 1110 #if !( defined(__DC__) || defined(__GP32__) ) 1111 1111 // These two buttons have to be extra wide, or the text will be … … void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3 1464 1464 } 1465 1465 } 1466 1466 1467 void GlobalOptionsDialog::reflowLayout() { 1468 int activeTab = _tabWidget->getActiveTab(); 1469 1470 if (_midiTabId != -1) { 1471 _tabWidget->setActiveTab(_midiTabId); 1472 1473 _tabWidget->removeWidget(_soundFontClearButton); 1474 _soundFontClearButton->setNext(0); 1475 delete _soundFontClearButton; 1476 _soundFontClearButton = addClearButton(_tabWidget, "GlobalOptions_MIDI.mcFontClearButton", kClearSoundFontCmd); 1477 } 1478 1479 if (_pathsTabId != -1) { 1480 _tabWidget->setActiveTab(_pathsTabId); 1481 1482 _tabWidget->removeWidget(_savePathClearButton); 1483 _savePathClearButton->setNext(0); 1484 delete _savePathClearButton; 1485 _savePathClearButton = addClearButton(_tabWidget, "GlobalOptions_Paths.SavePathClearButton", kSavePathClearCmd); 1486 1487 _tabWidget->removeWidget(_themePathClearButton); 1488 _themePathClearButton->setNext(0); 1489 delete _themePathClearButton; 1490 _themePathClearButton = addClearButton(_tabWidget, "GlobalOptions_Paths.ThemePathClearButton", kThemePathClearCmd); 1491 1492 _tabWidget->removeWidget(_extraPathClearButton); 1493 _extraPathClearButton->setNext(0); 1494 delete _extraPathClearButton; 1495 _extraPathClearButton = addClearButton(_tabWidget, "GlobalOptions_Paths.ExtraPathClearButton", kExtraPathClearCmd); 1496 } 1497 1498 _tabWidget->setActiveTab(activeTab); 1499 OptionsDialog::reflowLayout(); 1500 } 1501 1467 1502 } // End of namespace GUI -
gui/options.h
diff --git a/gui/options.h b/gui/options.h index 92ce3e5..05b3cac 100644
a b protected: 87 87 88 88 TabWidget *_tabWidget; 89 89 int _graphicsTabId; 90 int _midiTabId; 91 int _pathsTabId; 90 92 91 93 private: 92 94 // … … public: 191 193 void close(); 192 194 void handleCommand(CommandSender *sender, uint32 cmd, uint32 data); 193 195 196 virtual void reflowLayout(); 197 194 198 protected: 195 199 #ifdef SMALL_SCREEN_DEVICE 196 200 KeysDialog *_keysDialog;