summaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/inputwidget.c10
-rw-r--r--src/ui/window.c6
2 files changed, 10 insertions, 6 deletions
diff --git a/src/ui/inputwidget.c b/src/ui/inputwidget.c
index d29548f1..0fcca40a 100644
--- a/src/ui/inputwidget.c
+++ b/src/ui/inputwidget.c
@@ -181,8 +181,14 @@ void setText_InputWidget(iInputWidget *d, const iString *text) {
181 iConstForEach(String, i, text) { 181 iConstForEach(String, i, text) {
182 pushBack_Array(&d->text, &i.value); 182 pushBack_Array(&d->text, &i.value);
183 } 183 }
184 iZap(d->mark); 184 if (isFocused_Widget(d)) {
185 d->cursor = iMin(d->cursor, size_Array(&d->text)); 185 d->cursor = size_Array(&d->text);
186 selectAll_InputWidget(d);
187 }
188 else {
189 d->cursor = iMin(d->cursor, size_Array(&d->text));
190 iZap(d->mark);
191 }
186 refresh_Widget(as_Widget(d)); 192 refresh_Widget(as_Widget(d));
187} 193}
188 194
diff --git a/src/ui/window.c b/src/ui/window.c
index b90b2b55..41d8078f 100644
--- a/src/ui/window.c
+++ b/src/ui/window.c
@@ -236,7 +236,8 @@ static iBool handleNavBarCommands_(iWidget *navBar, const char *cmd) {
236 setText_InputWidget(url, url_DocumentWidget(document_App())); 236 setText_InputWidget(url, url_DocumentWidget(document_App()));
237 return iTrue; 237 return iTrue;
238 } 238 }
239 if (arg_Command(cmd) && !isFocused_Widget(findWidget_App("lookup"))) { 239 if (arg_Command(cmd) && argLabel_Command(cmd, "enter") &&
240 !isFocused_Widget(findWidget_App("lookup"))) {
240 postCommandf_App( 241 postCommandf_App(
241 "open url:%s", 242 "open url:%s",
242 cstr_String(absoluteUrl_String(&iStringLiteral(""), text_InputWidget(url)))); 243 cstr_String(absoluteUrl_String(&iStringLiteral(""), text_InputWidget(url))));
@@ -261,9 +262,6 @@ static iBool handleNavBarCommands_(iWidget *navBar, const char *cmd) {
261 } 262 }
262 else if (equal_Command(cmd, "document.request.started")) { 263 else if (equal_Command(cmd, "document.request.started")) {
263 iInputWidget *url = findChild_Widget(navBar, "url"); 264 iInputWidget *url = findChild_Widget(navBar, "url");
264 if (isFocused_Widget(as_Widget(url))) {
265 setFocus_Widget(NULL);
266 }
267 setTextCStr_InputWidget(url, suffixPtr_Command(cmd, "url")); 265 setTextCStr_InputWidget(url, suffixPtr_Command(cmd, "url"));
268 updateTextCStr_LabelWidget(reloadButton, stopCStr_); 266 updateTextCStr_LabelWidget(reloadButton, stopCStr_);
269 return iFalse; 267 return iFalse;