Reviewed new files
[situare] / src / ui / tabbedpanel.cpp
index ec2aff2..a35d9aa 100644 (file)
 TabbedPanel::TabbedPanel(QWidget *parent)
     : QWidget(parent),
       m_isOpen(false),
-      m_activeTab(-1)
+      m_activeTab(-1) ///< @todo magic
 {
     qDebug() << __PRETTY_FUNCTION__;
 
+    ///< @todo Do not use this, REMOVE ALL OCCURENCES!
     this->resize(PANEL_BAR_TABBED_WIDTH + PANEL_WIDTH, PANEL_HEIGHT);
     this->move(PANEL_CLOSED_X, PANEL_TOP_PADDING);
 
@@ -94,6 +95,7 @@ int TabbedPanel::addTab(QWidget *widget, const QIcon& icon)
 {
     qDebug() << __PRETTY_FUNCTION__;
 
+    ///< @todo magic
     return insertTab(-1, widget, icon);
 }
 
@@ -101,16 +103,18 @@ 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;
 
+    ///< @todo magic
     int verticalStartPoint = 8;
 
     index = m_panelWidgetStack->insertWidget(index, widget);
     m_tabButtonGroup->addButton(new PanelTab(this), index);
     m_tabButtonGroup->button(index)->setIcon(icon);
 
-    // [BEGIN]: Purkkaa (to be removed ASAP!!!)
+    ///< @todo [BEGIN]: Purkkaa (to be removed ASAP!!!)
     if(index > 0)
         verticalStartPoint += 65 * index;
 
@@ -133,6 +137,7 @@ void TabbedPanel::removeTab(int index)
     }
 }
 
+///< @todo sort alphabetically (other methods too)
 void TabbedPanel::closePanel()
 {
     qDebug() << __PRETTY_FUNCTION__;
@@ -156,16 +161,19 @@ 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",
@@ -177,6 +185,8 @@ void TabbedPanel::setActiveTab(int index)
 {
     qDebug() << __PRETTY_FUNCTION__;
 
+    ///< @todo magic
+    ///< @todo short comments?
     if(m_activeTab == -1) {
         m_activeTab = index;
         m_panelWidgetStack->setCurrentIndex(index);