///< @todo magic
m_barRect.setRect(0, 0, PANEL_BAR_WIDTH, PANEL_HEIGHT);
- this->resize(PANEL_BAR_WIDTH, PANEL_HEIGHT);
+ resize(PANEL_BAR_WIDTH, PANEL_HEIGHT);
}
void PanelBar::paintEvent(QPaintEvent *event)
///< @todo magic
m_barRect.setRect(0, 0, PANEL_BAR_WIDTH, size.height());
- this->resize(PANEL_BAR_WIDTH, size.height() - PANEL_TOP_PADDING - PANEL_BOTTOM_PADDING);
+ resize(PANEL_BAR_WIDTH, size.height() - PANEL_TOP_PADDING - PANEL_BOTTOM_PADDING);
}
#include <QStackedWidget>
/**
- * @brief Stack class for tabbed pabel widgets
+ * @brief Stack class for tabbed panel widgets
*
* @author Kaj Wallin - kaj.wallin (at) ixonos.com
* @author Pekka Nissinen - pekka.nissinen@ixonos.com
{
qDebug() << __PRETTY_FUNCTION__;
- if(m_tabSelected) {
- if(!rect().contains(event->pos()))
+ if (m_tabSelected) {
+ if (!rect().contains(event->pos()))
setDown(false);
else
setDown(true);
{
qDebug() << __PRETTY_FUNCTION__;
- if(event->button() == Qt::LeftButton) {
+ if (event->button() == Qt::LeftButton) {
setDown(true);
m_tabSelected = true;
}
qDebug() << __PRETTY_FUNCTION__;
if (event->button() == Qt::LeftButton) {
- if(this->rect().contains(event->pos())) {
+ if (rect().contains(event->pos())) {
click();
- if(isChecked())
+ if (isChecked())
setChecked(false);
else
setChecked(true);
QPainter painter(this);
- if(isChecked()) {
+ if (isChecked()) {
m_tabRect.setRect(0, 0, TAB_WIDTH_ACTIVE, TAB_HEIGHT);
painter.drawPixmap(m_tabRect, m_tabActiveImage);
} else {
painter.drawPixmap(m_tabRect, m_tabInactiveImage);
}
- if(isDown())
+ if (isDown())
icon().paint(&painter, m_tabRect, Qt::AlignCenter, QIcon::Selected);
- else if(isChecked())
+ else if (isChecked())
icon().paint(&painter, m_tabRect, Qt::AlignCenter, QIcon::Normal);
else
icon().paint(&painter, m_tabRect, Qt::AlignCenter, QIcon::Disabled);
{
qDebug() << __PRETTY_FUNCTION__;
- int verticalStartPoint = 8;
+ 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)
+ if (index > 0)
verticalStartPoint += 65 * index;
m_tabButtonGroup->button(index)->move(0, verticalStartPoint);
{
qDebug() << __PRETTY_FUNCTION__;
- if(QAbstractButton *tab = m_tabButtonGroup->button(index)) {
+ if (QAbstractButton *tab = m_tabButtonGroup->button(index)) {
m_tabButtonGroup->removeButton(tab);
delete tab;
}
{
qDebug() << __PRETTY_FUNCTION__;
- if(m_activeTab == index) {
+ if (m_activeTab == index) {
///< @todo magic
m_activeTab = -1;
emit tabCloseRequested(index);
{
qDebug() << __PRETTY_FUNCTION__;
- if(m_isOpen)
+ if (m_isOpen)
emit toggleState();
}
{
qDebug() << __PRETTY_FUNCTION__;
- if(QWidget *widget = m_panelContentStack->widget(index)) {
+ if (QWidget *widget = m_panelContentStack->widget(index)) {
m_panelContentStack->removeWidget(widget);
m_panelTabBar->removeTab(index);
}
if ((index < m_panelContentStack->count()) && (index >= 0)) {
m_panelContentStack->setCurrentIndex(index);
- if(!m_isOpen)
+ if (!m_isOpen)
emit toggleState();
emit currentChanged(index);
{
qDebug() << __PRETTY_FUNCTION__;
- if(!m_isOpen) {
+ if (!m_isOpen) {
m_isOpen = true;
emit panelOpened();
} else {