summaryrefslogtreecommitdiff
path: root/src/ui/util.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-08-09 11:38:45 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-08-09 11:38:45 +0300
commit67b430feae483f44078dd6f5ff96771073e746db (patch)
tree8233d7f5321e17389f0d9bbc4d550b6dc88d552d /src/ui/util.c
parent3530d4127b840c63e1a15b38844bf13483cf9490 (diff)
Tab button labels fitted to available space
Diffstat (limited to 'src/ui/util.c')
-rw-r--r--src/ui/util.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/ui/util.c b/src/ui/util.c
index 40debd28..9ac1913d 100644
--- a/src/ui/util.c
+++ b/src/ui/util.c
@@ -317,7 +317,8 @@ static void addTabPage_Widget_(iWidget *tabs, enum iWidgetAddPos addPos, iWidget
317 findChild_Widget(tabs, "tabs.buttons"), 317 findChild_Widget(tabs, "tabs.buttons"),
318 iClob(new_LabelWidget(label, key, kmods, format_CStr("tabs.switch page:%p", page))), 318 iClob(new_LabelWidget(label, key, kmods, format_CStr("tabs.switch page:%p", page))),
319 addPos); 319 addPos);
320 setFlags_Widget(button, selected_WidgetFlag | expand_WidgetFlag, isSel); 320 setFlags_Widget(button, selected_WidgetFlag, isSel);
321 setFlags_Widget(button, expand_WidgetFlag, iTrue);
321 addChildPos_Widget(pages, page, addPos); 322 addChildPos_Widget(pages, page, addPos);
322 setFlags_Widget(page, hidden_WidgetFlag | disabled_WidgetFlag, !isSel); 323 setFlags_Widget(page, hidden_WidgetFlag | disabled_WidgetFlag, !isSel);
323} 324}
@@ -383,6 +384,10 @@ void showTabPage_Widget(iWidget *tabs, const iWidget *page) {
383 } 384 }
384} 385}
385 386
387iLabelWidget *tabPageButton_Widget(iWidget *tabs, const iAnyObject *page) {
388 return tabButtonForPage_Widget_(tabs, page);
389}
390
386void setTabPageLabel_Widget(iWidget *tabs, const iAnyObject *page, const iString *label) { 391void setTabPageLabel_Widget(iWidget *tabs, const iAnyObject *page, const iString *label) {
387 iLabelWidget *button = tabButtonForPage_Widget_(tabs, page); 392 iLabelWidget *button = tabButtonForPage_Widget_(tabs, page);
388 setText_LabelWidget(button, label); 393 setText_LabelWidget(button, label);