#include "sidepanel.h"
#include "panelsliderbar.h"
+#include "panelsidebar.h"
SidePanel::SidePanel(QWidget *parent) :
QWidget(parent)
void SidePanel::stateChangedToClosed()
{
- qWarning() << __PRETTY_FUNCTION__;
+ qDebug() << __PRETTY_FUNCTION__;
isOpen = false;
}
void SidePanel::stateChangedToOpen()
{
- qWarning() << __PRETTY_FUNCTION__;
+ qDebug() << __PRETTY_FUNCTION__;
isOpen = true;
}
class PanelSideBar;
class PanelSliderBar;
+/**
+* @brief Base class for sliding side panels
+*
+* @author Kaj Wallin - kaj.wallin (at) ixonos.com
+* @class SidePanel sidepanel.h "ui/sidepanel.h"
+*/
class SidePanel : public QWidget
{
Q_OBJECT
public:
+ /**
+ * @brief
+
+ * @param parent
+ */
SidePanel(QWidget *parent);
+ /**
+ * @brief Enumerator for the panel type
+ * Defines values: UserPanel, FriendsPanel
+ *
+ * @sa setType
+ */
enum PanelType {UserPanel, FriendsPanel};
/******************************************************************************
* MEMBER FUNCTIONS AND SLOTS
******************************************************************************/
public slots:
+ /**
+ * @brief Public slot that will open the panel unless already open
+ */
void openPanel();
+
+ /**
+ * @brief Public slot that will close the panel unless already closed
+ */
void closePanel();
+
/**
* @brief Slot to redraw the panel after window resize event
*
*/
void screenResized(const QSize &size);
+ /**
+ * @brief Type setter for the panel. Also sets panel visible
+ *
+ * Use to set panel type as UserPanel or FriendsPanel. Panel type determines
+ * which side the panel will be rendered. UserPanel will always be rendered
+ * on the left side of the screen and FriendsPanel on the right side.
+ *
+ * @param type Type of the panel, either UserPanel or FriendsPanel
+ * @sa PanelType
+ */
void setType(SidePanel::PanelType type);
private slots:
+ /**
+ * @brief Internal slot used to track statemachine state
+ */
void stateChangedToClosed();
+ /**
+ * @brief Internal slot used to track statemachine state
+ */
void stateChangedToOpen();
/******************************************************************************
* SIGNALS
******************************************************************************/
signals:
+ /**
+ * @brief Signal that is sent to state machine when state must be changed
+ *
+ * @sa openPanel
+ * @sa closePanel
+ */
void toggleState();
/*******************************************************************************
QVBoxLayout *m_panelVBox; ///< Vertical layout inside the panel
private:
- bool isOpen;
+ bool isOpen; ///< Boolean used to tranch the current state of the statemachine
QSignalTransition *m_panelTransitionClose; ///< Transition signal for closing the panel
QSignalTransition *m_panelTransitionOpen; ///< Transition signal for opening the panel
QState *m_panelStateClosed; ///< State of the closed panel
QStateMachine *m_panelStateMachine; ///< State machine for sliding the panel
QWidget *m_panelBase; ///< Widget for panel base
- PanelType currentType;
+ PanelType currentType; ///< Holder for the type of this panel
PanelSideBar *userPanelSidebar; ///< Overlaying widget for sidebar
PanelSliderBar *m_panelSlidingBar; ///< Widget for sidebar tab item
};