summaryrefslogtreecommitdiff
path: root/src/ui/util.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-10-22 07:34:38 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-10-22 07:34:38 +0300
commit393040b23fcd16c4b01f134bfc388c683360a7bb (patch)
treee365762637638d74ca492eb431a7c0b8ec9ac448 /src/ui/util.c
parentc752568f1cc5cee1d1957644a20482501b96c25c (diff)
Tab close buttons, shown on hover
IssueID #354
Diffstat (limited to 'src/ui/util.c')
-rw-r--r--src/ui/util.c7
1 files changed, 5 insertions, 2 deletions
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
1451void addTabCloseButton_Widget(iWidget *tabs, const iWidget *page, const char *command) { 1451void 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
1464void showTabPage_Widget(iWidget *tabs, const iWidget *page) { 1467void showTabPage_Widget(iWidget *tabs, const iWidget *page) {