const int PANEL_OPENED_X = DEFAULT_SCREEN_WIDTH - PANEL_TAB_WIDTH - PANEL_BAR_WIDTH
- PANEL_WIDTH; ///< Horizontal position of a open panel
-const int TAB_WIDTH_ACTIVE = 74; ///< Active tab's width
-
// Zoom button panel settings
const int ZOOM_BUTTON_PANEL_POSITION_X = 10; ///< Horizontal position of zoom panel
const int ZOOM_BUTTON_PANEL_POSITION_Y = 10; ///< Vertical position of zoom panel
#include <QPainter>
#include <QRect>
-#include "panelcommon.h"
#include "paneltab.h"
const int TAB_HEIGHT = 66;
+const int TAB_WIDTH_ACTIVE = 74;
PanelTab::PanelTab(QWidget *parent)
: QToolButton(parent),
{
qDebug() << __PRETTY_FUNCTION__;
- setFixedWidth(TAB_WIDTH_ACTIVE);
+ setFixedWidth(PANEL_TAB_WIDTH);
m_tabButtonGroup = new QButtonGroup(this);
void currentChanged(int index);
/**
- * @brief This signal is emitted whenever content is changed.
- */
+ * @brief This signal is emitted when tabs are added or removed
+ */
void sizeChangeRequested();
/**
connect(m_panelTabBar, SIGNAL(currentChanged(int)),
this, SLOT(setCurrentIndex(int)));
+ connect(m_panelTabBar, SIGNAL(sizeChangeRequested()),
+ this, SLOT(calculateMask()));
+
connect(m_panelTabBar, SIGNAL(tabCloseRequested(int)),
this, SLOT(closePanel()));
connect(this, SIGNAL(panelClosed()),
m_panelTabBar, SLOT(deselectTabs()));
- connect(m_panelTabBar, SIGNAL(sizeChangeRequested()),
- this, SLOT(calculateMask()));
-
// --- BAR ---
m_panelBar = new PanelBar(this);
m_panelBar->move(PANEL_TAB_WIDTH, PANEL_TOP_Y);
qDebug() << __PRETTY_FUNCTION__;
m_panelContextButtonBar->move(PANEL_CONTEXT_BUTTON_BAR_LEFT_X, height());
+
calculateMask();
}
private slots:
/**
- * @brief Calculates mask for this widget.
- *
- * Mask is constructed from PanelTabBar, PanelContextButtonBar and panel content sizes.
- */
+ * @brief Calculates mask for tabbed panel
+ *
+ * Mask is constructed from PanelTabBar, PanelContextButtonBar and panel content sizes.
+ */
void calculateMask();
/**