summaryrefslogtreecommitdiff
path: root/src/ui/util.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-07-17 15:36:37 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-07-17 15:36:37 +0300
commitc5463b0aec571b8d9451ddadb656a061e22e7f2f (patch)
treefdc36a94f74e9933d8d2064ebc3070c6f12530a2 /src/ui/util.c
parent635eabab8b932ca01fc5b391cda20e23e40a6532 (diff)
Working on Titan uploads
There may be a bug in `TlsRequest` when sending out large amounts of data.
Diffstat (limited to 'src/ui/util.c')
-rw-r--r--src/ui/util.c15
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
867void 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
867int checkContextMenu_Widget(iWidget *menu, const SDL_Event *ev) { 874int 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
1431static void appendFramelessTabPage_(iWidget *tabs, iWidget *page, const char *title, int shortcut, 1438void 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);