Finalised the classes for panels
authorKaj Wallin <kaj.wallin@ixonos.com>
Mon, 10 May 2010 11:54:14 +0000 (14:54 +0300)
committerKaj Wallin <kaj.wallin@ixonos.com>
Mon, 10 May 2010 11:54:14 +0000 (14:54 +0300)
Reviewed by: Jussi Laitinen

12 files changed:
situare.supp
src/src.pro
src/ui/friendlistpanel.cpp
src/ui/friendlistpanel.h
src/ui/mapviewscreen.cpp
src/ui/panelcommon.h
src/ui/panelsidebar.cpp
src/ui/panelsidebar.h
src/ui/panelsliderbar.cpp [new file with mode: 0644]
src/ui/panelsliderbar.h [new file with mode: 0644]
src/ui/userpanel.cpp
src/ui/userpanel.h

index 174a5a7..0596c64 100644 (file)
    fun:_ZN12QApplicationD1Ev
    fun:main
 }
+{
+   X11_Transwrite
+   Memcheck:Param
+   write(buf)
+   obj:/targets/FREMANTLE_X86/lib/libpthread-2.5.so
+   fun:_X11TransWrite
+   obj:/targets/FREMANTLE_X86/usr/lib/libX11.so.6.2.0
+   fun:_XReply
+   fun:XGetWindowProperty
+   fun:XGetWMHints
+   fun:_ZN14QWidgetPrivate17setWindowIcon_sysEb
+   fun:_ZN7QWidget6createEmbb
+   fun:_ZN7QWidget10setVisibleEb
+   fun:_ZN7QDialog10setVisibleEb
+   fun:_ZN7QDialog4execEv
+   fun:_ZN19QApplicationPrivate25maemo5ShowApplicationMenuEv
+}
+
index b6c6233..3dc44b8 100644 (file)
@@ -39,7 +39,8 @@ SOURCES += main.cpp \
     map/maptilerequest.cpp \
     ui/friendlistpanel.cpp \
     ui/userpanel.cpp \
-    ui/panelsidebar.cpp
+    ui/panelsidebar.cpp \
+    ui/panelsliderbar.cpp
 HEADERS += ui/mainwindow.h \
     ui/mapviewscreen.h \
     ui/listviewscreen.h \
@@ -76,7 +77,8 @@ HEADERS += ui/mainwindow.h \
     ui/friendlistpanel.h \
     ui/userpanel.h \
     ui/panelcommon.h \
-    ui/panelsidebar.h
+    ui/panelsidebar.h \
+    ui/panelsliderbar.h
 QT += network \
     webkit
 DEFINES += QT_NO_DEBUG_OUTPUT
index e087379..bae2ffa 100644 (file)
 #include "friendlistview.h"
 #include "friendlistitem.h"
 #include "panelcommon.h"
