diff options
Diffstat (limited to 'src/ui/root.c')
-rw-r--r-- | src/ui/root.c | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/src/ui/root.c b/src/ui/root.c index d98701b8..5b1167d8 100644 --- a/src/ui/root.c +++ b/src/ui/root.c | |||
@@ -635,10 +635,12 @@ static void updateNavBarSize_(iWidget *navBar) { | |||
635 | iForIndices(k, lists) { | 635 | iForIndices(k, lists) { |
636 | iForEach(ObjectList, i, lists[k]) { | 636 | iForEach(ObjectList, i, lists[k]) { |
637 | iWidget *child = as_Widget(i.object); | 637 | iWidget *child = as_Widget(i.object); |
638 | setFlags_Widget(child, tight_WidgetFlag, isNarrow); | 638 | if (cmp_String(id_Widget(i.object), "navbar.unsplit")) { |
639 | if (isInstance_Object(i.object, &Class_LabelWidget)) { | 639 | setFlags_Widget(child, tight_WidgetFlag, isNarrow); |
640 | iLabelWidget *label = i.object; | 640 | if (isInstance_Object(i.object, &Class_LabelWidget)) { |
641 | updateSize_LabelWidget(label); | 641 | iLabelWidget *label = i.object; |
642 | updateSize_LabelWidget(label); | ||
643 | } | ||
642 | } | 644 | } |
643 | } | 645 | } |
644 | } | 646 | } |
@@ -1023,6 +1025,16 @@ void updateMetrics_Root(iRoot *d) { | |||
1023 | postRefresh_App(); | 1025 | postRefresh_App(); |
1024 | } | 1026 | } |
1025 | 1027 | ||
1028 | static void addUnsplitButton_(iWidget *navBar) { | ||
1029 | iLabelWidget *unsplit = addChildFlags_Widget( | ||
1030 | navBar, | ||
1031 | iClob(newIcon_LabelWidget(close_Icon, 0, 0, "ui.split arg:0 focusother:1")), | ||
1032 | collapse_WidgetFlag | frameless_WidgetFlag | tight_WidgetFlag | hidden_WidgetFlag); | ||
1033 | setId_Widget(as_Widget(unsplit), "navbar.unsplit"); | ||
1034 | setTextColor_LabelWidget(unsplit, uiTextAction_ColorId); | ||
1035 | updateSize_LabelWidget(unsplit); | ||
1036 | } | ||
1037 | |||
1026 | void createUserInterface_Root(iRoot *d) { | 1038 | void createUserInterface_Root(iRoot *d) { |
1027 | iWidget *root = d->widget = new_Widget(); | 1039 | iWidget *root = d->widget = new_Widget(); |
1028 | root->rect.size = get_Window()->size; | 1040 | root->rect.size = get_Window()->size; |
@@ -1101,6 +1113,9 @@ void createUserInterface_Root(iRoot *d) { | |||
1101 | addChild_Widget(div, iClob(navBar)); | 1113 | addChild_Widget(div, iClob(navBar)); |
1102 | setBackgroundColor_Widget(navBar, uiBackground_ColorId); | 1114 | setBackgroundColor_Widget(navBar, uiBackground_ColorId); |
1103 | setCommandHandler_Widget(navBar, handleNavBarCommands_); | 1115 | setCommandHandler_Widget(navBar, handleNavBarCommands_); |
1116 | #if defined (iPlatformApple) | ||
1117 | addUnsplitButton_(navBar); | ||
1118 | #endif | ||
1104 | iWidget *navBack; | 1119 | iWidget *navBack; |
1105 | setId_Widget(navBack = addChildFlags_Widget(navBar, iClob(newIcon_LabelWidget(backArrow_Icon, 0, 0, "navigate.back")), collapse_WidgetFlag), "navbar.back"); | 1120 | setId_Widget(navBack = addChildFlags_Widget(navBar, iClob(newIcon_LabelWidget(backArrow_Icon, 0, 0, "navigate.back")), collapse_WidgetFlag), "navbar.back"); |
1106 | setId_Widget(addChildFlags_Widget(navBar, iClob(newIcon_LabelWidget(forwardArrow_Icon, 0, 0, "navigate.forward")), collapse_WidgetFlag), "navbar.forward"); | 1121 | setId_Widget(addChildFlags_Widget(navBar, iClob(newIcon_LabelWidget(forwardArrow_Icon, 0, 0, "navigate.forward")), collapse_WidgetFlag), "navbar.forward"); |
@@ -1279,6 +1294,10 @@ void createUserInterface_Root(iRoot *d) { | |||
1279 | setAlignVisually_LabelWidget(navMenu, iTrue); | 1294 | setAlignVisually_LabelWidget(navMenu, iTrue); |
1280 | setId_Widget(addChildFlags_Widget(navBar, iClob(navMenu), collapse_WidgetFlag), "navbar.menu"); | 1295 | setId_Widget(addChildFlags_Widget(navBar, iClob(navMenu), collapse_WidgetFlag), "navbar.menu"); |
1281 | #endif | 1296 | #endif |
1297 | #if !defined (iPlatformApple) | ||
1298 | /* On PC platforms, the close buttons are generally on the top right. */ | ||
1299 | addUnsplitButton_(navBar); | ||
1300 | #endif | ||
1282 | } | 1301 | } |
1283 | /* Tab bar. */ { | 1302 | /* Tab bar. */ { |
1284 | iWidget *mainStack = new_Widget(); | 1303 | iWidget *mainStack = new_Widget(); |