summaryrefslogtreecommitdiff
path: root/src/ui/root.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-06-10 12:03:10 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-06-10 12:03:10 +0300
commit77ecd8cb2fec2c61f37f4c5561b18fad6fe6137a (patch)
treeb2d9087b225ea0bb568c4f80818d0513736a771d /src/ui/root.c
parent99044467586a5a37c796a7786834359dfaf30a2c (diff)
Tight mode for Query/Feeds indicator
Diffstat (limited to 'src/ui/root.c')
-rw-r--r--src/ui/root.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/ui/root.c b/src/ui/root.c
index 15548e74..23a7d670 100644
--- a/src/ui/root.c
+++ b/src/ui/root.c
@@ -551,9 +551,15 @@ static void updateUrlInputContentPadding_(iWidget *navBar) {
551} 551}
552 552
553static void showSearchQueryIndicator_(iBool show) { 553static void showSearchQueryIndicator_(iBool show) {
554 iWidget *navBar = findWidget_Root("navbar");
554 iWidget *indicator = findWidget_App("input.indicator.search"); 555 iWidget *indicator = findWidget_App("input.indicator.search");
556 updateTextCStr_LabelWidget((iLabelWidget *) indicator,
557 flags_Widget(navBar) & tight_WidgetFlag
558 ? "${status.query.tight} " return_Icon
559 : "${status.query} " return_Icon);
560 indicator->rect.size.x = defaultSize_LabelWidget((iLabelWidget *) indicator).x; /* don't touch height */
555 showCollapsed_Widget(indicator, show); 561 showCollapsed_Widget(indicator, show);
556 updateUrlInputContentPadding_(findWidget_Root("navbar")); 562 updateUrlInputContentPadding_(navBar);
557} 563}
558 564
559static int navBarAvailableSpace_(iWidget *navBar) { 565static int navBarAvailableSpace_(iWidget *navBar) {
@@ -1048,9 +1054,9 @@ void createUserInterface_Root(iRoot *d) {
1048 resizeHeightOfChildren_WidgetFlag | 1054 resizeHeightOfChildren_WidgetFlag |
1049 moveToParentRightEdge_WidgetFlag); 1055 moveToParentRightEdge_WidgetFlag);
1050 /* Feeds refresh indicator is inside the input field. */ { 1056 /* Feeds refresh indicator is inside the input field. */ {
1051 iLabelWidget *queryInd = 1057 iLabelWidget *queryInd = new_LabelWidget("${status.query} " return_Icon, NULL);
1052 new_LabelWidget(uiTextAction_ColorEscape "${status.query} " return_Icon, NULL);
1053 setId_Widget(as_Widget(queryInd), "input.indicator.search"); 1058 setId_Widget(as_Widget(queryInd), "input.indicator.search");
1059 setTextColor_LabelWidget(queryInd, uiTextAction_ColorId);
1054 setBackgroundColor_Widget(as_Widget(queryInd), uiBackground_ColorId); 1060 setBackgroundColor_Widget(as_Widget(queryInd), uiBackground_ColorId);
1055 setFrameColor_Widget(as_Widget(queryInd), uiTextAction_ColorId); 1061 setFrameColor_Widget(as_Widget(queryInd), uiTextAction_ColorId);
1056 setAlignVisually_LabelWidget(queryInd, iTrue); 1062 setAlignVisually_LabelWidget(queryInd, iTrue);
@@ -1060,9 +1066,9 @@ void createUserInterface_Root(iRoot *d) {
1060 collapse_WidgetFlag | hidden_WidgetFlag); 1066 collapse_WidgetFlag | hidden_WidgetFlag);
1061 } 1067 }
1062 /* Feeds refresh indicator is inside the input field. */ { 1068 /* Feeds refresh indicator is inside the input field. */ {
1063 iLabelWidget *fprog = new_LabelWidget(uiTextCaution_ColorEscape 1069 iLabelWidget *fprog = new_LabelWidget("", NULL);
1064 "\u2605 ${status.feeds}", NULL);
1065 setId_Widget(as_Widget(fprog), "feeds.progress"); 1070 setId_Widget(as_Widget(fprog), "feeds.progress");
1071 setTextColor_LabelWidget(fprog, uiTextCaution_ColorId);
1066 setBackgroundColor_Widget(as_Widget(fprog), uiBackground_ColorId); 1072 setBackgroundColor_Widget(as_Widget(fprog), uiBackground_ColorId);
1067 setAlignVisually_LabelWidget(fprog, iTrue); 1073 setAlignVisually_LabelWidget(fprog, iTrue);
1068 setNoAutoMinHeight_LabelWidget(fprog, iTrue); 1074 setNoAutoMinHeight_LabelWidget(fprog, iTrue);