+#include "panelsliderbar.h"
 
 FriendListPanel::FriendListPanel(QWidget *parent)
     : QWidget(parent)
 {
     qDebug() << __PRETTY_FUNCTION__;
     m_friendsPanelVBox = new QVBoxLayout(this);
-    this->setLayout(m_friendsPanelVBox);
-    m_friendsPanelExpandButton = new QPushButton("Friends", this);
-    m_friendsPanelVBox->addWidget(m_friendsPanelExpandButton);
+    setLayout(m_friendsPanelVBox);
 
-    m_friendListView = new FriendListView(this);
-    QScrollArea *friendListScroll = new QScrollArea(this);
-    friendListScroll->setWidget(m_friendListView);
-    friendListScroll->setWidgetResizable(true);
-    friendListScroll->viewport()->setAutoFillBackground(false);
+//    m_friendListView = new FriendListView(this);
+//    QScrollArea *friendListScroll = new QScrollArea(this);
+//    friendListScroll->setWidget(m_friendListView);
+//    friendListScroll->setWidgetResizable(true);
+//    friendListScroll->viewport()->setAutoFillBackground(false);
+//    m_friendsPanelVBox->addWidget(friendListScroll);
 
-    this->setAutoFillBackground(true);
+    setAutoFillBackground(true);
     QPalette pal = palette();
     pal.setColor(QPalette::Background, QColor(0, 0, 0, 128));
     setPalette(pal);
 
-    m_friendsPanelVBox->addWidget(friendListScroll);
+    m_friendsPanelSlidingBar = new PanelSliderBar(this, RIGHT);
+    m_friendsPanelSlidingBar->move(TOP_CORNER_X, PANEL_TOP_Y);
 
     m_friendsPanelStateMachine = new QStateMachine(this);
     m_friendsPanelStateClosed = new QState(m_friendsPanelStateMachine);
@@ -57,62 +58,37 @@ FriendListPanel::FriendListPanel(QWidget *parent)
             FRIENDPANEL_OPENED_X, PANEL_TOP_Y));
 
     m_friendsPanelTransitionOpen = m_friendsPanelStateClosed->addTransition(
-            this, SIGNAL(clicked()), m_friendsPanelStateOpened);
+            m_friendsPanelSlidingBar, SIGNAL(clicked()), m_friendsPanelStateOpened);
     m_friendsPanelTransitionOpen->addAnimation(new QPropertyAnimation(this, "pos", this));
 
     m_friendsPanelTransitionClose = m_friendsPanelStateOpened->addTransition(
-            this, SIGNAL(clicked()), m_friendsPanelStateClosed);
+            m_friendsPanelSlidingBar, SIGNAL(clicked()), m_friendsPanelStateClosed);
     m_friendsPanelTransitionClose->addAnimation(new QPropertyAnimation(this, "pos", this));
 
     m_friendsPanelStateMachine->start();
-    this->setObjectName("FriendsPanel");
-
-    m_friendsPanelSlidingBar = new QWidget(this);
-    m_friendsPanelSlidingBar->setObjectName("FriendsPanelSlidingBar");
-    m_friendsPanelSlidingBar->setStyleSheet(QString(
-            "#FriendsPanelSlidingBar{background-image: url(:/res/images/sliding_bar_right.png)}"));
-    m_friendsPanelSlidingBar->resize(SLIDINGBAR_WIDTH, SLIDINGBAR_HEIGHT);
-    m_friendsPanelSlidingBar->move(0, PANEL_TOP_Y);
+    setObjectName("FriendsPanel");
 }
 
-void FriendListPanel::friendInfoReceived(QList<User *> &friendList)
-{
-    qDebug() << __PRETTY_FUNCTION__;
+//void FriendListPanel::friendInfoReceived(QList<User *> &friendList)
+//{
+//    qDebug() << __PRETTY_FUNCTION__;
 
-    m_friendListView->clear();
+//    m_friendListView->clear();
 
-    foreach (User *user, friendList) {
-        FriendListItem *item = new FriendListItem(m_friendListView);
-        item->setData(user);
-        m_friendListView->addWidget(item);
-    }
-}
+//    foreach (User *user, friendList) {
+//        FriendListItem *item = new FriendListItem(m_friendListView);
+//        item->setData(user);
+//        m_friendListView->addWidget(item);
+//    }
+//}
 
 void FriendListPanel::reDrawFriendsPanel(int width, int height)
 {
     qDebug() << __PRETTY_FUNCTION__;
-    this->resize(FRIENDPANEL_WIDTH,height + MARGIN_CORRECTION);
-    m_friendsPanelSlidingBar->resize(SLIDINGBAR_WIDTH, SLIDINGBAR_HEIGHT);
+    resize(FRIENDPANEL_WIDTH,height + MARGIN_CORRECTION);
     m_friendsPanelStateClosed->assignProperty(this, "pos", QPoint(
-            width-PANEL_PEEK_AMOUNT, PANEL_TOP_Y));
+            width - PANEL_PEEK_AMOUNT, PANEL_TOP_Y));
     m_friendsPanelStateOpened->assignProperty(this, "pos", QPoint(
             width - FRIENDPANEL_WIDTH + MARGIN_CORRECTION, PANEL_TOP_Y));
