{
qDebug() << __PRETTY_FUNCTION__;
+ const int FRIENDPANEL_FILTER_MARGIN_LEFT = PANEL_MARGIN_LEFT + 4;
+ const int FRIENDPANEL_FILTER_MARGIN_RIGHT = PANEL_MARGIN_RIGHT + MAEMO5_SCROLLBAR_WIDTH + 4;
+
QVBoxLayout *friendListPanelLayout = new QVBoxLayout();
friendListPanelLayout->setMargin(0);
friendListPanelLayout->setSpacing(0);
/**
* @brief Public slot to intercept signal when old cerdentials are invalid or credentials
* doesn't exist yet
- *
*/
void startLoginProcess();
#include <QString>
-#include "../common.h"
+#include "common.h"
// Dragging settings
const int DRAG_INIT_TIME = 1000; ///< How long buttons must be pressed to start drag mode
const int PANEL_MARGIN_TOP = 0; ///< Panel inner margin (top)
const int PANEL_MARGIN_BOTTOM = 0; ///< Panel inner margin (bottom)
-/**
- * @brief Friend list filter bar margin (left)
- *
- * @var FRIENDPANEL_FILTER_MARGIN_LEFT
- */
-///< @todo not really commom
-const int FRIENDPANEL_FILTER_MARGIN_LEFT = PANEL_MARGIN_LEFT + 4;
-
-/**
- * @brief Friend list filter bar margin (right)
- *
- * @var FRIENDPANEL_FILTER_MARGIN_RIGHT
- */
-///< @todo not really common
-const int FRIENDPANEL_FILTER_MARGIN_RIGHT = PANEL_MARGIN_RIGHT + MAEMO5_SCROLLBAR_WIDTH + 4;
-
-const int SHOW_ALL_BUTTON_RIGHT_MARGIN = 39; ///< Show all button right margin
-
const int PANEL_CLOSED_X = DEFAULT_SCREEN_WIDTH - PANEL_TAB_WIDTH
- PANEL_BAR_WIDTH; ///< Horizontal position of a closed panel
{
qDebug() << __PRETTY_FUNCTION__;
+ const QColor SEMI_TRANSPARENT_BLACK = QColor(0, 0, 0, 128);
+
resize(PANEL_WIDTH, PANEL_HEIGHT);
m_menuDropShadowTile.load(":res/images/menu_bar_drop_shadow.png");
QPalette pal = palette();
- pal.setColor(QPalette::Background, QColor(0, 0, 0, 128));
+ pal.setColor(QPalette::Background, SEMI_TRANSPARENT_BLACK);
setPalette(pal);
setAutoFillBackground(true);
}
Q_UNUSED(event);
QPainter painter(this);
-
- QRect shadowRect = QRect(0, 0, this->rect().width(), m_menuDropShadowTile.height());
+ ///< @todo magic
+ QRect shadowRect = QRect(0, 0, rect().width(), m_menuDropShadowTile.height());
painter.drawTiledPixmap(shadowRect, m_menuDropShadowTile);
}
-void PanelContentStack::resizePanelContentStack(const QSize &size)
+void PanelContentStack::resizeContentStack(const QSize &size)
{
qDebug() << __PRETTY_FUNCTION__;
*
* @param size Size of the new window
*/
- void resizePanelContentStack(const QSize &size);
+ void resizeContentStack(const QSize &size);
/*******************************************************************************
* DATA MEMBERS
QPainter painter(this);
if (isChecked()) {
+ ///< @todo magic
m_tabRect.setRect(0, 0, TAB_WIDTH_ACTIVE, TAB_HEIGHT);
painter.drawPixmap(m_tabRect, m_tabActiveImage);
} else {
+ ///< @todo magic
m_tabRect.setRect(TAB_WIDTH_ACTIVE - TAB_WIDTH, 0, TAB_WIDTH, TAB_HEIGHT);
painter.drawPixmap(m_tabRect, m_tabInactiveImage);
}
#include "paneltabbar.h"
+const int NO_ACTIVE_TABS = -1;
+
PanelTabBar::PanelTabBar(QWidget *parent)
: QWidget(parent),
- m_activeTab(-1) ///< @todo magic
+ m_activeTab(NO_ACTIVE_TABS)
{
qDebug() << __PRETTY_FUNCTION__;
{
qDebug() << __PRETTY_FUNCTION__;
- const int TAB_BAR_TOP_SPACING = 8;
-
- int verticalStartPoint = TAB_BAR_TOP_SPACING;
-
m_tabButtonGroup->addButton(new PanelTab(this), index);
m_tabButtonGroup->button(index)->setIcon(icon);
- ///< @todo [BEGIN]: Purkkaa (to be removed ASAP!!!)
- if (index > 0)
- verticalStartPoint += 65 * index;
-
- m_tabButtonGroup->button(index)->move(0, verticalStartPoint);
- // [END]: Purkkaa
+ setUpTabLayout();
return index;
}
if (QAbstractButton *tab = m_tabButtonGroup->button(index)) {
m_tabButtonGroup->removeButton(tab);
delete tab;
+
+ setUpTabLayout();
}
}
qDebug() << __PRETTY_FUNCTION__;
if (m_activeTab == index) {
- ///< @todo magic
- m_activeTab = -1;
+ m_activeTab = NO_ACTIVE_TABS;
emit tabCloseRequested(index);
} else {
m_activeTab = index;
emit currentChanged(index);
}
}
+
+void PanelTabBar::setUpTabLayout()
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ const int TAB_BUTTON_STEPPING = 65;
+
+ QList<QAbstractButton *> tabList = m_tabButtonGroup->buttons();
+
+ for (int i = 0; i < tabList.size(); i ++) {
+ tabList.at(i)->move(0, i * TAB_BUTTON_STEPPING);
+ }
+}
*/
void removeTab(int index);
+private:
+ /**
+ * @brief Initializes and formats tab buttons layout
+ */
+ void setUpTabLayout();
+
public slots:
/**
* @brief This slot is used to clear tab selections
{
qDebug() << __PRETTY_FUNCTION__;
+ const int TAB_BAR_TOP_SPACING = 8;
+
resize(PANEL_BAR_TABBED_WIDTH + PANEL_WIDTH, PANEL_HEIGHT);
move(PANEL_CLOSED_X, PANEL_TOP_PADDING);
// --- TABS ---
m_panelTabBar = new PanelTabBar(this);
+ m_panelTabBar->move(0, TAB_BAR_TOP_SPACING);
connect(m_panelTabBar, SIGNAL(currentChanged(int)),
this, SLOT(setCurrentIndex(int)));
// --- BAR ---
m_panelBar = new PanelBar(this);
+ ///< @todo magic
m_panelBar->move(PANEL_TAB_WIDTH, 0);
// --- PANEL CONTENT ---
m_panelContentStack = new PanelContentStack(this);
+ ///< @todo magic
m_panelContentStack->move(PANEL_TAB_WIDTH + PANEL_BAR_WIDTH, 0);
// --- PANEL ANIMATION ---
m_panelBar->resizeBar(size);
- m_panelContentStack->resizePanelContentStack(size);
+ m_panelContentStack->resizeContentStack(size);
QPoint closedPosition(size.width() - PANEL_TAB_WIDTH - PANEL_BAR_WIDTH, PANEL_TOP_PADDING);
m_panelStateClosed->assignProperty(this, "pos", closedPosition);