From: Sami Rämö Date: Mon, 16 Aug 2010 09:02:59 +0000 (+0300) Subject: Merge branch 'new_panels' of https://vcs.maemo.org/git/situare into new_panels X-Git-Tag: v2.0b-1~74 X-Git-Url: https://vcs.maemo.org/git/?p=situare;a=commitdiff_plain;h=8cd386f91d1030ce4a7f3580b349d711166adc7d Merge branch 'new_panels' of https://vcs.maemo.org/git/situare into new_panels - Reviewed by Sami Rämö Conflicts: src/ui/panelbar.cpp src/ui/paneltab.h src/ui/tabbedpanel.cpp --- 8cd386f91d1030ce4a7f3580b349d711166adc7d diff --cc src/ui/panelbar.cpp index 9a426b1,5de1679..1bfbfaf --- a/src/ui/panelbar.cpp +++ b/src/ui/panelbar.cpp @@@ -28,9 -28,7 +28,9 @@@ #include "panelcommon.h" - ///< @todo requires clean-up ++///< @todo requires clean-up, there is some commented code + - PanelBar::PanelBar(QWidget *parent) //, Side side) + PanelBar::PanelBar(QWidget *parent) : QWidget(parent) { qDebug() << __PRETTY_FUNCTION__; diff --cc src/ui/paneltab.h index fe0c7f4,6742ec0..f4fe610 --- a/src/ui/paneltab.h +++ b/src/ui/paneltab.h @@@ -64,6 -68,6 +68,7 @@@ protected */ void mouseReleaseEvent(QMouseEvent *event); ++///< @todo parameter name missing (also in .cpp) /** * @brief Draws the tab button * @@@ -81,13 -88,12 +89,13 @@@ public * DATA MEMBERS ******************************************************************************/ private: - bool m_tabActive; - bool m_tabSelected; + bool m_tabActive; ///< Boolean used to track whether the tab button is active or not + bool m_tabSelected; ///< Boolean used to track whether the tab button is selected or not + ///< @todo magic, replace with enum? - QPixmap m_tabPixmaps[3]; + QPixmap m_tabPixmaps[3]; ///< Pixmap table for tab button images - QRect m_tabRect; + QRect m_tabRect; ///< Rect for the tab button }; #endif // PANELTAB_H diff --cc src/ui/tabbedpanel.cpp index a35d9aa,2321ceb..f534a86 --- a/src/ui/tabbedpanel.cpp +++ b/src/ui/tabbedpanel.cpp @@@ -41,7 -38,6 +38,7 @@@ TabbedPanel::TabbedPanel(QWidget *paren { qDebug() << __PRETTY_FUNCTION__; - ///< @todo Do not use this, REMOVE ALL OCCURENCES! ++ ///< @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); @@@ -154,6 -139,17 +143,18 @@@ void TabbedPanel::openPanel( emit toggleState(); } + void TabbedPanel::showTab(int index) + { + qDebug() << __PRETTY_FUNCTION__; + ++///< @todo if ((first) && (second)) { + if (index < m_panelWidgetStack->count() && index >= 0) { + m_panelWidgetStack->setCurrentIndex(index); + openPanel(); + emit currentChanged(index); + } + } + void TabbedPanel::resizePanel(const QSize &size) { qDebug() << __PRETTY_FUNCTION__; @@@ -161,13 -157,11 +162,12 @@@ this->resize(PANEL_BAR_TABBED_WIDTH + PANEL_WIDTH, size.height() - PANEL_TOP_PADDING - PANEL_BOTTOM_PADDING); - if(!m_isOpen) { - if(!m_isOpen) ++ if (!m_isOpen) { this->move(size.width() - PANEL_TAB_WIDTH - PANEL_BAR_WIDTH, PANEL_TOP_PADDING); - } - else { - else ++ } else { this->move(size.width() - PANEL_TAB_WIDTH - PANEL_BAR_WIDTH - PANEL_WIDTH, PANEL_TOP_PADDING); + } m_panelBar->resizeBar(size);