summaryrefslogtreecommitdiff
path: root/src/ui/util.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-11-02 05:51:25 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-11-02 05:51:25 +0200
commit1cf757598fe46430f7f7f857f7c9bd9d5bb146d1 (patch)
treeeccb9630fd52f18d94fad056d72a7bafc0147fee /src/ui/util.c
parent06b6df20de8384571acb0c2b23ce893b48f6c14a (diff)
macOS: Tab close buttons on the left
Platform convention.
Diffstat (limited to 'src/ui/util.c')
-rw-r--r--src/ui/util.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/ui/util.c b/src/ui/util.c
index 6d0453ff..640b3112 100644
--- a/src/ui/util.c
+++ b/src/ui/util.c
@@ -1455,12 +1455,17 @@ void addTabCloseButton_Widget(iWidget *tabs, const iWidget *page, const char *co
1455 iLabelWidget *tabButton = tabButtonForPage_Widget_(tabs, page); 1455 iLabelWidget *tabButton = tabButtonForPage_Widget_(tabs, page);
1456 setPadding_Widget(as_Widget(tabButton), 0, 0, 0, gap_UI / 4); 1456 setPadding_Widget(as_Widget(tabButton), 0, 0, 0, gap_UI / 4);
1457 setFlags_Widget(as_Widget(tabButton), arrangeVertical_WidgetFlag | resizeHeightOfChildren_WidgetFlag, iTrue); 1457 setFlags_Widget(as_Widget(tabButton), arrangeVertical_WidgetFlag | resizeHeightOfChildren_WidgetFlag, iTrue);
1458#if defined (iPlatformApple)
1459 const int64_t edge = moveToParentLeftEdge_WidgetFlag;
1460#else
1461 const int64_t edge = moveToParentRightEdge_WidgetFlag;
1462#endif
1458 iLabelWidget *close = addChildFlags_Widget( 1463 iLabelWidget *close = addChildFlags_Widget(
1459 as_Widget(tabButton), 1464 as_Widget(tabButton),
1460 iClob(new_LabelWidget(close_Icon, 1465 iClob(new_LabelWidget(close_Icon,
1461 format_CStr("%s id:%s", command, cstr_String(id_Widget(page))))), 1466 format_CStr("%s id:%s", command, cstr_String(id_Widget(page))))),
1462 moveToParentRightEdge_WidgetFlag | tight_WidgetFlag | frameless_WidgetFlag | 1467 edge | tight_WidgetFlag | frameless_WidgetFlag | noBackground_WidgetFlag |
1463 noBackground_WidgetFlag | hidden_WidgetFlag | visibleOnParentHover_WidgetFlag); 1468 hidden_WidgetFlag | visibleOnParentHover_WidgetFlag);
1464 if (deviceType_App() != desktop_AppDeviceType) { 1469 if (deviceType_App() != desktop_AppDeviceType) {
1465 setFlags_Widget(as_Widget(close), 1470 setFlags_Widget(as_Widget(close),
1466 hidden_WidgetFlag | visibleOnParentHover_WidgetFlag, iFalse); 1471 hidden_WidgetFlag | visibleOnParentHover_WidgetFlag, iFalse);