changeset 1928:261762bef174

Part of the UI wasn't visible. This minor changes fix it.
author Jorge Arellano Cid <jcid@dillo.org>
date Wed, 09 Mar 2011 14:22:32 -0300
parents e7abafb75d0e
children 5ce120292c22
files src/ui.cc src/uicmd.cc
diffstat 2 files changed, 28 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/src/ui.cc	Wed Mar 09 14:21:25 2011 -0300
+++ b/src/ui.cc	Wed Mar 09 14:22:32 2011 -0300
@@ -644,8 +644,8 @@
 /*
  * User Interface constructor
  */
-UI::UI(int x, int y, int ww, int wh, const char* label, const UI *cur_ui) :
-  Fl_Pack(x, y, ww, wh, label)
+UI::UI(int x, int y, int ui_w, int ui_h, const char* label, const UI *cur_ui) :
+  Fl_Pack(x, y, ui_w, ui_h, label)
 {
    PointerOnLink = FALSE;
 
@@ -676,11 +676,12 @@
 
    // Control panel
    TopGroup->begin();
-    make_panel(ww);
+    make_panel(ui_w);
  
     // Render area
-    int mh = wh - (lh+bh+sh);
+    int mh = ui_h - (lh+bh+sh);
     Main = new Fl_Group(0,0,0,mh,"Welcome...");
+    Main->align(FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
     Main->box(FL_FLAT_BOX);
     Main->color(FL_GRAY_RAMP + 3);
     Main->labelfont(FL_HELVETICA_BOLD_ITALIC);
@@ -691,11 +692,11 @@
     MainIdx = TopGroup->find(Main);
  
     // Find text bar
-    findbar = new Findbar(ww, 28);
+    findbar = new Findbar(ui_w, 28);
     //TopGroup->add(findbar);
  
     // Status Panel
-    make_status_panel(ww);
+    make_status_panel(ui_w);
     //TopGroup->add(StatusPanel);
 
    TopGroup->end();
@@ -1058,14 +1059,13 @@
  */
 void UI::set_render_layout(Fl_Group &nw)
 {
-   // We'll use a workaround in a_UIcmd_browser_window_new() instead.
    TopGroup->remove(MainIdx);
    delete(Main);
    TopGroup->insert(nw, MainIdx);
    Main = &nw;
+   TopGroup->resizable(Main);
    //TopGroup->box(FL_DOWN_BOX);
    //TopGroup->box(FL_BORDER_FRAME);
-   TopGroup->resizable(TopGroup->child(MainIdx));
 }
 
 /*
--- a/src/uicmd.cc	Wed Mar 09 14:21:25 2011 -0300
+++ b/src/uicmd.cc	Wed Mar 09 14:22:32 2011 -0300
@@ -21,6 +21,7 @@
 #include <FL/Fl_Double_Window.H>
 #include <FL/Fl_Wizard.H>
 #include <FL/Fl_Box.H>
+#include <FL/names.h>
 
 #include "paths.hh"
 #include "keys.hh"
@@ -55,6 +56,7 @@
  * Local data
  */
 static char *save_dir = NULL;
+static UI *Gui;
 
 
 //----------------------------------------------------------------------------
@@ -95,7 +97,10 @@
 
       Wizard = new Fl_Wizard(0,tab_h,ww,wh-tab_h);
       Wizard->end();
-      add_new_tab(1);
+      Gui = add_new_tab(1);
+      printf("Wizard window: %p\n", Wizard->window());
+      //printf("Gui visible: %d\n", Gui->visible());
+      //printf("Gui visible_r: %d\n", Gui->visible_r());
    };
    int handle(int e);
    UI *add_new_tab(int focus);
@@ -150,6 +155,7 @@
    UI *new_ui = new UI(0,tab_h,Wizard->w(),Wizard->h());
    new_ui->tabs(this);
    Wizard->add(new_ui);
+   new_ui->show();
 
    int ntabs = children();
    snprintf(tab_label, 64,"ctab%d", ++tab_n);
@@ -306,16 +312,21 @@
    else
       win = new Fl_Double_Window(ww, wh);
 
-   Fl_Group::current(0);
+   //Fl_Group::current(0);
    CustTabs *DilloTabs = new CustTabs(ww, wh, 16);
    DilloTabs->selection_color(156);
-   win->add(DilloTabs);
+   //win->add(DilloTabs);
 
+#if 0
    // Create and set the UI
    UI *new_ui = DilloTabs->add_new_tab(1);
+   //DilloTabs->window()->show();
+#else
+   UI *new_ui = Gui;
+   //win->resizable(new_ui);
    win->resizable(new_ui);
    win->show();
-   //DilloTabs->window()->show();
+#endif
 
    if (old_bw == NULL && prefs.xpos >= 0 && prefs.ypos >= 0) {
       // position the first window according to preferences
@@ -349,7 +360,7 @@
 
    win->callback(win_cb, DilloTabs);
 
-   new_ui->focus_location();
+   //new_ui->focus_location();
 
    return new_bw;
 }
@@ -479,10 +490,12 @@
  */
 void a_UIcmd_open_url(BrowserWindow *bw, const DilloUrl *url)
 {
+#if 0
    a_Nav_push(bw, url, NULL);
    if (BW2UI(bw)->get_panelmode() == UI_TEMPORARILY_SHOW_PANELS)
       BW2UI(bw)->set_panelmode(UI_HIDDEN);
    a_UIcmd_focus_main_area(bw);
+#endif
 }
 
 static void UIcmd_open_url_nbw(BrowserWindow *new_bw, const DilloUrl *url)
@@ -1117,6 +1130,7 @@
  */
 void a_UIcmd_set_buttons_sens(BrowserWindow *bw)
 {
+#if 0
    int sens;
 
    // Stop
@@ -1129,6 +1143,7 @@
    sens = (a_Nav_stack_ptr(bw) < a_Nav_stack_size(bw) - 1 &&
            !bw->nav_expecting);
    BW2UI(bw)->button_set_sens(UI_FORW, sens);
+#endif
 }
 
 /*