From 67b430feae483f44078dd6f5ff96771073e746db Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Sun, 9 Aug 2020 11:38:45 +0300 Subject: Tab button labels fitted to available space --- src/ui/util.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/ui/util.c') 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 findChild_Widget(tabs, "tabs.buttons"), iClob(new_LabelWidget(label, key, kmods, format_CStr("tabs.switch page:%p", page))), addPos); - setFlags_Widget(button, selected_WidgetFlag | expand_WidgetFlag, isSel); + setFlags_Widget(button, selected_WidgetFlag, isSel); + setFlags_Widget(button, expand_WidgetFlag, iTrue); addChildPos_Widget(pages, page, addPos); setFlags_Widget(page, hidden_WidgetFlag | disabled_WidgetFlag, !isSel); } @@ -383,6 +384,10 @@ void showTabPage_Widget(iWidget *tabs, const iWidget *page) { } } +iLabelWidget *tabPageButton_Widget(iWidget *tabs, const iAnyObject *page) { + return tabButtonForPage_Widget_(tabs, page); +} + void setTabPageLabel_Widget(iWidget *tabs, const iAnyObject *page, const iString *label) { iLabelWidget *button = tabButtonForPage_Widget_(tabs, page); setText_LabelWidget(button, label); -- cgit v1.2.3