changeset 1976:041d4979092f

Made on-the-fly control panel work again
author Jorge Arellano Cid <jcid@dillo.org>
date Thu, 21 Apr 2011 13:14:44 -0300
parents 06bbf0f0df1c
children e816e06ee901
files src/ui.cc
diffstat 1 files changed, 17 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/ui.cc	Thu Apr 21 13:12:51 2011 -0300
+++ b/src/ui.cc	Thu Apr 21 13:14:44 2011 -0300
@@ -1017,18 +1017,26 @@
  */
 void UI::panel_cb_i()
 {
-#if 0
-   Fl_Group *NewPanel;
+   // Remove current panel's bars
+   init_sizes();
+   TopGroup->remove(MenuBar);
+   Fl::delete_widget(MenuBar);
+   TopGroup->remove(LocBar);
+   Fl::delete_widget(LocBar);
+   TopGroup->remove(NavBar);
+   Fl::delete_widget(NavBar);
+   MenuBar = LocBar = NavBar = NULL;
 
-   // Create a new Panel
+   // make a new panel
    ++PanelSize;
-   NewPanel = make_panel(TopGroup->w());
-   TopGroup->remove(Panel);
-   delete(Panel);
-   TopGroup->add(NewPanel);
-   Panel = NewPanel;
+   make_panel(TopGroup->w());
    customize(0);
-#endif
+
+   // adjust Main's height
+   int main_h = h() - (mh+(LocBar?lh:0)+nh+(FindBarSpace?fh:0)+sh);
+   Main->size(Main->w(), main_h);
+   redraw();
+
    Location->take_focus();
 }