-    this->move(width-PANEL_PEEK_AMOUNT, PANEL_TOP_Y);
-}
-
-void FriendListPanel::mouseReleaseEvent(QMouseEvent *)
-{
-    qDebug() << __PRETTY_FUNCTION__;
-    emit clicked();
-}
-
-void FriendListPanel::paintEvent(QPaintEvent *)
-{
-    qDebug() << __PRETTY_FUNCTION__;
-
-    QStyleOption option;
-    option.init(this);
-
-    QStylePainter painter(this);
-    style()->drawPrimitive(QStyle::PE_Widget, &option, &painter, this);
+    move(width - PANEL_PEEK_AMOUNT, PANEL_TOP_Y);
 }
index b280799..c4f5502 100644 (file)
@@ -24,8 +24,9 @@
 
 #include <QtGui>
 
-class FriendListView;
-class User;
+//class FriendListView;
+//class User;
+class PanelSliderBar;
 
 /**
 * @brief Class for sliding friends list panel
@@ -45,29 +46,16 @@ public:
     */
     FriendListPanel(QWidget *parent = 0);
 
-
-/*******************************************************************************
-* BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
-******************************************************************************/
-protected:
-    /**
-    * @brief Draws stylesheet used in this class.
-    *
-    * @param * QPaintEvent unused
-    */
-    void paintEvent(QPaintEvent *);
-
-    void mouseReleaseEvent(QMouseEvent *);
 /*******************************************************************************
  * MEMBER FUNCTIONS AND SLOTS
  ******************************************************************************/
 public slots:
-    /**
-    * @brief Slot to refresh friends list
-    *
-    * @param friendList
-    */
-    void friendInfoReceived(QList<User *> &friendList);
+//    /**
+//    * @brief Slot to refresh friends list
+//    *
+//    * @param friendList
+//    */
+//    void friendInfoReceived(QList<User *> &friendList);
 
     /**
     * @brief Slot to redraw the panel after window resize event
@@ -77,20 +65,13 @@ public slots:
     */
     void reDrawFriendsPanel(int width, int height);
 
-
-
-signals:
-    void clicked();
-
 /*******************************************************************************
  * DATA MEMBERS
  ******************************************************************************/
 private:
-    FriendListView *m_friendListView; ///< Friend list view
-
+//    FriendListView *m_friendListView; ///< Friend list view
     QVBoxLayout *m_friendsPanelVBox; ///< Vertical layout inside the panel
-    QPushButton *m_friendsPanelExpandButton; ///< PushButton used to expand the panel
-    QWidget *m_friendsPanelSlidingBar; ///< Widget for sidebar tab item
+    PanelSliderBar *m_friendsPanelSlidingBar; ///< Widget for sidebar tab item
 
     QStateMachine *m_friendsPanelStateMachine; ///< State machine for sliding the panel
     QState *m_friendsPanelStateClosed; ///< State of the closed panel
index 4e9f398..08e29d0 100644 (file)
@@ -39,8 +39,8 @@ MapViewScreen::MapViewScreen(QWidget *parent)
 
     FriendListPanel *friendsListPanel = new FriendListPanel(this);
     UserInfoPanel *userPanel = new UserInfoPanel(this);
-    PanelSideBar *userPanelSidebar = new PanelSideBar(this, "left");
-    PanelSideBar *friendsListPanelSidebar = new PanelSideBar(this, "right");
+    PanelSideBar *userPanelSidebar = new PanelSideBar(this, LEFT);
+    PanelSideBar *friendsListPanelSidebar = new PanelSideBar(this, RIGHT);
 
     connect(mapView, SIGNAL(viewScrolled(QPoint)),
             mapEngine, SLOT(setLocation(QPoint)));
