Some minor cosmetic changes and removed an unnecessary constant from panelcommon.h
authorPekka Nissinen <pekka.nissinen@ixonos.com>
Tue, 31 Aug 2010 13:26:57 +0000 (16:26 +0300)
committerPekka Nissinen <pekka.nissinen@ixonos.com>
Tue, 31 Aug 2010 13:26:57 +0000 (16:26 +0300)
src/ui/panelcommon.h
src/ui/paneltab.cpp
src/ui/paneltabbar.cpp
src/ui/paneltabbar.h
src/ui/tabbedpanel.cpp
src/ui/tabbedpanel.h

index 251ee53..ccafaa3 100644 (file)
@@ -56,8 +56,6 @@ const int PANEL_CLOSED_X = DEFAULT_SCREEN_WIDTH - PANEL_TAB_WIDTH
 const int PANEL_OPENED_X = DEFAULT_SCREEN_WIDTH - PANEL_TAB_WIDTH - PANEL_BAR_WIDTH
                                  - PANEL_WIDTH;     ///< Horizontal position of a open panel
 
-const int TAB_WIDTH_ACTIVE = 74;    ///< Active tab's width
-
 // Zoom button panel settings
 const int ZOOM_BUTTON_PANEL_POSITION_X = 10; ///< Horizontal position of zoom panel
 const int ZOOM_BUTTON_PANEL_POSITION_Y = 10; ///< Vertical position of zoom panel
index 95276ad..d71fbea 100644 (file)
 #include <QPainter>
 #include <QRect>
 
-#include "panelcommon.h"
 #include "paneltab.h"
 
 const int TAB_HEIGHT = 66;
+const int TAB_WIDTH_ACTIVE = 74;
 
 PanelTab::PanelTab(QWidget *parent)
     : QToolButton(parent),
index a591ac7..2c97ba8 100644 (file)
@@ -36,7 +36,7 @@ PanelTabBar::PanelTabBar(QWidget *parent)
 {
     qDebug() << __PRETTY_FUNCTION__;
 
-    setFixedWidth(TAB_WIDTH_ACTIVE);
+    setFixedWidth(PANEL_TAB_WIDTH);
 
     m_tabButtonGroup = new QButtonGroup(this);
 
index be4c3c1..35ed793 100644 (file)
@@ -117,8 +117,8 @@ signals:
     void currentChanged(int index);
 
     /**
-    * @brief This signal is emitted whenever content is changed.
-    */
+     * @brief This signal is emitted when tabs are added or removed
+     */
     void sizeChangeRequested();
 
     /**
index d5deee7..44a3fd0 100644 (file)
@@ -58,15 +58,15 @@ TabbedPanel::TabbedPanel(QWidget *parent)
     connect(m_panelTabBar, SIGNAL(currentChanged(int)),
             this, SLOT(setCurrentIndex(int)));
 
+    connect(m_panelTabBar, SIGNAL(sizeChangeRequested()),
+            this, SLOT(calculateMask()));
+
     connect(m_panelTabBar, SIGNAL(tabCloseRequested(int)),
              this, SLOT(closePanel()));
 
     connect(this, SIGNAL(panelClosed()),
             m_panelTabBar, SLOT(deselectTabs()));
 
-    connect(m_panelTabBar, SIGNAL(sizeChangeRequested()),
-            this, SLOT(calculateMask()));
-
     // --- BAR ---
     m_panelBar = new PanelBar(this);
     m_panelBar->move(PANEL_TAB_WIDTH, PANEL_TOP_Y);
@@ -207,6 +207,7 @@ void TabbedPanel::repositionContextButtonBar()
     qDebug() << __PRETTY_FUNCTION__;
 
     m_panelContextButtonBar->move(PANEL_CONTEXT_BUTTON_BAR_LEFT_X, height());
+    
     calculateMask();
 }
 
index 6a483bf..4c1146e 100644 (file)
@@ -119,10 +119,10 @@ public slots:
 
 private slots:
     /**
-    * @brief Calculates mask for this widget.
-    *
-    * Mask is constructed from PanelTabBar, PanelContextButtonBar and panel content sizes.
-    */
+     * @brief Calculates mask for tabbed panel
+     *
+     * Mask is constructed from PanelTabBar, PanelContextButtonBar and panel content sizes.
+     */
     void calculateMask();
 
     /**