Fixed the stacking order of the UI components
authorSami Rämö <sami.ramo@ixonos.com>
Thu, 19 Aug 2010 09:06:34 +0000 (12:06 +0300)
committerSami Rämö <sami.ramo@ixonos.com>
Thu, 19 Aug 2010 09:19:12 +0000 (12:19 +0300)
 - Reviewed by Jussi Laitinen

 - Removed layout from the MainWindow and set the MapView to be
   the central widget.

 - Some small modifications to the stacking order

src/ui/mainwindow.cpp

index 34e99a0..c01091c 100644 (file)
@@ -79,14 +79,9 @@ MainWindow::MainWindow(QWidget *parent)
 
     buildMap();
 
-    // build main layout
-    QHBoxLayout *layout = new QHBoxLayout;
-    layout->addWidget(m_mapView);
-    layout->setMargin(0);
-    layout->setSpacing(0);
-
-    setCentralWidget(new QWidget());
-    centralWidget()->setLayout(layout);
+    // map view is the only widget which size & location is handled automatically by the system
+    // default functionality
+    setCentralWidget(m_mapView);
 
     buildPanels();
 
@@ -94,14 +89,14 @@ MainWindow::MainWindow(QWidget *parent)
     setWindowTitle(tr("Situare"));
 
     // set stacking order of widgets (from top to bottom)
-    // if fullscreen button exists, then it is the topmost one, otherwise own location crosshair is
+    // if the fullscreen button exists, then it is the topmost one, otherwise the tabbed panel is
     if (m_fullScreenButton) {
-        m_ownLocationCrosshair->stackUnder(m_fullScreenButton);
+        m_tabbedPanel->stackUnder(m_fullScreenButton);
     }
+    m_ownLocationCrosshair->stackUnder(m_tabbedPanel);
     m_zoomButtonPanel->stackUnder(m_ownLocationCrosshair);
     m_indicatorButtonPanel->stackUnder(m_zoomButtonPanel);
-    m_tabbedPanel->stackUnder(m_indicatorButtonPanel);
-    m_osmLicense->stackUnder(m_tabbedPanel);
+    m_osmLicense->stackUnder(m_indicatorButtonPanel);
     m_mapScale->stackUnder(m_osmLicense);
     m_mapView->stackUnder(m_mapScale);