diff options
-rw-r--r-- | src/ui/documentwidget.c | 2 | ||||
-rw-r--r-- | src/ui/root.c | 4 | ||||
-rw-r--r-- | src/ui/util.c | 7 |
3 files changed, 9 insertions, 4 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c index 0f989133..8e4e2752 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c | |||
@@ -944,7 +944,7 @@ static void updateWindowTitle_DocumentWidget_(const iDocumentWidget *d) { | |||
944 | pushBackCStr_StringArray(title, "Lagrange"); | 944 | pushBackCStr_StringArray(title, "Lagrange"); |
945 | } | 945 | } |
946 | /* Take away parts if it doesn't fit. */ | 946 | /* Take away parts if it doesn't fit. */ |
947 | const int avail = bounds_Widget(as_Widget(tabButton)).size.x - 3 * gap_UI; | 947 | const int avail = bounds_Widget(as_Widget(tabButton)).size.x - 7 * gap_UI; |
948 | iBool setWindow = (document_App() == d && isUnderKeyRoot_Widget(d)); | 948 | iBool setWindow = (document_App() == d && isUnderKeyRoot_Widget(d)); |
949 | const int font = uiLabel_FontId; | 949 | const int font = uiLabel_FontId; |
950 | for (;;) { | 950 | for (;;) { |
diff --git a/src/ui/root.c b/src/ui/root.c index f6d6f11d..ba8d95ee 100644 --- a/src/ui/root.c +++ b/src/ui/root.c | |||
@@ -1281,7 +1281,9 @@ void createUserInterface_Root(iRoot *d) { | |||
1281 | iWidget *docTabs = makeTabs_Widget(mainStack); | 1281 | iWidget *docTabs = makeTabs_Widget(mainStack); |
1282 | setId_Widget(docTabs, "doctabs"); | 1282 | setId_Widget(docTabs, "doctabs"); |
1283 | setBackgroundColor_Widget(docTabs, uiBackground_ColorId); | 1283 | setBackgroundColor_Widget(docTabs, uiBackground_ColorId); |
1284 | appendTabPage_Widget(docTabs, iClob(new_DocumentWidget()), "Document", 0, 0); | 1284 | iDocumentWidget *doc; |
1285 | appendTabPage_Widget(docTabs, iClob(doc = new_DocumentWidget()), "Document", 0, 0); | ||
1286 | addTabCloseButton_Widget(docTabs, as_Widget(doc), "tabs.close"); | ||
1285 | iWidget *buttons = findChild_Widget(docTabs, "tabs.buttons"); | 1287 | iWidget *buttons = findChild_Widget(docTabs, "tabs.buttons"); |
1286 | setFlags_Widget(buttons, collapse_WidgetFlag | hidden_WidgetFlag | | 1288 | setFlags_Widget(buttons, collapse_WidgetFlag | hidden_WidgetFlag | |
1287 | drawBackgroundToHorizontalSafeArea_WidgetFlag, iTrue); | 1289 | drawBackgroundToHorizontalSafeArea_WidgetFlag, iTrue); |
diff --git a/src/ui/util.c b/src/ui/util.c index 5f6d0331..55adeffc 100644 --- a/src/ui/util.c +++ b/src/ui/util.c | |||
@@ -1451,14 +1451,17 @@ static iLabelWidget *tabButtonForPage_Widget_(iWidget *tabs, const iWidget *page | |||
1451 | void addTabCloseButton_Widget(iWidget *tabs, const iWidget *page, const char *command) { | 1451 | void addTabCloseButton_Widget(iWidget *tabs, const iWidget *page, const char *command) { |
1452 | iLabelWidget *tabButton = tabButtonForPage_Widget_(tabs, page); | 1452 | iLabelWidget *tabButton = tabButtonForPage_Widget_(tabs, page); |
1453 | // setPadding1_Widget(as_Widget(tabButton), gap_UI / 8); | 1453 | // setPadding1_Widget(as_Widget(tabButton), gap_UI / 8); |
1454 | setPadding_Widget(as_Widget(tabButton), 0, 0, 0, gap_UI / 4); | ||
1455 | setFlags_Widget(as_Widget(tabButton), arrangeVertical_WidgetFlag | resizeHeightOfChildren_WidgetFlag, iTrue); | ||
1454 | iLabelWidget *close = addChildFlags_Widget( | 1456 | iLabelWidget *close = addChildFlags_Widget( |
1455 | as_Widget(tabButton), | 1457 | as_Widget(tabButton), |
1456 | iClob(new_LabelWidget(close_Icon, | 1458 | iClob(new_LabelWidget(close_Icon, |
1457 | format_CStr("%s id:%s", command, cstr_String(id_Widget(page))))), | 1459 | format_CStr("%s id:%s", command, cstr_String(id_Widget(page))))), |
1458 | moveToParentRightEdge_WidgetFlag | tight_WidgetFlag | frameless_WidgetFlag | | 1460 | moveToParentRightEdge_WidgetFlag | tight_WidgetFlag | frameless_WidgetFlag | |
1459 | hidden_WidgetFlag | visibleOnParentHover_WidgetFlag); | 1461 | noBackground_WidgetFlag | hidden_WidgetFlag | visibleOnParentHover_WidgetFlag); |
1462 | setNoAutoMinHeight_LabelWidget(close, iTrue); | ||
1460 | updateSize_LabelWidget(close); | 1463 | updateSize_LabelWidget(close); |
1461 | printTree_Widget(tabs); | 1464 | // printTree_Widget(tabs); |
1462 | } | 1465 | } |
1463 | 1466 | ||
1464 | void showTabPage_Widget(iWidget *tabs, const iWidget *page) { | 1467 | void showTabPage_Widget(iWidget *tabs, const iWidget *page) { |