summaryrefslogtreecommitdiff
path: root/src/ui/root.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-05-12 09:06:11 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-05-12 09:06:11 +0300
commit4e84a9ff371e69ba828f8678c5cec89eea45d2ab (patch)
tree332a76e480b197c1bc814ff8dd4d9b46ebe4431e /src/ui/root.c
parent892d8dedc46713ddf916e82405f06fc2c9c46ae4 (diff)
InputWidget: Expanding while editing
The navbar layout cannot accommodate more than one line of text, but allow the editor to expand while writing text.
Diffstat (limited to 'src/ui/root.c')
-rw-r--r--src/ui/root.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/ui/root.c b/src/ui/root.c
index 8db8f7af..6f91b370 100644
--- a/src/ui/root.c
+++ b/src/ui/root.c
@@ -534,13 +534,17 @@ static iBool willPerformSearchQuery_(const iString *userInput) {
534 return !isEmpty_String(&prefs_App()->searchUrl) && !isLikelyUrl_String(userInput); 534 return !isEmpty_String(&prefs_App()->searchUrl) && !isLikelyUrl_String(userInput);
535} 535}
536 536
537static void updateUrlInputContentPadding_(iWidget *navBar) {
538 iInputWidget *url = findChild_Widget(navBar, "url");
539 const iWidget *indicators = findChild_Widget(navBar, "url.rightembed");
540 setContentPadding_InputWidget(url, -1,
541 width_Widget(indicators));
542}
543
537static void showSearchQueryIndicator_(iBool show) { 544static void showSearchQueryIndicator_(iBool show) {
538 iWidget *indicator = findWidget_App("input.indicator.search"); 545 iWidget *indicator = findWidget_App("input.indicator.search");
539 showCollapsed_Widget(indicator, show); 546 showCollapsed_Widget(indicator, show);
540 iAssert(isInstance_Object(parent_Widget(parent_Widget(indicator)), &Class_InputWidget)); 547 updateUrlInputContentPadding_(findWidget_Root("navbar"));
541 iInputWidget *url = (iInputWidget *) parent_Widget(parent_Widget(indicator));
542 setContentPadding_InputWidget(url, -1, contentPadding_InputWidget(url).left +
543 (show ? width_Widget(indicator) : 0));
544} 548}
545 549
546static int navBarAvailableSpace_(iWidget *navBar) { 550static int navBarAvailableSpace_(iWidget *navBar) {
@@ -1008,6 +1012,7 @@ void createUserInterface_Root(iRoot *d) {
1008 setFlags_Widget(as_Widget(url), resizeHeightOfChildren_WidgetFlag, iTrue); 1012 setFlags_Widget(as_Widget(url), resizeHeightOfChildren_WidgetFlag, iTrue);
1009 setSelectAllOnFocus_InputWidget(url, iTrue); 1013 setSelectAllOnFocus_InputWidget(url, iTrue);
1010 setId_Widget(as_Widget(url), "url"); 1014 setId_Widget(as_Widget(url), "url");
1015 setMaxLayoutLines_InputWidget(url, 1);
1011 setUrlContent_InputWidget(url, iTrue); 1016 setUrlContent_InputWidget(url, iTrue);
1012 setNotifyEdits_InputWidget(url, iTrue); 1017 setNotifyEdits_InputWidget(url, iTrue);
1013 setTextCStr_InputWidget(url, "gemini://"); 1018 setTextCStr_InputWidget(url, "gemini://");