@@ -65,9 +65,8 @@ MapViewScreen::MapViewScreen(QWidget *parent)
     connect(mapView, SIGNAL(viewResizedNewSize(int,int)),
             friendsListPanelSidebar, SLOT(reDrawSidebar(int,int)));
 
-
-    connect(this, SIGNAL(SIG_friendsLocationsReady(QList<User*>&)),
-            friendsListPanel, SLOT(friendInfoReceived(QList<User*>&)));
+//    connect(this, SIGNAL(SIG_friendsLocationsReady(QList<User*>&)),
+//            friendsListPanel, SLOT(friendInfoReceived(QList<User*>&)));
 
 
     QHBoxLayout *mapViewLayout = new QHBoxLayout;
index 51e1d31..71fef7b 100644 (file)
@@ -25,6 +25,9 @@
 #include <QtCore>
 #include "map/mapcommon.h"
 
+
+enum Side{LEFT, RIGHT};  ///< Enumerator for panel sideness
+
 const int PANEL_PEEK_AMOUNT = 25; ///< Amount of pixels shown when panel is closed
 
 const int FRIENDPANEL_WIDTH  = 420; ///< Width of the friends list panel
@@ -37,6 +40,7 @@ const int MARGIN_CORRECTION = 1; ///< Amount of correction to make panels touch
 const int MARGIN_CORRECTION2 = 2; ///< Amount of correction to make panels touch the window borders
 
 const int PANEL_TOP_Y = 0; ///< Y coordinate for top of both panels
+const int TOP_CORNER_X = 0;  ///< X coordinate for top left corner
 
 const int FRIENDPANEL_CLOSED_X =
         DEFAULT_SCREEN_WIDTH-PANEL_PEEK_AMOUNT; ///< X location of the friend list panel when closed
@@ -44,9 +48,10 @@ const int FRIENDPANEL_OPENED_X =
         DEFAULT_SCREEN_WIDTH-FRIENDPANEL_WIDTH; ///< X location of the friend list panel when opened
 
 const int USERPANEL_CLOSED_X =
-        0 - USERPANEL_WIDTH + PANEL_PEEK_AMOUNT;  ///< X location of the user panel when closed
+        2 - USERPANEL_WIDTH + PANEL_PEEK_AMOUNT;  ///< X location of the user panel when closed
 const int USERPANEL_OPENED_X = 0;     ///< X location of the user panel when opened
 
+
 const int SIDEBAR_WIDTH = 23;
 const int SIDEBAR_HEIGHT = 424;
 
index b665db6..5635757 100644 (file)
 #include "panelsidebar.h"
 #include "panelcommon.h"
 
