changeset 1927:e7abafb75d0e

Made Dillo code follow my fltk1.3 UI prototype
author Jorge Arellano Cid <jcid@dillo.org>
date Wed, 09 Mar 2011 14:21:25 -0300
parents 5a0a49770247
children 261762bef174
files src/ui.cc src/ui.hh
diffstat 2 files changed, 27 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/src/ui.cc	Wed Mar 09 14:20:19 2011 -0300
+++ b/src/ui.cc	Wed Mar 09 14:21:25 2011 -0300
@@ -525,9 +525,6 @@
 void UI::make_panel(int ww)
 {
    Fl_Widget *w;
-   CustGroup *g1;
-   Fl_Group *g2, *g3;
-   Fl_Pack *pg;
 
    if (PanelSize > P_large) {
       PanelSize = P_tiny;
@@ -565,52 +562,53 @@
    nh = bh, sh = 24;
 
    if (PanelSize == P_tiny) {
-      g1 = new CustGroup(0,0,ww,bh);
-       // Toolbar
+      NavBar = new CustGroup(0,0,ww,bh);
+      NavBar->begin();
        make_toolbar(ww,bh);
        make_filemenu_button();
        make_location(ww);
-       g1->resizable(Location);
+       NavBar->resizable(Location);
        make_progress_bars(0,1);
-      g1->box(FL_THIN_UP_FRAME);
-      g1->end();
+      NavBar->box(FL_THIN_UP_FRAME);
+      NavBar->end();
    } else {
        // File menu
        if (PanelSize == P_large) {
-          g3 = new Fl_Group(0,0,ww,lh);
-          g3->box(FL_FLAT_BOX);
-          Fl_Widget *bn = make_filemenu_button();
-          g3->add(bn);
-          g3->add_resizable(*new Fl_Box(bn->w(),0,ww - bn->w(),lh));
+          Fl_Group *g3 = new Fl_Group(0,0,ww,lh);
+          g3->begin();
+           g3->box(FL_FLAT_BOX);
+           Fl_Widget *bn = make_filemenu_button();
+           g3->add_resizable(*new Fl_Box(bn->w(),0,ww - bn->w(),lh));
+          g3->end();
 
-          g2 = new Fl_Group(0,fh,ww,lh);
-          g2->begin();
-          //pg = make_location();
-          pg->size(ww,lh);
+          LocBar = new CustGroup(0,0,ww,lh);
+          LocBar->begin();
+           make_location(ww);
+          LocBar->end();
        } else {
-          g2 = new CustGroup(0,0,ww,lh);
+          LocBar = new CustGroup(0,0,ww,lh);
            p_xpos = 0;
            make_filemenu_button();
            make_location(ww);
-           g2->resizable(Location);
-          g2->end();
+           LocBar->resizable(Location);
+          LocBar->end();
        }
 
        // Toolbar
        p_ypos = 0;
-       g3 = new CustGroup(0,0,ww,bh);
-       g3->begin();
+       NavBar = new CustGroup(0,0,ww,bh);
+       NavBar->begin();
         make_toolbar(ww,bh);
         w = new Fl_Box(p_xpos,0,ww-p_xpos-2*pw,bh,"i n v i s i b l e");
         w->box(FL_THIN_UP_BOX);
-        g3->resizable(w);
+        NavBar->resizable(w);
         p_xpos = ww - 2*pw;
         if (PanelSize == P_small) {
            make_progress_bars(0,0);
         } else {
            make_progress_bars(1,0);
         }
-       g3->end();
+       NavBar->end();
    }
 }
 
@@ -984,6 +982,8 @@
       Help->hide();
 // if ( !prefs.show_progress_box )
 //    ProgBox->hide();
+
+   NavBar->rearrange();
 }
 
 /*
@@ -991,8 +991,9 @@
  */
 void UI::panel_cb_i()
 {
+#if 0
    Fl_Group *NewPanel;
-#if 0
+
    // Create a new Panel
    ++PanelSize;
    NewPanel = make_panel(TopGroup->w());
--- a/src/ui.hh	Wed Mar 09 14:20:19 2011 -0300
+++ b/src/ui.hh	Wed Mar 09 14:21:25 2011 -0300
@@ -121,6 +121,7 @@
    Fl_Group *TopGroup;
    Fl_Button *Back, *Forw, *Home, *Reload, *Save, *Stop, *Bookmarks, *Tools,
           *Clear, *Search, *Help, *FullScreen, *BugMeter, *FileButton;
+   CustGroup *LocBar, *NavBar, *StBar;
    Fl_Input  *Location;
    Fl_Pack *ProgBox;
    CustProgressBox *PProg, *IProg;