changeset 1957:2ac2b0e6aced

Fixed button sensitivity when starting with an empty page
author Jorge Arellano Cid <jcid@dillo.org>
date Fri, 01 Apr 2011 14:59:23 -0300
parents 76ed17497099
children 7860a3051241
files src/dillo.cc src/menu.cc src/uicmd.cc
diffstat 3 files changed, 14 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/dillo.cc	Wed Mar 30 16:03:40 2011 -0300
+++ b/src/dillo.cc	Fri Apr 01 14:59:23 2011 -0300
@@ -380,7 +380,10 @@
 
    if (idx == argc) {
       /* No URLs/files on cmdline. Send startup screen */
-      a_UIcmd_open_url(bw, prefs.start_page);
+      if (strcmp(URL_STR(prefs.start_page), "about:blank") == 0)
+         a_UIcmd_open_url(bw, NULL);
+      else
+         a_UIcmd_open_url(bw, prefs.start_page);
    } else {
       for (int i = idx; i < argc; i++) {
          DilloUrl *start_url = makeStartUrl(argv[i], local);
--- a/src/menu.cc	Wed Mar 30 16:03:40 2011 -0300
+++ b/src/menu.cc	Fri Apr 01 14:59:23 2011 -0300
@@ -84,8 +84,7 @@
 static void filemenu_cb(Fl_Widget *wid, void *data)
 {
    if (strcmp((char*)data, "nw") == 0) {
-      UI *ui = (UI*)popup_bw->ui;
-      a_UIcmd_browser_window_new(ui->w(), ui->h(), 0, popup_bw);
+      a_UIcmd_open_url_nw(popup_bw, NULL);
    } else if (strcmp((char*)data, "nt") == 0) {
       a_UIcmd_open_url_nt(popup_bw, NULL, 1);
    } else if (strcmp((char*)data, "of") == 0) {
--- a/src/uicmd.cc	Wed Mar 30 16:03:40 2011 -0300
+++ b/src/uicmd.cc	Fri Apr 01 14:59:23 2011 -0300
@@ -161,7 +161,7 @@
          MSG("CustTabs::handle KEYS_RIGHT_TAB\n");
          ret = 1;
       } else if (cmd == KEYS_NEW_WINDOW) {
-         a_UIcmd_browser_window_new(ui->w(),ui->h()+this->h(),0,bw);
+         a_UIcmd_open_url_nw(bw, NULL);
          ret = 1;
       } else if (cmd == KEYS_FULLSCREEN) {
          MSG("CustTabs::handle KEYS_FULLSCREEN\n");
@@ -405,8 +405,6 @@
 
    win->callback(win_cb, DilloTabs);
 
-   //new_ui->focus_location();
-
    return new_bw;
 }
 
@@ -528,7 +526,13 @@
  */
 void a_UIcmd_open_url(BrowserWindow *bw, const DilloUrl *url)
 {
-   a_Nav_push(bw, url, NULL);
+   if (url) {
+      a_Nav_push(bw, url, NULL);
+   } else {
+      // Used to start a bw with a blank screen
+      BW2UI(bw)->focus_location();
+      a_UIcmd_set_buttons_sens(bw);
+   }
 #if 0
    if (BW2UI(bw)->get_panelmode() == UI_TEMPORARILY_SHOW_PANELS)
       BW2UI(bw)->set_panelmode(UI_HIDDEN);
@@ -546,6 +550,7 @@
       BW2UI(new_bw)->focus_main();
    } else {
       BW2UI(new_bw)->focus_location();
+      a_UIcmd_set_buttons_sens(new_bw);
    }
 }