diff options
Diffstat (limited to 'src/ui/util.c')
-rw-r--r-- | src/ui/util.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/ui/util.c b/src/ui/util.c index 6bc358de..da7a69b4 100644 --- a/src/ui/util.c +++ b/src/ui/util.c | |||
@@ -864,6 +864,13 @@ iLabelWidget *findMenuItem_Widget(iWidget *menu, const char *command) { | |||
864 | return NULL; | 864 | return NULL; |
865 | } | 865 | } |
866 | 866 | ||
867 | void setMenuItemDisabled_Widget(iWidget *menu, const char *command, iBool disable) { | ||
868 | iLabelWidget *item = findMenuItem_Widget(menu, command); | ||
869 | if (item) { | ||
870 | setFlags_Widget(as_Widget(item), disabled_WidgetFlag, disable); | ||
871 | } | ||
872 | } | ||
873 | |||
867 | int checkContextMenu_Widget(iWidget *menu, const SDL_Event *ev) { | 874 | int checkContextMenu_Widget(iWidget *menu, const SDL_Event *ev) { |
868 | if (menu && ev->type == SDL_MOUSEBUTTONDOWN && ev->button.button == SDL_BUTTON_RIGHT) { | 875 | if (menu && ev->type == SDL_MOUSEBUTTONDOWN && ev->button.button == SDL_BUTTON_RIGHT) { |
869 | if (isVisible_Widget(menu)) { | 876 | if (isVisible_Widget(menu)) { |
@@ -1428,8 +1435,8 @@ iWidget *makeToggle_Widget(const char *id) { | |||
1428 | return toggle; | 1435 | return toggle; |
1429 | } | 1436 | } |
1430 | 1437 | ||
1431 | static void appendFramelessTabPage_(iWidget *tabs, iWidget *page, const char *title, int shortcut, | 1438 | void appendFramelessTabPage_Widget(iWidget *tabs, iWidget *page, const char *title, int shortcut, |
1432 | int kmods) { | 1439 | int kmods) { |
1433 | appendTabPage_Widget(tabs, page, title, shortcut, kmods); | 1440 | appendTabPage_Widget(tabs, page, title, shortcut, kmods); |
1434 | setFlags_Widget( | 1441 | setFlags_Widget( |
1435 | (iWidget *) back_ObjectList(children_Widget(findChild_Widget(tabs, "tabs.buttons"))), | 1442 | (iWidget *) back_ObjectList(children_Widget(findChild_Widget(tabs, "tabs.buttons"))), |
@@ -1461,7 +1468,7 @@ iWidget *appendTwoColumnTabPage_Widget(iWidget *tabs, const char *title, int sho | |||
1461 | *values = addChildFlags_Widget( | 1468 | *values = addChildFlags_Widget( |
1462 | columns, iClob(new_Widget()), arrangeVertical_WidgetFlag | arrangeSize_WidgetFlag); | 1469 | columns, iClob(new_Widget()), arrangeVertical_WidgetFlag | arrangeSize_WidgetFlag); |
1463 | addChildFlags_Widget(page, iClob(new_Widget()), expand_WidgetFlag); | 1470 | addChildFlags_Widget(page, iClob(new_Widget()), expand_WidgetFlag); |
1464 | appendFramelessTabPage_(tabs, iClob(page), title, shortcut, shortcut ? KMOD_PRIMARY : 0); | 1471 | appendFramelessTabPage_Widget(tabs, iClob(page), title, shortcut, shortcut ? KMOD_PRIMARY : 0); |
1465 | return page; | 1472 | return page; |
1466 | } | 1473 | } |
1467 | 1474 | ||
@@ -1888,7 +1895,7 @@ iWidget *makePreferences_Widget(void) { | |||
1888 | /* Keybindings. */ | 1895 | /* Keybindings. */ |
1889 | if (deviceType_App() == desktop_AppDeviceType) { | 1896 | if (deviceType_App() == desktop_AppDeviceType) { |
1890 | iBindingsWidget *bind = new_BindingsWidget(); | 1897 | iBindingsWidget *bind = new_BindingsWidget(); |
1891 | appendFramelessTabPage_(tabs, iClob(bind), "${heading.prefs.keys}", '7', KMOD_PRIMARY); | 1898 | appendFramelessTabPage_Widget(tabs, iClob(bind), "${heading.prefs.keys}", '7', KMOD_PRIMARY); |
1892 | } | 1899 | } |
1893 | addChild_Widget(dlg, iClob(makePadding_Widget(gap_UI))); | 1900 | addChild_Widget(dlg, iClob(makePadding_Widget(gap_UI))); |
1894 | updatePreferencesLayout_Widget(dlg); | 1901 | updatePreferencesLayout_Widget(dlg); |