diff libgui/src/main-window.cc @ 17083:ceca3e65a8fe

make sure a central menu bar does not show a widgets title but "Octave" * main_window.cc(set_window_layout): show docked widgets, then main window, and finally the floating widgets to make sure the main window ist the first shown window * octave-gui.cc(octave_start_gui): do not show main window here
author Torsten <ttl@justmail.de>
date Thu, 25 Jul 2013 21:51:54 +0200
parents 359c5ca795cd
children 1d544ac39369
line wrap: on
line diff
--- a/libgui/src/main-window.cc	Thu Jul 25 11:32:23 2013 -0700
+++ b/libgui/src/main-window.cc	Thu Jul 25 21:51:54 2013 +0200
@@ -542,6 +542,8 @@
 void
 main_window::set_window_layout (QSettings *settings)
 {
+  QList<octave_dock_widget *> float_and_visible;
+
   // Restore the geometry of all dock-widgets
   foreach (octave_dock_widget *widget, dock_widget_list ())
     {
@@ -564,12 +566,21 @@
           // make widget visible if desired
           bool visible = settings->value
               ("DockWidgets/" + name + "Visible", true).toBool ();
-          widget->setVisible (visible);
+          if (floating && visible)              // floating and visible
+            float_and_visible.append (widget);  // not show before main win
+          else
+            widget->setVisible (visible);       // not floating -> show
         }
     }
 
   restoreState (settings->value ("MainWindow/windowState").toByteArray ());
   restoreGeometry (settings->value ("MainWindow/geometry").toByteArray ());
+  show ();  // main window is ready and can be shown (as first window)
+
+  // show floating widgets after main win to ensure "Octave" in central menu
+  foreach (octave_dock_widget *widget, float_and_visible)
+     widget->setVisible (true);
+
 }
 
 void