-PanelSideBar::PanelSideBar(QWidget *parent, QString side)
+PanelSideBar::PanelSideBar(QWidget *parent, Side side)
     : QWidget(parent)
 {
-    if(side == "left") {
-        this->setObjectName("SidePanelLeft");
-        this->setStyleSheet(QString(
+    if (side == LEFT) {
+        setObjectName("SidePanelLeft");
+        setStyleSheet(QString(
                 "#SidePanelLeft{background-image: url(:/res/images/side_bar_left.png)}"));
-        this->move(QPoint(USERPANEL_OPENED_X, PANEL_TOP_Y));
+        move(QPoint(USERPANEL_OPENED_X, PANEL_TOP_Y));
     }
-    else if(side == "right"){
-        this->setObjectName("SidePanelRight");
-        this->setStyleSheet(QString(
+    else if (side == RIGHT){
+        setObjectName("SidePanelRight");
+        setStyleSheet(QString(
                 "#SidePanelRight{background-image: url(:/res/images/side_bar_right.png)}"));
-        this->move(QPoint(DEFAULT_SCREEN_WIDTH - SIDEBAR_WIDTH + MARGIN_CORRECTION2, PANEL_TOP_Y));
+        move(QPoint(DEFAULT_SCREEN_WIDTH - SIDEBAR_WIDTH + MARGIN_CORRECTION2, PANEL_TOP_Y));
     }
     else {
         qFatal("Illegal PanelSideBar 2nd argument");
     }
-    this->resize(SIDEBAR_WIDTH, SIDEBAR_HEIGHT);
-    this->setAttribute(Qt::WA_TransparentForMouseEvents, true);
+    resize(SIDEBAR_WIDTH, SIDEBAR_HEIGHT);
+    setAttribute(Qt::WA_TransparentForMouseEvents, true);
 }
 
 void PanelSideBar::paintEvent(QPaintEvent *)
@@ -60,7 +60,7 @@ void PanelSideBar::reDrawSidebar(int width, int height)
 {
     Q_UNUSED(height);
     qDebug() << __PRETTY_FUNCTION__;
-    if(this->objectName() == "SidePanelRight") {
-        this->move(width - SIDEBAR_WIDTH + MARGIN_CORRECTION2, PANEL_TOP_Y);
+    if (objectName() == "SidePanelRight") {
+        move(width - SIDEBAR_WIDTH + MARGIN_CORRECTION2, PANEL_TOP_Y);
     }
 }
index 51671b4..c1293af 100644 (file)
 #define PANELSIDEBAR_H
 
 #include <QWidget>
+#include "panelcommon.h"
 
+/**
+* @brief Generic class for drawing sidebar anchors at the side of the screen
+*
+* @author Kaj Wallin - kaj.wallin (at) ixonos.com
+* @class PanelSideBar panelsidebar.h "ui/panelsidebar.h"
+*/
 class PanelSideBar : public QWidget
 {
     Q_OBJECT
 
+
 public:
-    PanelSideBar(QWidget *parent, QString side);
+    /**
+    * @brief Constructor
+    *
+    * @param parent Parent
+    * @param side Qstring for the sidebar location. Accepts "left" and "right"
+    */
+    PanelSideBar(QWidget *parent, Side side);
 
 /*******************************************************************************
  * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
diff --git a/src/ui/panelsliderbar.cpp b/src/ui/panelsliderbar.cpp
new file mode 100644 (file)
index 0000000..c4689ca
--- /dev/null
@@ -0,0 +1,60 @@
+ /*
+    Situare - A location system for Facebook
+    Copyright (C) 2010  Ixonos Plc. Authors:
+
+        Kaj Wallin - kaj.wallin@ixonos.com
+
+    Situare is free software; you can redistribute it and/or
+    modify it under the terms of the GNU General Public License
+    version 2 as published by the Free Software Foundation.
+
+    Situare is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with Situare; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
+    USA.
+ */
+
+#include <QtGui>
+#include "panelsliderbar.h"
+#include "panelcommon.h"
+
+PanelSliderBar::PanelSliderBar(QWidget *parent, Side side)
+    : QWidget(parent)
+{
+    if(side == LEFT) {
+        setObjectName("UserPanelSlidingBar");
+        setStyleSheet(QString(
+                "#UserPanelSlidingBar{background-image: url(:/res/images/sliding_bar_left.png)}"));
+    }
+    else if(side == RIGHT) {
+        setObjectName("FriendsPanelSlidingBar");
+        setStyleSheet(QString(
+                "#FriendsPanelSlidingBar{background-image: url(:/res/images/sliding_bar_right.png)}"));
+    }
+    else {
+        qFatal("Illegal PanelSliderBar 2nd argument");
+    }
+    resize(SLIDINGBAR_WIDTH, SLIDINGBAR_HEIGHT);
+}
+
+void PanelSliderBar::paintEvent(QPaintEvent *)
+{
+    qDebug() << __PRETTY_FUNCTION__;
+
+    QStyleOption option;
+    option.init(this);
+
+    QStylePainter painter(this);
+    style()->drawPrimitive(QStyle::PE_Widget, &option, &painter, this);
+}
+
+void PanelSliderBar::mouseReleaseEvent(QMouseEvent *)
+{
+    qDebug() << __PRETTY_FUNCTION__;
+    emit clicked();
+}
diff --git a/src/ui/panelsliderbar.h b/src/ui/panelsliderbar.h
new file mode 100644 (file)
index 0000000..3ae7699
--- /dev/null
@@ -0,0 +1,79 @@
+ /*
+    Situare - A location system for Facebook
+    Copyright (C) 2010  Ixonos Plc. Authors:
+
+        Kaj Wallin - kaj.wallin@ixonos.com
+
+    Situare is free software; you can redistribute it and/or
+    modify it under the terms of the GNU General Public License
+    version 2 as published by the Free Software Foundation.
+
+    Situare is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with Situare; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
+    USA.
+ */
+
+
+#ifndef PANELSLIDERBAR_H
+#define PANELSLIDERBAR_H
+
+#include <QWidget>
+#include "panelcommon.h"
+
+/**
+* @brief Generic class from drawing sliding bar attached to panels
+*
+* @class PanelSliderBar panelsliderbar.h "ui/panelsliderbar.h"
+*/
+class PanelSliderBar : public QWidget
+{
+    Q_OBJECT;
+
+public:
+    /**
+    * @brief Constructor
+    *
+    * @param parent Parent
+    * @param side Qstring for the sliderbar location. Accepts "left" and "right"
+    */
+    PanelSliderBar(QWidget *parent, Side side);
+
+/*******************************************************************************
+* BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
+******************************************************************************/
+protected:
+    /**
+    * @brief Draws stylesheet used in this class.
+    *
+    * @param * QPaintEvent unused
+    */
+    void paintEvent(QPaintEvent *);
+
+    /**
+    * @brief Mouse release event used to expand/collapse the panel
+    *
+    * @param * Event
+    *
+    * @sa clicked
+    */
+    void mouseReleaseEvent(QMouseEvent *);
+
+
+ /*******************************************************************************
+  * SIGNALS
+  ******************************************************************************/
+signals:
+    /**
+    * @brief Signal that is emitted the slider bar is clicked
+    *
+    * @sa mouseReleaseEvent
+    */
+    void clicked();
+};
+#endif // PANELSLIDERBAR_H
index d6b1265..647cfc9 100644 (file)
 
 #include "userpanel.h"
 #include "panelcommon.h"
+#include "panelsliderbar.h"
 
 UserInfoPanel::UserInfoPanel(QWidget *parent)
     : QWidget(parent)
 {
     qDebug() << __PRETTY_FUNCTION__;
     m_userPanelVBox = new QVBoxLayout(this);
-    this->setLayout(m_userPanelVBox);
-    m_userPanelExpandButton = new QPushButton("Personal", this);
-    m_userPanelLabel = new QLabel("User information here",this);
-    m_userPanelVBox->addWidget(m_userPanelExpandButton);
-    m_userPanelVBox->addWidget(m_userPanelLabel);
+    setLayout(m_userPanelVBox);
 
-    this->setAutoFillBackground(true);
+    setAutoFillBackground(true);
     QPalette pal = palette();
     pal.setColor(QPalette::Background, QColor(0, 0, 0, 128));
     setPalette(pal);
 
+    PanelSliderBar *m_userPanelSlidingBar = new PanelSliderBar(this, LEFT);
+    m_userPanelSlidingBar->move(USERPANEL_WIDTH - SLIDINGBAR_WIDTH, PANEL_TOP_Y);
+
     m_userPanelStateMachine = new QStateMachine(this);
     m_userPanelStateClosed = new QState(m_userPanelStateMachine);
     m_userPanelStateClosed->assignProperty(this, "pos", QPoint(
@@ -49,44 +49,20 @@ UserInfoPanel::UserInfoPanel(QWidget *parent)
             USERPANEL_OPENED_X, PANEL_TOP_Y));
 
     m_userPanelTransitionOpen = m_userPanelStateClosed->addTransition(
-            this, SIGNAL(clicked()), m_userPanelStateOpened);
+            m_userPanelSlidingBar, SIGNAL(clicked()), m_userPanelStateOpened);
     m_userPanelTransitionOpen->addAnimation(new QPropertyAnimation(this, "pos", this));
 
     m_userPanelTransitionClose = m_userPanelStateOpened->addTransition(
-            this, SIGNAL(clicked()), m_userPanelStateClosed);
+            m_userPanelSlidingBar, SIGNAL(clicked()), m_userPanelStateClosed);
     m_userPanelTransitionClose->addAnimation(new QPropertyAnimation(this, "pos", this));
 
     m_userPanelStateMachine->start();
-    this->setObjectName("UserPanel");
-
-    m_userPanelSlidingBar = new QWidget(this);
-    m_userPanelSlidingBar->setObjectName("UserPanelSlidingBar");
-    m_userPanelSlidingBar->setStyleSheet(QString(
-            "#UserPanelSlidingBar{background-image: url(:/res/images/sliding_bar_left.png)}"));
-    m_userPanelSlidingBar->resize(SIDEBAR_WIDTH + 1, SIDEBAR_HEIGHT);
-    m_userPanelSlidingBar->move(USERPANEL_WIDTH - SIDEBAR_WIDTH + 1, PANEL_TOP_Y);
+    setObjectName("UserPanel");
 }
 
 void UserInfoPanel::reDrawUserPanel(int width, int height)
 {
     qDebug() << __PRETTY_FUNCTION__;
     Q_UNUSED(width);
-    this->resize(USERPANEL_WIDTH,height + MARGIN_CORRECTION);
-}
-
-void UserInfoPanel::mouseReleaseEvent(QMouseEvent *)
-{
-    qDebug() << __PRETTY_FUNCTION__;
-    emit clicked();
-}
-
-void UserInfoPanel::paintEvent(QPaintEvent *)
-{
-    qDebug() << __PRETTY_FUNCTION__;
-
-    QStyleOption option;
-    option.init(this);
-
-    QStylePainter painter(this);
-    style()->drawPrimitive(QStyle::PE_Widget, &option, &painter, this);
+    resize(USERPANEL_WIDTH,height + MARGIN_CORRECTION);
 }
index a47bd2e..a8e42f6 100644 (file)
 
 #ifndef USERPANEL_H
 #define USERPANEL_H
+
 #include <QtGui>
 
+class PanelSliderBar;
+
 /**
 * @brief Class for sliding user information panel
 *
@@ -43,19 +46,6 @@ public:
     UserInfoPanel(QWidget *parent = 0);
 
 /*******************************************************************************
- * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
- ******************************************************************************/
-protected:
-    /**
-    * @brief Draws stylesheet used in this class.
-    *
-    * @param * QPaintEvent unused
-    */
-    void paintEvent(QPaintEvent *);
-
-    void mouseReleaseEvent(QMouseEvent *);
-
-/*******************************************************************************
  * MEMBER FUNCTIONS AND SLOTS
  ******************************************************************************/
 public slots:
@@ -67,18 +57,12 @@ public slots:
     */
     void reDrawUserPanel(int width, int height);
 
-
-signals:
-    void clicked();
-
 /*******************************************************************************
  * DATA MEMBERS
  ******************************************************************************/
 private:
     QVBoxLayout *m_userPanelVBox; ///< Vertical layout inside the panel
-    QPushButton *m_userPanelExpandButton; ///< PushButton used to expand the panel
-    QLabel *m_userPanelLabel; ///< Dummy label inside the panel
-    QWidget *m_userPanelSlidingBar; ///< Widget for sidebar tab item
+    PanelSliderBar *m_userPanelSlidingBar; ///< Widget for sidebar tab item
 
     QStateMachine *m_userPanelStateMachine; ///< State machine for sliding the panel
     QState *m_userPanelStateClosed; ///< State of the closed panel