Merge branch 'new_panels' of https://vcs.maemo.org/git/situare into new_panels
[situare] / src / ui / tabbedpanel.cpp
index 2321ceb..f534a86 100644 (file)
@@ -38,6 +38,7 @@ TabbedPanel::TabbedPanel(QWidget *parent)
 {
     qDebug() << __PRETTY_FUNCTION__;
 
+    ///< @todo Do not use this, REMOVE ALL OCCURENCES IN ALL FILES!
     this->resize(PANEL_BAR_TABBED_WIDTH + PANEL_WIDTH, PANEL_HEIGHT);
     this->move(PANEL_CLOSED_X, PANEL_TOP_PADDING);
 
@@ -97,6 +98,7 @@ int TabbedPanel::addTab(QWidget *widget, const QIcon& icon)
 {
     qDebug() << __PRETTY_FUNCTION__;
 
+    ///< @todo magic
     return insertTab(-1, widget, icon);
 }
 
@@ -104,6 +106,7 @@ int TabbedPanel::insertTab(int index, QWidget *widget, const QIcon& icon)
 {
     qDebug() << __PRETTY_FUNCTION__;
 
+    ///< @todo callers responsibility to call with right parameters
     if(!widget)
         return -1;
 
@@ -123,6 +126,7 @@ void TabbedPanel::removeTab(int index)
     }
 }
 
+///< @todo sort alphabetically (other methods too)
 void TabbedPanel::closePanel()
 {
     qDebug() << __PRETTY_FUNCTION__;
@@ -143,6 +147,7 @@ void TabbedPanel::showTab(int index)
 {
     qDebug() << __PRETTY_FUNCTION__;
 
+///< @todo if ((first) && (second)) {
     if (index < m_panelWidgetStack->count() && index >= 0) {
         m_panelWidgetStack->setCurrentIndex(index);
         openPanel();
@@ -157,16 +162,18 @@ void TabbedPanel::resizePanel(const QSize &size)
     this->resize(PANEL_BAR_TABBED_WIDTH + PANEL_WIDTH,
                  size.height() - PANEL_TOP_PADDING - PANEL_BOTTOM_PADDING);
 
-    if(!m_isOpen)
+    if (!m_isOpen) {
         this->move(size.width() - PANEL_TAB_WIDTH - PANEL_BAR_WIDTH, PANEL_TOP_PADDING);
-    else
+    } else {
         this->move(size.width() - PANEL_TAB_WIDTH - PANEL_BAR_WIDTH - PANEL_WIDTH,
                    PANEL_TOP_PADDING);
+    }
 
     m_panelBar->resizeBar(size);
 
     m_panelContent->resizePanelContent(size);
 
+    ///< @todo alignment
     m_panelStateClosed->assignProperty(this, "pos",
                         QPoint(size.width() - PANEL_TAB_WIDTH - PANEL_BAR_WIDTH, PANEL_TOP_PADDING));
     m_panelStateOpened->assignProperty(this, "pos",