summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-07-25 13:01:06 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-07-25 13:01:06 +0300
commite8233ba5c6f6933d6d20e114192934e1145a750e (patch)
treec0a0ea7d293fed9e4064da066a3c96d22a1e256d /src
parentacf382fb36212d49601984813839a377b5f29afb (diff)
Keep the navbar URL up to date
Diffstat (limited to 'src')
-rw-r--r--src/ui/documentwidget.c2
-rw-r--r--src/ui/window.c5
2 files changed, 6 insertions, 1 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c
index cb530e9b..4197332a 100644
--- a/src/ui/documentwidget.c
+++ b/src/ui/documentwidget.c
@@ -151,7 +151,7 @@ static void fetch_DocumentWidget_(iDocumentWidget *d) {
151 iRelease(d->request); 151 iRelease(d->request);
152 d->request = NULL; 152 d->request = NULL;
153 } 153 }
154 postCommand_Widget(as_Widget(d), "document.request.started"); 154 postCommandf_App("document.request.started url:%s", cstr_String(d->url));
155 d->state = fetching_DocumentState; 155 d->state = fetching_DocumentState;
156 set_Atomic(&d->isSourcePending, iFalse); 156 set_Atomic(&d->isSourcePending, iFalse);
157 d->request = new_GmRequest(); 157 d->request = new_GmRequest();
diff --git a/src/ui/window.c b/src/ui/window.c
index a110c5ad..65228f2b 100644
--- a/src/ui/window.c
+++ b/src/ui/window.c
@@ -98,6 +98,11 @@ static iBool handleNavBarCommands_(iWidget *navBar, const char *cmd) {
98 return iFalse; 98 return iFalse;
99 } 99 }
100 else if (equal_Command(cmd, "document.request.started")) { 100 else if (equal_Command(cmd, "document.request.started")) {
101 iInputWidget *url = findChild_Widget(navBar, "url");
102 if (isFocused_Widget(as_Widget(url))) {
103 setFocus_Widget(NULL);
104 }
105 setTextCStr_InputWidget(url, valuePtr_Command(cmd, "url"));
101 updateTextCStr_LabelWidget(findChild_Widget(navBar, "reload"), stopCStr_); 106 updateTextCStr_LabelWidget(findChild_Widget(navBar, "reload"), stopCStr_);
102 return iFalse; 107 return iFalse;
103 } 108 }