summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-09-08 10:52:54 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-09-08 10:52:54 +0300
commit5db4578e5d8e58ceb32ea0405ac493d1b0ffa592 (patch)
treee4853406eb1334deb5b1a24f81596fdfb617bb47
parent4ce9a07bbd4a4a82ff0b310d9c9e0768febe8d61 (diff)
Mobile: Preferences is completed, improved
-rw-r--r--src/ui/mobile.c72
-rw-r--r--src/ui/util.c123
-rw-r--r--src/ui/widget.c6
3 files changed, 146 insertions, 55 deletions
diff --git a/src/ui/mobile.c b/src/ui/mobile.c
index 4ccbb0cb..ecfb83ed 100644
--- a/src/ui/mobile.c
+++ b/src/ui/mobile.c
@@ -187,6 +187,7 @@ static iBool topPanelHandler_(iWidget *topPanel, const char *cmd) {
187 return iFalse; 187 return iFalse;
188} 188}
189 189
190#if 0
190static iBool isTwoColumnPage_(iWidget *d) { 191static iBool isTwoColumnPage_(iWidget *d) {
191 if (cmp_String(id_Widget(d), "dialogbuttons") == 0 || 192 if (cmp_String(id_Widget(d), "dialogbuttons") == 0 ||
192 cmp_String(id_Widget(d), "prefs.tabs") == 0) { 193 cmp_String(id_Widget(d), "prefs.tabs") == 0) {
@@ -274,6 +275,7 @@ static void stripTrailingColon_(iLabelWidget *label) {
274 delete_String(mod); 275 delete_String(mod);
275 } 276 }
276} 277}
278#endif
277 279
278static iLabelWidget *makePanelButton_(const char *text, const char *command) { 280static iLabelWidget *makePanelButton_(const char *text, const char *command) {
279 iLabelWidget *btn = new_LabelWidget(text, command); 281 iLabelWidget *btn = new_LabelWidget(text, command);
@@ -299,11 +301,9 @@ static iWidget *makeValuePadding_(iWidget *value) {
299 setPadding_Widget(pad, 0, 1 * gap_UI, 0, 1 * gap_UI); 301 setPadding_Widget(pad, 0, 1 * gap_UI, 0, 1 * gap_UI);
300 addChild_Widget(pad, iClob(value)); 302 addChild_Widget(pad, iClob(value));
301 setFlags_Widget(pad, 303 setFlags_Widget(pad,
302 borderBottom_WidgetFlag | 304 borderTop_WidgetFlag | borderBottom_WidgetFlag | arrangeVertical_WidgetFlag |
303 arrangeVertical_WidgetFlag | 305 resizeToParentWidth_WidgetFlag | resizeWidthOfChildren_WidgetFlag |
304 resizeToParentWidth_WidgetFlag | 306 arrangeHeight_WidgetFlag,
305 resizeWidthOfChildren_WidgetFlag |
306 arrangeHeight_WidgetFlag,
307 iTrue); 307 iTrue);
308 return pad; 308 return pad;
309} 309}
@@ -312,7 +312,7 @@ static iWidget *makeValuePaddingWithHeading_(iLabelWidget *heading, iWidget *val
312 const iBool isInput = isInstance_Object(value, &Class_InputWidget); 312 const iBool isInput = isInstance_Object(value, &Class_InputWidget);
313 iWidget *div = new_Widget(); 313 iWidget *div = new_Widget();
314 setFlags_Widget(div, 314 setFlags_Widget(div,
315 borderBottom_WidgetFlag | arrangeHeight_WidgetFlag | 315 borderTop_WidgetFlag | borderBottom_WidgetFlag | arrangeHeight_WidgetFlag |
316 resizeWidthOfChildren_WidgetFlag | 316 resizeWidthOfChildren_WidgetFlag |
317 arrangeHorizontal_WidgetFlag, iTrue); 317 arrangeHorizontal_WidgetFlag, iTrue);
318 setBackgroundColor_Widget(div, uiBackgroundSidebar_ColorId); 318 setBackgroundColor_Widget(div, uiBackgroundSidebar_ColorId);
@@ -418,7 +418,8 @@ void makePanelItem_Mobile(iWidget *panel, const iMenuItem *item) {
418 setId_Widget(as_Widget(drop), id); 418 setId_Widget(as_Widget(drop), id);
419 widget = makeValuePaddingWithHeading_(heading = makeHeading_Widget(label), as_Widget(drop)); 419 widget = makeValuePaddingWithHeading_(heading = makeHeading_Widget(label), as_Widget(drop));
420 } 420 }
421 else if (equal_Command(spec, "radio")) { 421 else if (equal_Command(spec, "radio") || equal_Command(spec, "buttons")) {
422 const iBool isRadio = equal_Command(spec, "radio");
422 addChild_Widget(panel, iClob(makePadding_Widget(lineHeight_Text(labelFont_())))); 423 addChild_Widget(panel, iClob(makePadding_Widget(lineHeight_Text(labelFont_()))));
423 iLabelWidget *head = makeHeading_Widget(label); 424 iLabelWidget *head = makeHeading_Widget(label);
424 setAllCaps_LabelWidget(head, iTrue); 425 setAllCaps_LabelWidget(head, iTrue);
@@ -427,9 +428,9 @@ void makePanelItem_Mobile(iWidget *panel, const iMenuItem *item) {
427 widget = new_Widget(); 428 widget = new_Widget();
428 setBackgroundColor_Widget(widget, uiBackgroundSidebar_ColorId); 429 setBackgroundColor_Widget(widget, uiBackgroundSidebar_ColorId);
429 setPadding_Widget(widget, 4 * gap_UI, 2 * gap_UI, 4 * gap_UI, 2 * gap_UI); 430 setPadding_Widget(widget, 4 * gap_UI, 2 * gap_UI, 4 * gap_UI, 2 * gap_UI);
430// setFlags_Widget(widget, arrangeWidth_WidgetFlag, iFalse);
431 setFlags_Widget(widget, 431 setFlags_Widget(widget,
432 borderBottom_WidgetFlag | 432 borderTop_WidgetFlag |
433 borderBottom_WidgetFlag |
433 arrangeHorizontal_WidgetFlag | 434 arrangeHorizontal_WidgetFlag |
434 arrangeHeight_WidgetFlag | 435 arrangeHeight_WidgetFlag |
435 resizeToParentWidth_WidgetFlag | 436 resizeToParentWidth_WidgetFlag |
@@ -437,24 +438,53 @@ void makePanelItem_Mobile(iWidget *panel, const iMenuItem *item) {
437 iTrue); 438 iTrue);
438 setId_Widget(widget, id); 439 setId_Widget(widget, id);
439 for (const iMenuItem *radioItem = item->data; radioItem->label; radioItem++) { 440 for (const iMenuItem *radioItem = item->data; radioItem->label; radioItem++) {
440 const char * radId = cstr_Rangecc(range_Command(radioItem->label, "id")); 441 const char * radId = cstr_Rangecc(range_Command(radioItem->label, "id"));
441 const char * radLabel = hasLabel_Command(radioItem->label, "label") 442 int64_t flags = noBackground_WidgetFlag;
442 ? format_CStr("${%s}", cstr_Rangecc(range_Command(radioItem->label, "label"))) 443 iLabelWidget *button;
443 : suffixPtr_Command(radioItem->label, "text"); 444 if (isRadio) {
444 iLabelWidget *radButton = new_LabelWidget(radLabel, radioItem->command); 445 const char *radLabel =
445 setId_Widget(as_Widget(radButton), radId); 446 hasLabel_Command(radioItem->label, "label")
446 setFont_LabelWidget(radButton, defaultMedium_FontId); 447 ? format_CStr("${%s}",
447 addChildFlags_Widget(widget, iClob(radButton), radio_WidgetFlag | noBackground_WidgetFlag); 448 cstr_Rangecc(range_Command(radioItem->label, "label")))
449 : suffixPtr_Command(radioItem->label, "text");
450 button = new_LabelWidget(radLabel, radioItem->command);
451 flags |= radio_WidgetFlag;
452 }
453 else {
454 button = (iLabelWidget *) makeToggle_Widget(radId);
455 setTextCStr_LabelWidget(button, format_CStr("${%s}", radId));
456 setFlags_Widget(as_Widget(button), fixedWidth_WidgetFlag, iFalse);
457 updateSize_LabelWidget(button);
458 }
459 setId_Widget(as_Widget(button), radId);
460 setFont_LabelWidget(button, defaultMedium_FontId);
461 addChildFlags_Widget(widget, iClob(button), flags);
448 } 462 }
449 } 463 }
450 else if (equal_Command(spec, "input")) { 464 else if (equal_Command(spec, "input")) {
451 iInputWidget *input = new_InputWidget(argU32Label_Command(spec, "maxlen")); 465 iInputWidget *input = new_InputWidget(argU32Label_Command(spec, "maxlen"));
452 setId_Widget(as_Widget(input), id); 466 setId_Widget(as_Widget(input), id);
453 setFont_InputWidget(input, labelFont_());
454 setContentPadding_InputWidget(input, 3 * gap_UI, 0);
455 setUrlContent_InputWidget(input, argLabel_Command(spec, "url")); 467 setUrlContent_InputWidget(input, argLabel_Command(spec, "url"));
456 widget = makeValuePaddingWithHeading_(heading = makeHeading_Widget(label), 468 setSelectAllOnFocus_InputWidget(input, argLabel_Command(spec, "selectall"));
457 as_Widget(input)); 469 setFont_InputWidget(input, labelFont_());
470 if (argLabel_Command(spec, "noheading")) {
471 widget = makeValuePadding_(as_Widget(input));
472 setFlags_Widget(widget, expand_WidgetFlag, iTrue);
473 }
474 else {
475 setContentPadding_InputWidget(input, 3 * gap_UI, 0);
476 if (hasLabel_Command(spec, "unit")) {
477 iWidget *unit = addChildFlags_Widget(
478 as_Widget(input),
479 iClob(new_LabelWidget(
480 format_CStr("${%s}", cstr_Rangecc(range_Command(spec, "unit"))), NULL)),
481 frameless_WidgetFlag | moveToParentRightEdge_WidgetFlag |
482 resizeToParentHeight_WidgetFlag);
483 setContentPadding_InputWidget(input, -1, width_Widget(unit) - 4 * gap_UI);
484 }
485 widget = makeValuePaddingWithHeading_(heading = makeHeading_Widget(label),
486 as_Widget(input));
487 }
458 } 488 }
459 else if (equal_Command(spec, "padding")) { 489 else if (equal_Command(spec, "padding")) {
460 widget = makePadding_Widget(lineHeight_Text(labelFont_()) * 1.5f); 490 widget = makePadding_Widget(lineHeight_Text(labelFont_()) * 1.5f);
diff --git a/src/ui/util.c b/src/ui/util.c
index 995b730e..64d7ea2b 100644
--- a/src/ui/util.c
+++ b/src/ui/util.c
@@ -1704,7 +1704,7 @@ iWidget *makePreferences_Widget(void) {
1704 }; 1704 };
1705 /* Create the Preferences UI. */ 1705 /* Create the Preferences UI. */
1706 if (deviceType_App() != desktop_AppDeviceType) { 1706 if (deviceType_App() != desktop_AppDeviceType) {
1707 const iMenuItem pinSplit[] = { 1707 const iMenuItem pinSplitItems[] = {
1708 { "button id:prefs.pinsplit.0 label:prefs.pinsplit.none", 0, 0, "pinsplit.set arg:0" }, 1708 { "button id:prefs.pinsplit.0 label:prefs.pinsplit.none", 0, 0, "pinsplit.set arg:0" },
1709 { "button id:prefs.pinsplit.1 label:prefs.pinsplit.left", 0, 0, "pinsplit.set arg:1" }, 1709 { "button id:prefs.pinsplit.1 label:prefs.pinsplit.left", 0, 0, "pinsplit.set arg:1" },
1710 { "button id:prefs.pinsplit.2 label:prefs.pinsplit.right", 0, 0, "pinsplit.set arg:2" }, 1710 { "button id:prefs.pinsplit.2 label:prefs.pinsplit.right", 0, 0, "pinsplit.set arg:2" },
@@ -1729,58 +1729,113 @@ iWidget *makePreferences_Widget(void) {
1729 { "button id:prefs.saturation.0 text:0 %", 0, 0, "saturation.set arg:0" }, 1729 { "button id:prefs.saturation.0 text:0 %", 0, 0, "saturation.set arg:0" },
1730 { NULL } 1730 { NULL }
1731 }; 1731 };
1732 const iMenuItem generalItems[] = { 1732 const iMenuItem monoFontItems[] = {
1733 { "title id:heading.prefs.general", 0, 0, NULL }, 1733 { "button id:prefs.mono.gemini" },
1734 { "input id:prefs.searchurl url:1", 0, 0, NULL }, 1734 { "button id:prefs.mono.gopher" },
1735 { "padding", 0, 0, NULL }, 1735 { NULL }
1736 { "toggle id:prefs.hoverlink", 0, 0, NULL }, 1736 };
1737 { "toggle id:prefs.archive.openindex", 0, 0, NULL }, 1737 const iMenuItem boldLinkItems[] = {
1738 { "radio device:1 id:prefs.pinsplit", 0, 0, (const void *) pinSplit }, 1738 { "button id:prefs.boldlink.dark" },
1739 { "padding", 0, 0, NULL }, 1739 { "button id:prefs.boldlink.light" },
1740 { NULL }
1741 };
1742 const iMenuItem lineWidthItems[] = {
1743 { "button id:prefs.linewidth.30 text:\u20132", 0, 0, "linewidth.set arg:30" },
1744 { "button id:prefs.linewidth.34 text:\u20131", 0, 0, "linewidth.set arg:34" },
1745 { "button id:prefs.linewidth.38 label:prefs.linewidth.normal", 0, 0, "linewidth.set arg:38" },
1746 { "button id:prefs.linewidth.43 text:+1", 0, 0, "linewidth.set arg:43" },
1747 { "button id:prefs.linewidth.48 text:+2", 0, 0, "linewidth.set arg:48" },
1748 { "button id:prefs.linewidth.1000 label:prefs.linewidth.fill", 0, 0, "linewidth.set arg:1000" },
1749 { NULL }
1750 };
1751 const iMenuItem quoteItems[] = {
1752 { "button id:prefs.quoteicon.1 label:prefs.quoteicon.icon", 0, 0, "quoteicon.set arg:1" },
1753 { "button id:prefs.quoteicon.0 label:prefs.quoteicon.line", 0, 0, "quoteicon.set arg:0" },
1754 { NULL }
1755 };
1756 const iMenuItem generalPanelItems[] = {
1757 { "title id:heading.prefs.general" },
1758 { "heading id:prefs.searchurl" },
1759 { "input id:prefs.searchurl url:1 noheading:1" },
1760 { "padding" },
1761 { "toggle id:prefs.hoverlink" },
1762 { "toggle id:prefs.archive.openindex" },
1763 { "radio device:1 id:prefs.pinsplit", 0, 0, (const void *) pinSplitItems },
1764 { "padding" },
1740 { "dropdown id:prefs.uilang", 0, 0, (const void *) langItems }, 1765 { "dropdown id:prefs.uilang", 0, 0, (const void *) langItems },
1741 { NULL } 1766 { NULL }
1742 }; 1767 };
1743 const iMenuItem uiItems[] = { 1768 const iMenuItem uiPanelItems[] = {
1744 { "title id:heading.prefs.interface", 0, 0, NULL }, 1769 { "title id:heading.prefs.interface" },
1745 { "dropdown device:1 id:prefs.returnkey", 0, 0, (const void *) returnKeyBehaviors }, 1770 { "dropdown device:1 id:prefs.returnkey", 0, 0, (const void *) returnKeyBehaviors },
1746 { "padding device:1", 0, 0, NULL }, 1771 { "padding device:1" },
1747 { "toggle device:2 id:prefs.hidetoolbarscroll", 0, 0, NULL }, 1772 { "toggle device:2 id:prefs.hidetoolbarscroll" },
1748 { "heading id:heading.prefs.sizing", 0, 0, NULL }, 1773 { "heading id:heading.prefs.sizing" },
1749 { "input id:prefs.uiscale maxlen:8", 0, 0, NULL }, 1774 { "input id:prefs.uiscale maxlen:8" },
1750 { NULL } 1775 { NULL }
1751 }; 1776 };
1752 const iMenuItem colorItems[] = { 1777 const iMenuItem colorPanelItems[] = {
1753 { "title id:heading.prefs.colors", 0, 0, NULL }, 1778 { "title id:heading.prefs.colors" },
1754 { "heading id:heading.prefs.uitheme", 0, 0, NULL }, 1779 { "heading id:heading.prefs.uitheme" },
1755 { "toggle id:prefs.ostheme", 0, 0, NULL }, 1780 { "toggle id:prefs.ostheme" },
1756 { "radio id:prefs.theme", 0, 0, (const void *) themeItems }, 1781 { "radio id:prefs.theme", 0, 0, (const void *) themeItems },
1757 { "radio id:prefs.accent", 0, 0, (const void *) accentItems }, 1782 { "radio id:prefs.accent", 0, 0, (const void *) accentItems },
1758 { "heading id:heading.prefs.pagecontent", 0, 0, NULL }, 1783 { "heading id:heading.prefs.pagecontent" },
1759 { "dropdown id:prefs.doctheme.dark", 0, 0, (const void *) docThemes[0] }, 1784 { "dropdown id:prefs.doctheme.dark", 0, 0, (const void *) docThemes[0] },
1760 { "dropdown id:prefs.doctheme.light", 0, 0, (const void *) docThemes[1] }, 1785 { "dropdown id:prefs.doctheme.light", 0, 0, (const void *) docThemes[1] },
1761 { "radio id:prefs.saturation", 0, 0, (const void *) satItems }, 1786 { "radio id:prefs.saturation", 0, 0, (const void *) satItems },
1762 { "padding", 0, 0, NULL }, 1787 { "padding" },
1763 { "dropdown id:prefs.imagestyle", 0, 0, (const void *) imgStyles }, 1788 { "dropdown id:prefs.imagestyle", 0, 0, (const void *) imgStyles },
1764 { NULL } 1789 { NULL }
1765 }; 1790 };
1766 const iMenuItem fontItems[] = { 1791 const iMenuItem fontPanelItems[] = {
1767 { "title id:heading.prefs.fonts", 0, 0, NULL }, 1792 { "title id:heading.prefs.fonts" },
1768 { "dropdown id:prefs.headingfont", 0, 0, (const void *) constData_Array(makeFontItems_("headingfont")) }, 1793 { "dropdown id:prefs.headingfont", 0, 0, (const void *) constData_Array(makeFontItems_("headingfont")) },
1769 { "dropdown id:prefs.font", 0, 0, (const void *) constData_Array(makeFontItems_("font")) }, 1794 { "dropdown id:prefs.font", 0, 0, (const void *) constData_Array(makeFontItems_("font")) },
1795 { "buttons id:prefs.mono", 0, 0, (const void *) monoFontItems },
1796 { "buttons id:prefs.boldlink", 0, 0, (const void *) boldLinkItems },
1770 { NULL } 1797 { NULL }
1771 }; 1798 };
1799 const iMenuItem stylePanelItems[] = {
1800 { "title id:heading.prefs.style" },
1801 { "radio id:prefs.linewidth", 0, 0, (const void *) lineWidthItems },
1802 { "padding" },
1803 { "input id:prefs.linespacing maxlen:5" },
1804 { "radio id:prefs.quoteicon", 0, 0, (const void *) quoteItems },
1805 { "padding" },
1806 { "toggle id:prefs.biglede" },
1807 { "toggle id:prefs.plaintext.wrap" },
1808 { "toggle id:prefs.collapsepreonload" },
1809 { "toggle id:prefs.sideicon" },
1810 { "toggle id:prefs.centershort" },
1811 { NULL }
1812 };
1813 const iMenuItem networkPanelItems[] = {
1814 { "title id:heading.prefs.network" },
1815 { "toggle id:prefs.decodeurls" },
1816 { "padding" },
1817 { "input id:prefs.cachesize maxlen:4 selectall:1 unit:mb" },
1818 { "input id:prefs.memorysize maxlen:4 selectall:1 unit:mb" },
1819 { "heading id:prefs.proxy.gemini" },
1820 { "input id:prefs.proxy.gemini noheading:1" },
1821 { "heading id:prefs.proxy.gemini" },
1822 { "input id:prefs.proxy.gopher noheading:1" },
1823 { "heading id:prefs.proxy.gemini" },
1824 { "input id:prefs.proxy.http noheading:1" },
1825 { NULL }
1826 };
1772 const iMenuItem items[] = { { "panel icon:0x2699 id:heading.prefs.general", 1827 const iMenuItem items[] = { { "panel icon:0x2699 id:heading.prefs.general",
1773 '1', 0, 1828 '1', 0, (const void *) generalPanelItems },
1774 (const void *) generalItems },
1775 { "panel icon:0x1f4f1 id:heading.prefs.interface", 1829 { "panel icon:0x1f4f1 id:heading.prefs.interface",
1776 '2', 0, 1830 '2', 0, (const void *) uiPanelItems },
1777 (const void *) uiItems },
1778 { "panel icon:0x1f3a8 id:heading.prefs.colors", 1831 { "panel icon:0x1f3a8 id:heading.prefs.colors",
1779 '3', 0, 1832 '3', 0, (const void *) colorPanelItems },
1780 (const void *) colorItems },
1781 { "panel icon:0x1f5da id:heading.prefs.fonts", 1833 { "panel icon:0x1f5da id:heading.prefs.fonts",
1782 '4', 0, 1834 '4', 0, (const void *) fontPanelItems },
1783 (const void *) fontItems }, 1835 { "panel icon:0x1f660 id:heading.prefs.style",
1836 '5', 0, (const void *) stylePanelItems },
1837 { "panel icon:0x1f5a7 id:heading.prefs.network",
1838 '6', 0, (const void *) networkPanelItems },
1784 { NULL } }; 1839 { NULL } };
1785 iWidget *dlg = makeSplitMultiPanel_Mobile(items); 1840 iWidget *dlg = makeSplitMultiPanel_Mobile(items);
1786 setupSheetTransition_Mobile(dlg, iTrue); 1841 setupSheetTransition_Mobile(dlg, iTrue);
@@ -2118,7 +2173,7 @@ iWidget *makeBookmarkEditor_Widget(void) {
2118 addChild_Widget(dlg, iClob(makePadding_Widget(gap_UI))); 2173 addChild_Widget(dlg, iClob(makePadding_Widget(gap_UI)));
2119 addChild_Widget( 2174 addChild_Widget(
2120 dlg, 2175 dlg,
2121 iClob(makeDialogButtons_Widget((iMenuItem[]){ { "${cancel}", 0, 0, NULL }, 2176 iClob(makeDialogButtons_Widget((iMenuItem[]){ { "${cancel}" },
2122 { uiTextCaution_ColorEscape "${dlg.bookmark.save}", 2177 { uiTextCaution_ColorEscape "${dlg.bookmark.save}",
2123 SDLK_RETURN, 2178 SDLK_RETURN,
2124 KMOD_PRIMARY, 2179 KMOD_PRIMARY,
@@ -2246,7 +2301,7 @@ iWidget *makeFeedSettings_Widget(uint32_t bookmarkId) {
2246 iWidget *buttons = 2301 iWidget *buttons =
2247 addChild_Widget(dlg, 2302 addChild_Widget(dlg,
2248 iClob(makeDialogButtons_Widget( 2303 iClob(makeDialogButtons_Widget(
2249 (iMenuItem[]){ { "${cancel}", 0, 0, NULL }, 2304 (iMenuItem[]){ { "${cancel}" },
2250 { bookmarkId ? uiTextCaution_ColorEscape "${dlg.feed.save}" 2305 { bookmarkId ? uiTextCaution_ColorEscape "${dlg.feed.save}"
2251 : uiTextCaution_ColorEscape "${dlg.feed.sub}", 2306 : uiTextCaution_ColorEscape "${dlg.feed.sub}",
2252 SDLK_RETURN, 2307 SDLK_RETURN,
@@ -2342,7 +2397,7 @@ iWidget *makeIdentityCreation_Widget(void) {
2342 addChild_Widget(dlg, 2397 addChild_Widget(dlg,
2343 iClob(makeDialogButtons_Widget( 2398 iClob(makeDialogButtons_Widget(
2344 (iMenuItem[]){ { "${dlg.newident.more}", 0, 0, "ident.showmore" }, 2399 (iMenuItem[]){ { "${dlg.newident.more}", 0, 0, "ident.showmore" },
2345 { "---", 0, 0, NULL }, 2400 { "---" },
2346 { "${cancel}", SDLK_ESCAPE, 0, "ident.cancel" }, 2401 { "${cancel}", SDLK_ESCAPE, 0, "ident.cancel" },
2347 { uiTextAction_ColorEscape "${dlg.newident.create}", 2402 { uiTextAction_ColorEscape "${dlg.newident.create}",
2348 SDLK_RETURN, 2403 SDLK_RETURN,
diff --git a/src/ui/widget.c b/src/ui/widget.c
index 0d6787ce..4fd8f066 100644
--- a/src/ui/widget.c
+++ b/src/ui/widget.c
@@ -1288,6 +1288,12 @@ iAny *addChildPosFlags_Widget(iWidget *d, iAnyObject *child, enum iWidgetAddPos
1288 d->children = new_ObjectList(); 1288 d->children = new_ObjectList();
1289 } 1289 }
1290 if (addPos == back_WidgetAddPos) { 1290 if (addPos == back_WidgetAddPos) {
1291 /* Remove a redundant border flags. */
1292 if (!isEmpty_ObjectList(d->children) &&
1293 as_Widget(back_ObjectList(d->children))->flags & borderBottom_WidgetFlag &&
1294 widget->flags & borderTop_WidgetFlag) {
1295 widget->flags &= ~borderTop_WidgetFlag;
1296 }
1291 pushBack_ObjectList(d->children, widget); /* ref */ 1297 pushBack_ObjectList(d->children, widget); /* ref */
1292 } 1298 }
1293 else { 1299 else {