Procházet zdrojové kódy

Focus an empty URL bar when the browser starts

Keep the home start page, but clear the address bar instead of showing
about:home and give the URL field focus so typing works immediately.  A
browser launched with a URL argument still shows that URL.
Johannes Zellner před 1 týdnem
rodič
revize
17d1108e39
1 změnil soubory, kde provedl 7 přidání a 2 odebrání
  1. 7 2
      browser.c

+ 7 - 2
browser.c

@@ -4137,10 +4137,15 @@ void _start(const char *arg)
 	page_scroll.offset = 0;
 	page_scroll.content_h = 0;
 
-	if (arg && arg[0])
+	if (arg && arg[0]) {
 		navigate(arg, 1);
-	else
+	} else {
 		load_home(1);
+		/* Start ready to type: keep the home page, but leave the address
+		 * bar empty instead of showing "about:home". */
+		ngui_input_set(&url_in, "");
+		ngui_set_focus(&ui, ID_URL);
+	}
 
 	for (;;) {
 		unsigned int action = 0;