Added close panel call when currently selected tab is disabled.
[situare] / src / ui / tabbedpanel.h
index b7473cc..12fefa9 100644 (file)
@@ -41,7 +41,7 @@ class PanelTabBar;
  * @brief Class for tabbed panels
  *
  * @author Kaj Wallin - kaj.wallin (at) ixonos.com
- * @author Pekka Nissinen - pekka.nissinen@ixonos.com
+ * @author Pekka Nissinen - pekka.nissinen (at) ixonos.com
  */
 class TabbedPanel : public QWidget
 {
@@ -95,6 +95,15 @@ public:
      */
     void removeTab(int index);
 
+    /**
+    * @brief Sets tabs enabled.
+    *
+    * If disabled tab is currently selected, panel will be closed also
+    * @param tabIndexes tab indexes to set
+    * @param enabled true if should be enabled, false otherwise
+    */
+    void setTabsEnabled(const QList<int> &tabIndexes, bool enabled);
+
 public slots:
     /**
      * @brief Slot that closes the panel
@@ -119,6 +128,18 @@ public slots:
 
 private slots:
     /**
+     * @brief Calculates mask for tabbed panel
+     *
+     * Mask is constructed from PanelTabBar, PanelContextButtonBar and panel content sizes
+     */
+    void calculateMask();
+
+    /**
+     * @brief Repositions context button bar
+     */
+    void repositionContextButtonBar();
+
+    /**
      * @brief Sets the panel at current index active
      *
      * @param index Index of the panel
@@ -169,11 +190,11 @@ signals:
  * DATA MEMBERS
  ******************************************************************************/
 private:
-    bool m_open;                            ///< Current state of the panel
-    bool m_closeRequestPending;
+    bool m_open;                ///< Current state of the panel
+    bool m_closeRequestPending; ///< Indicates wheater the panel is waiting to be closed
 
-    QState *m_stateClosed;                  ///< State of the closed panel
-    QState *m_stateOpened;                  ///< State of the opened panel
+    QState *m_stateClosed;      ///< State of the closed panel
+    QState *m_stateOpened;      ///< State of the opened panel
 
     PanelBar *m_panelBar;                               ///< Widget for panel bar
     PanelContentStack *m_panelContentStack;             ///< Stack for panel widgets