summaryrefslogtreecommitdiff
path: root/src/ui/util.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-05-14 12:07:23 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-05-14 12:07:23 +0300
commiteabae64f99804c1c7521ca55d3eb883e7880df4f (patch)
tree9a30183851cb00ec728f7e3f657eee7a909b8843 /src/ui/util.c
parent52cb02415da32d1d378cafb6f475f85e9491b0b0 (diff)
Show "Line break" help text in input dialog
Diffstat (limited to 'src/ui/util.c')
-rw-r--r--src/ui/util.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/ui/util.c b/src/ui/util.c
index 7156b445..93afeb4a 100644
--- a/src/ui/util.c
+++ b/src/ui/util.c
@@ -80,7 +80,7 @@ void toString_Sym(int key, int kmods, iString *str) {
80 appendChar_String(str, 0x2325); 80 appendChar_String(str, 0x2325);
81 } 81 }
82 if (kmods & KMOD_SHIFT) { 82 if (kmods & KMOD_SHIFT) {
83 appendChar_String(str, 0x21e7); 83 appendCStr_String(str, shift_Icon);
84 } 84 }
85 if (kmods & KMOD_GUI) { 85 if (kmods & KMOD_GUI) {
86 appendChar_String(str, 0x2318); 86 appendChar_String(str, 0x2318);
@@ -93,7 +93,7 @@ void toString_Sym(int key, int kmods, iString *str) {
93 appendCStr_String(str, "Alt+"); 93 appendCStr_String(str, "Alt+");
94 } 94 }
95 if (kmods & KMOD_SHIFT) { 95 if (kmods & KMOD_SHIFT) {
96 appendCStr_String(str, "Shift+"); 96 appendCStr_String(str, shift_Icon "+");
97 } 97 }
98 if (kmods & KMOD_GUI) { 98 if (kmods & KMOD_GUI) {
99 appendCStr_String(str, "Meta+"); 99 appendCStr_String(str, "Meta+");
@@ -138,7 +138,7 @@ void toString_Sym(int key, int kmods, iString *str) {
138 } 138 }
139 else if (key == SDLK_RETURN) { 139 else if (key == SDLK_RETURN) {
140 removePlus_(str); 140 removePlus_(str);
141 appendChar_String(str, 0x21a9); /* Leftwards arrow with a hook */ 141 appendCStr_String(str, return_Icon); /* Leftwards arrow with a hook */
142 } 142 }
143 else { 143 else {
144 appendCStr_String(str, SDL_GetKeyName(key)); 144 appendCStr_String(str, SDL_GetKeyName(key));
@@ -904,7 +904,7 @@ static iBool isTabPage_Widget_(const iWidget *tabs, const iWidget *page) {
904static void unfocusFocusInsideTabPage_(const iWidget *page) { 904static void unfocusFocusInsideTabPage_(const iWidget *page) {
905 iWidget *focus = focus_Widget(); 905 iWidget *focus = focus_Widget();
906 if (page && focus && hasParent_Widget(focus, page)) { 906 if (page && focus && hasParent_Widget(focus, page)) {
907 printf("unfocus inside page: %p\n", focus); 907// printf("unfocus inside page: %p\n", focus);
908 setFocus_Widget(NULL); 908 setFocus_Widget(NULL);
909 } 909 }
910} 910}
@@ -1806,7 +1806,8 @@ static void updateValueInputWidth_(iWidget *dlg) {
1806 dlg->rect.size.x = rootSize.x; 1806 dlg->rect.size.x = rootSize.x;
1807 } 1807 }
1808 else { 1808 else {
1809 dlg->rect.size.x = iMaxi(iMaxi(rootSize.x / 2, title->rect.size.x), prompt->rect.size.x); 1809 dlg->rect.size.x =
1810 iMaxi(iMaxi(iMin(rootSize.x, 100 * gap_UI), title->rect.size.x), prompt->rect.size.x);
1810 } 1811 }
1811} 1812}
1812 1813
@@ -1880,6 +1881,12 @@ iWidget *makeDialogButtons_Widget(const iMenuItem *actions, size_t numActions) {
1880 if (*label == '*' || *label == '&') { 1881 if (*label == '*' || *label == '&') {
1881 continue; /* Special value selection items for a Question dialog. */ 1882 continue; /* Special value selection items for a Question dialog. */
1882 } 1883 }
1884 if (startsWith_CStr(label, "```")) {
1885 /* Annotation. */
1886 iLabelWidget *annotation = addChild_Widget(div, iClob(new_LabelWidget(label + 3, NULL)));
1887 setTextColor_LabelWidget(annotation, uiTextAction_ColorId);
1888 continue;
1889 }
1883 if (!iCmpStr(label, "---")) { 1890 if (!iCmpStr(label, "---")) {
1884 /* Separator.*/ 1891 /* Separator.*/
1885 addChildFlags_Widget(div, iClob(new_Widget()), expand_WidgetFlag); 1892 addChildFlags_Widget(div, iClob(new_Widget()), expand_WidgetFlag);