diff options
Diffstat (limited to 'src/ui/util.c')
-rw-r--r-- | src/ui/util.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/ui/util.c b/src/ui/util.c index 5361250f..01939e66 100644 --- a/src/ui/util.c +++ b/src/ui/util.c | |||
@@ -1490,7 +1490,7 @@ iWidget *makeQuestion_Widget(const char *title, const char *msg, | |||
1490 | addChild_Widget(dlg->root->widget, iClob(dlg)); | 1490 | addChild_Widget(dlg->root->widget, iClob(dlg)); |
1491 | arrange_Widget(dlg); /* BUG: This extra arrange shouldn't be needed but the dialog won't | 1491 | arrange_Widget(dlg); /* BUG: This extra arrange shouldn't be needed but the dialog won't |
1492 | be arranged correctly unless it's here. */ | 1492 | be arranged correctly unless it's here. */ |
1493 | finalizeSheet_Mobile(dlg); | 1493 | setupSheetTransition_Mobile(dlg, iTrue); |
1494 | return dlg; | 1494 | return dlg; |
1495 | } | 1495 | } |
1496 | 1496 | ||
@@ -1726,7 +1726,7 @@ static void addDialogToggle_(iWidget *headings, iWidget *values, | |||
1726 | addChild_Widget(values, iClob(makeToggle_Widget(toggleId))); | 1726 | addChild_Widget(values, iClob(makeToggle_Widget(toggleId))); |
1727 | } | 1727 | } |
1728 | 1728 | ||
1729 | static size_t findWidestItemLabel_(const iMenuItem *items, size_t num) { | 1729 | size_t findWidestLabel_MenuItem(const iMenuItem *items, size_t num) { |
1730 | int widest = 0; | 1730 | int widest = 0; |
1731 | size_t widestPos = iInvalidPos; | 1731 | size_t widestPos = iInvalidPos; |
1732 | for (size_t i = 0; i < num && items[i].label; i++) { | 1732 | for (size_t i = 0; i < num && items[i].label; i++) { |
@@ -1947,10 +1947,10 @@ iWidget *makePreferences_Widget(void) { | |||
1947 | }; | 1947 | }; |
1948 | iString *aboutText = collectNew_String(); { | 1948 | iString *aboutText = collectNew_String(); { |
1949 | setCStr_String(aboutText, "Lagrange " LAGRANGE_APP_VERSION); | 1949 | setCStr_String(aboutText, "Lagrange " LAGRANGE_APP_VERSION); |
1950 | #if defined (iPlatformAppleMobile) | 1950 | #if defined (iPlatformAppleMobile) |
1951 | appendFormat_String(aboutText, " (" LAGRANGE_IOS_VERSION ") %s" LAGRANGE_IOS_BUILD_DATE, | 1951 | appendFormat_String(aboutText, " (" LAGRANGE_IOS_VERSION ") %s" LAGRANGE_IOS_BUILD_DATE, |
1952 | escape_Color(uiTextDim_ColorId)); | 1952 | escape_Color(uiTextDim_ColorId)); |
1953 | #endif | 1953 | #endif |
1954 | } | 1954 | } |
1955 | const iMenuItem aboutPanelItems[] = { | 1955 | const iMenuItem aboutPanelItems[] = { |
1956 | { format_CStr("heading text:%s", cstr_String(aboutText)) }, | 1956 | { format_CStr("heading text:%s", cstr_String(aboutText)) }, |
@@ -2015,7 +2015,7 @@ iWidget *makePreferences_Widget(void) { | |||
2015 | iArray *uiLangs = collectNew_Array(sizeof(iMenuItem)); | 2015 | iArray *uiLangs = collectNew_Array(sizeof(iMenuItem)); |
2016 | pushBackN_Array(uiLangs, langItems, iElemCount(langItems) - 1); | 2016 | pushBackN_Array(uiLangs, langItems, iElemCount(langItems) - 1); |
2017 | /* TODO: Add an arrange flag for resizing parent to widest child. */ | 2017 | /* TODO: Add an arrange flag for resizing parent to widest child. */ |
2018 | size_t widestPos = findWidestItemLabel_(data_Array(uiLangs), size_Array(uiLangs)); | 2018 | size_t widestPos = findWidestLabel_MenuItem(data_Array(uiLangs), size_Array(uiLangs)); |
2019 | addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.uilang}"))); | 2019 | addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.uilang}"))); |
2020 | setId_Widget(addChildFlags_Widget(values, | 2020 | setId_Widget(addChildFlags_Widget(values, |
2021 | iClob(makeMenuButton_LabelWidget( | 2021 | iClob(makeMenuButton_LabelWidget( |
@@ -2034,7 +2034,7 @@ iWidget *makePreferences_Widget(void) { | |||
2034 | addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.returnkey}"))); | 2034 | addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.returnkey}"))); |
2035 | /* Return key behaviors. */ { | 2035 | /* Return key behaviors. */ { |
2036 | iLabelWidget *returnKey = makeMenuButton_LabelWidget( | 2036 | iLabelWidget *returnKey = makeMenuButton_LabelWidget( |
2037 | returnKeyBehaviors[findWidestItemLabel_(returnKeyBehaviors, | 2037 | returnKeyBehaviors[findWidestLabel_MenuItem(returnKeyBehaviors, |
2038 | iElemCount(returnKeyBehaviors) - 1)] | 2038 | iElemCount(returnKeyBehaviors) - 1)] |
2039 | .label, | 2039 | .label, |
2040 | returnKeyBehaviors, | 2040 | returnKeyBehaviors, |
@@ -2104,7 +2104,7 @@ iWidget *makePreferences_Widget(void) { | |||
2104 | const char *mode = isDark ? "dark" : "light"; | 2104 | const char *mode = isDark ? "dark" : "light"; |
2105 | addChild_Widget(headings, iClob(makeHeading_Widget(isDark ? "${prefs.doctheme.dark}" : "${prefs.doctheme.light}"))); | 2105 | addChild_Widget(headings, iClob(makeHeading_Widget(isDark ? "${prefs.doctheme.dark}" : "${prefs.doctheme.light}"))); |
2106 | iLabelWidget *button = makeMenuButton_LabelWidget( | 2106 | iLabelWidget *button = makeMenuButton_LabelWidget( |
2107 | docThemes[i][findWidestItemLabel_(docThemes[i], max_GmDocumentTheme)].label, | 2107 | docThemes[i][findWidestLabel_MenuItem(docThemes[i], max_GmDocumentTheme)].label, |
2108 | docThemes[i], | 2108 | docThemes[i], |
2109 | max_GmDocumentTheme); | 2109 | max_GmDocumentTheme); |
2110 | // setFrameColor_Widget(findChild_Widget(as_Widget(button), "menu"), | 2110 | // setFrameColor_Widget(findChild_Widget(as_Widget(button), "menu"), |
@@ -2125,7 +2125,7 @@ iWidget *makePreferences_Widget(void) { | |||
2125 | /* Colorize images. */ { | 2125 | /* Colorize images. */ { |
2126 | addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.imagestyle}"))); | 2126 | addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.imagestyle}"))); |
2127 | iLabelWidget *button = makeMenuButton_LabelWidget( | 2127 | iLabelWidget *button = makeMenuButton_LabelWidget( |
2128 | imgStyles[findWidestItemLabel_(imgStyles, iElemCount(imgStyles) - 1)].label, | 2128 | imgStyles[findWidestLabel_MenuItem(imgStyles, iElemCount(imgStyles) - 1)].label, |
2129 | imgStyles, | 2129 | imgStyles, |
2130 | iElemCount(imgStyles) - 1); | 2130 | iElemCount(imgStyles) - 1); |
2131 | setBackgroundColor_Widget(findChild_Widget(as_Widget(button), "menu"), | 2131 | setBackgroundColor_Widget(findChild_Widget(as_Widget(button), "menu"), |
@@ -2254,7 +2254,8 @@ iWidget *makePreferences_Widget(void) { | |||
2254 | iClob(makeDialogButtons_Widget( | 2254 | iClob(makeDialogButtons_Widget( |
2255 | (iMenuItem[]){ { "${close}", SDLK_ESCAPE, 0, "prefs.dismiss" } }, 1))); | 2255 | (iMenuItem[]){ { "${close}", SDLK_ESCAPE, 0, "prefs.dismiss" } }, 1))); |
2256 | addChild_Widget(dlg->root->widget, iClob(dlg)); | 2256 | addChild_Widget(dlg->root->widget, iClob(dlg)); |
2257 | finalizeSheet_Mobile(dlg); | 2257 | // finalizeSheet_Mobile(dlg); |
2258 | // arrange_Widget(dlg); | ||
2258 | setupSheetTransition_Mobile(dlg, iTrue); | 2259 | setupSheetTransition_Mobile(dlg, iTrue); |
2259 | // printTree_Widget(dlg); | 2260 | // printTree_Widget(dlg); |
2260 | return dlg; | 2261 | return dlg; |
@@ -2312,7 +2313,7 @@ iWidget *makeBookmarkEditor_Widget(void) { | |||
2312 | addChild_Widget(dlg, iClob(makePadding_Widget(gap_UI))); | 2313 | addChild_Widget(dlg, iClob(makePadding_Widget(gap_UI))); |
2313 | addChild_Widget(dlg, iClob(makeDialogButtons_Widget(actions, iElemCount(actions)))); | 2314 | addChild_Widget(dlg, iClob(makeDialogButtons_Widget(actions, iElemCount(actions)))); |
2314 | addChild_Widget(get_Root()->widget, iClob(dlg)); | 2315 | addChild_Widget(get_Root()->widget, iClob(dlg)); |
2315 | finalizeSheet_Mobile(dlg); | 2316 | setupSheetTransition_Mobile(dlg, iTrue); |
2316 | return dlg; | 2317 | return dlg; |
2317 | } | 2318 | } |
2318 | 2319 | ||
@@ -2509,7 +2510,6 @@ iWidget *makeIdentityCreation_Widget(void) { | |||
2509 | { "input collapse:1 id:ident.country hint:hint.newident.optional text:${dlg.newident.country}" }, | 2510 | { "input collapse:1 id:ident.country hint:hint.newident.optional text:${dlg.newident.country}" }, |
2510 | { NULL } | 2511 | { NULL } |
2511 | }, actions, iElemCount(actions)); | 2512 | }, actions, iElemCount(actions)); |
2512 | setupSheetTransition_Mobile(dlg, iTrue); | ||
2513 | } | 2513 | } |
2514 | else { | 2514 | else { |
2515 | dlg = makeSheet_Widget("ident"); | 2515 | dlg = makeSheet_Widget("ident"); |
@@ -2578,8 +2578,8 @@ iWidget *makeIdentityCreation_Widget(void) { | |||
2578 | } | 2578 | } |
2579 | addChild_Widget(dlg, iClob(makeDialogButtons_Widget(actions, iElemCount(actions)))); | 2579 | addChild_Widget(dlg, iClob(makeDialogButtons_Widget(actions, iElemCount(actions)))); |
2580 | addChild_Widget(get_Root()->widget, iClob(dlg)); | 2580 | addChild_Widget(get_Root()->widget, iClob(dlg)); |
2581 | finalizeSheet_Mobile(dlg); | ||
2582 | } | 2581 | } |
2582 | setupSheetTransition_Mobile(dlg, iTrue); | ||
2583 | return dlg; | 2583 | return dlg; |
2584 | } | 2584 | } |
2585 | 2585 | ||