clearTextFiltering();
- emit showPanelRequested(this);
+ emit openPanelRequested(this);
}
void FriendListPanel::topmostWindowChanged(bool mainWindowIsTopmost)
connect(m_mapView, SIGNAL(viewResized(QSize)),
m_tabbedPanel, SLOT(resizePanel(QSize)));
- connect(m_friendsListPanel, SIGNAL(showPanelRequested(QWidget*)),
- m_tabbedPanel, SLOT(showPanel(QWidget*)));
+ connect(m_friendsListPanel, SIGNAL(openPanelRequested(QWidget*)),
+ m_tabbedPanel, SLOT(openPanel(QWidget*)));
- connect(m_routingPanel, SIGNAL(showPanelRequested(QWidget*)),
- m_tabbedPanel, SLOT(showPanel(QWidget*)));
+ connect(m_routingPanel, SIGNAL(openPanelRequested(QWidget*)),
+ m_tabbedPanel, SLOT(openPanel(QWidget*)));
connect(m_tabbedPanel, SIGNAL(panelClosed()),
m_friendsListPanel, SLOT(anyPanelClosed()));
*
* @param widget Pointer to the widget that emitted the signal
*/
- void showPanelRequested(QWidget *widget);
+ void openPanelRequested(QWidget *widget);
/*******************************************************************************
* DATA MEMBERS
TabbedPanel::TabbedPanel(QWidget *parent)
: QWidget(parent),
- m_isOpen(false)
+ m_open(false)
{
qDebug() << __PRETTY_FUNCTION__;
{
qDebug() << __PRETTY_FUNCTION__;
- if (m_isOpen)
+ if (m_open)
emit toggleState();
}
return index;
}
+void TabbedPanel::openPanel(QWidget *widget)
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ m_panelTabBar->selectTab(m_panelContentStack->indexOf(widget));
+}
+
void TabbedPanel::removeTab(int index)
{
qDebug() << __PRETTY_FUNCTION__;
resize(PANEL_BAR_TABBED_WIDTH + PANEL_WIDTH,
size.height() - PANEL_TOP_PADDING - PANEL_BOTTOM_PADDING);
- if (!m_isOpen)
+ if (!m_open)
move(size.width() - PANEL_TAB_WIDTH - PANEL_BAR_WIDTH, PANEL_TOP_PADDING);
else
move(size.width() - PANEL_TAB_WIDTH - PANEL_BAR_WIDTH - PANEL_WIDTH, PANEL_TOP_PADDING);
if ((index < m_panelContentStack->count()) && (index >= 0)) {
m_panelContentStack->setCurrentIndex(index);
- if (!m_isOpen)
+ if (!m_open)
emit toggleState();
m_panelContextButtonBar->setContextButtons(
}
}
-void TabbedPanel::showPanel(QWidget *widget)
-{
- qDebug() << __PRETTY_FUNCTION__;
-
- m_panelTabBar->selectTab(m_panelContentStack->indexOf(widget));
-}
-
void TabbedPanel::stateChanged()
{
qDebug() << __PRETTY_FUNCTION__;
- if (!m_isOpen) {
- m_isOpen = true;
+ if (!m_open) {
+ m_open = true;
m_panelContextButtonBar->setVisible(true);
emit panelOpened();
} else {
- m_isOpen = false;
+ m_open = false;
m_panelContextButtonBar->setVisible(false);
emit panelClosed();
}
void closePanel();
/**
- * @brief Slot that shows the tab (and opens it if closed) with the desired widget
+ * @brief Slot that opens the panel
+ *
+ * If widget pointer is provided the corresponding tab is also set active
*
* @param widget Widget
*/
- void showPanel(QWidget *widget);
+ void openPanel(QWidget *widget = 0);
/**
* @brief Slot to redraw the panel after window resize event
void setCurrentIndex(int index);
/**
- * @brief Internal slot used to track statemachine state
+ * @brief Internal slot used to set the panel state
*/
void stateChanged();
void panelOpened();
/**
- * @brief Signal that is sent to state machine when panel state must be changed
+ * @brief Signal that is sent when the panel state must be changed
*
* @sa openPanel
* @sa closePanel
* DATA MEMBERS
******************************************************************************/
private:
- bool m_isOpen; ///< Boolean used to track the current state of the statemachine
+ bool m_open; ///< Current state of the panel
QPropertyAnimation *m_panelAnimation; ///< Animation for panel state changes