Merge branch 'master' into new_info_panels
authorKaj Wallin <kaj.wallin@ixonos.com>
Tue, 18 May 2010 05:30:52 +0000 (08:30 +0300)
committerKaj Wallin <kaj.wallin@ixonos.com>
Tue, 18 May 2010 05:30:52 +0000 (08:30 +0300)
Conflicts:
images.qrc

images.qrc
res/images/sliding_bar_left_test.png [new file with mode: 0644]
res/images/sliding_bar_right_test.png [new file with mode: 0644]
res/images/userpanel_mask.png [new file with mode: 0644]
src/ui/friendlistpanel.cpp
src/ui/friendlistpanel.h
src/ui/panelcommon.h
src/ui/panelsliderbar.cpp
src/ui/userpanel.cpp
src/ui/userpanel.h

index 70a1658..db10aff 100644 (file)
@@ -25,6 +25,9 @@
         <file>res/images/list_item_bottom.png</file>
         <file>res/images/list_item_middle.png</file>
         <file>res/images/list_item_top.png</file>
+        <file>res/images/sliding_bar_left_test.png</file>
+        <file>res/images/userpanel_mask.png</file>
+        <file>res/images/sliding_bar_right_test.png</file>
         <file>res/images/gps_pos_accurate.png</file>
         <file>res/images/gps_pos_coarse.png</file>
         <file>res/images/friend_group.png</file>
diff --git a/res/images/sliding_bar_left_test.png b/res/images/sliding_bar_left_test.png
new file mode 100644 (file)
index 0000000..a377f8d
Binary files /dev/null and b/res/images/sliding_bar_left_test.png differ
diff --git a/res/images/sliding_bar_right_test.png b/res/images/sliding_bar_right_test.png
new file mode 100644 (file)
index 0000000..a377f8d
Binary files /dev/null and b/res/images/sliding_bar_right_test.png differ
diff --git a/res/images/userpanel_mask.png b/res/images/userpanel_mask.png
new file mode 100644 (file)
index 0000000..81fa6d4
Binary files /dev/null and b/res/images/userpanel_mask.png differ
index 27e2814..8fe37e6 100644 (file)
@@ -35,6 +35,16 @@ FriendListPanel::FriendListPanel(QWidget *parent)
     m_friendsPanelVBox->setSpacing(0);
     setLayout(m_friendsPanelVBox);
 
+    m_panelBase = new QWidget(this);
+    m_panelBase->setLayout(m_friendsPanelVBox);
+    m_panelBase->move(TOP_CORNER_X + SLIDINGBAR_WIDTH,PANEL_TOP_Y);
+    m_panelBase->resize(FRIENDPANEL_WIDTH, FRIENDPANEL_HEIGHT);
+
+    QPalette pal = palette();
+    pal.setColor(QPalette::Background, QColor(0, 0, 0, 128));
+    m_panelBase->setPalette(pal);
+    m_panelBase->setAutoFillBackground(true);
+
     m_friendListView = new FriendListView(this);
     QScrollArea *friendListScroll = new QScrollArea(this);
     friendListScroll->setWidgetResizable(false);
@@ -44,11 +54,6 @@ FriendListPanel::FriendListPanel(QWidget *parent)
 
     m_friendsPanelVBox->addWidget(friendListScroll);
 
-    setAutoFillBackground(true);
-    QPalette pal = palette();
-    pal.setColor(QPalette::Background, QColor(0, 0, 0, 128));
-    setPalette(pal);
-
     m_friendsPanelSlidingBar = new PanelSliderBar(this, RIGHT);
     m_friendsPanelSlidingBar->move(TOP_CORNER_X, PANEL_TOP_Y);
 
@@ -92,10 +97,11 @@ void FriendListPanel::friendInfoReceived(QList<User *> &friendList)
 void FriendListPanel::reDrawFriendsPanel(int width, int height)
 {
     qDebug() << __PRETTY_FUNCTION__;
-    resize(FRIENDPANEL_WIDTH,height + MARGIN_CORRECTION);
+    resize(FRIENDPANEL_WIDTH + SLIDINGBAR_WIDTH,height + MARGIN_CORRECTION);
+    m_panelBase->resize(FRIENDPANEL_WIDTH, height + MARGIN_CORRECTION);
     m_friendsPanelStateClosed->assignProperty(this, "pos", QPoint(
-            width - PANEL_PEEK_AMOUNT, PANEL_TOP_Y));
+            width - PANEL_PEEK_AMOUNT - SLIDINGBAR_WIDTH + MARGIN_CORRECTION, PANEL_TOP_Y));
     m_friendsPanelStateOpened->assignProperty(this, "pos", QPoint(
-            width - FRIENDPANEL_WIDTH + MARGIN_CORRECTION, PANEL_TOP_Y));
-    move(width - PANEL_PEEK_AMOUNT, PANEL_TOP_Y);
+            width - FRIENDPANEL_WIDTH - SLIDINGBAR_WIDTH + MARGIN_CORRECTION, PANEL_TOP_Y));
+    move(width - PANEL_PEEK_AMOUNT - SLIDINGBAR_WIDTH + MARGIN_CORRECTION, PANEL_TOP_Y);
 }
index f308e07..928538d 100644 (file)
@@ -81,7 +81,6 @@ signals:
  ******************************************************************************/
 private:
     FriendListView *m_friendListView; ///< Friend list view
-    QVBoxLayout *m_friendsPanelVBox; ///< Vertical layout inside the panel
     PanelSliderBar *m_friendsPanelSlidingBar; ///< Widget for sidebar tab item
 
     QStateMachine *m_friendsPanelStateMachine; ///< State machine for sliding the panel
@@ -89,6 +88,8 @@ private:
     QState *m_friendsPanelStateOpened; ///< State of the opened panel
     QSignalTransition *m_friendsPanelTransitionClose; ///< Transition signal for closing the panel
     QSignalTransition *m_friendsPanelTransitionOpen; ///< Transition signal for opening the panel
+    QVBoxLayout *m_friendsPanelVBox; ///< Vertical layout inside the panel
+    QWidget *m_panelBase; ///< Widget for panel base
 };
 
 #endif // FRIENDLISTPANEL_H
index 17a330d..3ced6f6 100644 (file)
 
 enum Side{LEFT, RIGHT};  ///< Enumerator for panel sideness
 
+const int SIDEBAR_WIDTH = 23;
+const int SIDEBAR_HEIGHT = 424;
+
+const int SLIDINGBAR_WIDTH = 24;
+const int SLIDINGBAR_HEIGHT = 424;
+
 const int PANEL_PEEK_AMOUNT = 25; ///< Amount of pixels shown when panel is closed
 
 const int FRIENDPANEL_WIDTH  = 430; ///< Width of the friends list panel
@@ -42,21 +48,15 @@ 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
+        DEFAULT_SCREEN_WIDTH - PANEL_PEEK_AMOUNT - SLIDINGBAR_WIDTH; ///< X location of the friend list panel when closed
 const int FRIENDPANEL_OPENED_X =
-        DEFAULT_SCREEN_WIDTH-FRIENDPANEL_WIDTH; ///< X location of the friend list panel when opened
+        DEFAULT_SCREEN_WIDTH - FRIENDPANEL_WIDTH - SLIDINGBAR_WIDTH; ///< X location of the friend list panel when opened
 
 const int USERPANEL_CLOSED_X =
         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;
-
-const int SLIDINGBAR_WIDTH = 24;
-const int SLIDINGBAR_HEIGHT = 424;
-
 const int ZOOM_BUTTON_PANEL_POSITION_X = 10 + PANEL_PEEK_AMOUNT; ///< Horizontal position of zoom panel
 const int ZOOM_BUTTON_PANEL_POSITION_Y = 10; ///< Vertical position of zoom panel
 const int ZOOM_BUTTON_PANEL_BUTTON_SPACING = 4; ///< Size of a zoom button spacing
index c4689ca..4add008 100644 (file)
@@ -29,17 +29,19 @@ PanelSliderBar::PanelSliderBar(QWidget *parent, Side side)
     if(side == LEFT) {
         setObjectName("UserPanelSlidingBar");
         setStyleSheet(QString(
-                "#UserPanelSlidingBar{background-image: url(:/res/images/sliding_bar_left.png)}"));
+                "#UserPanelSlidingBar{background-image: url(:/res/images/sliding_bar_left_test.png)}"));
+        setMask(QPixmap(":/res/images/sliding_bar_left_test.png").mask());
     }
     else if(side == RIGHT) {
         setObjectName("FriendsPanelSlidingBar");
         setStyleSheet(QString(
-                "#FriendsPanelSlidingBar{background-image: url(:/res/images/sliding_bar_right.png)}"));
+                "#FriendsPanelSlidingBar{background-image: url(:/res/images/sliding_bar_right_test.png)}"));
+        setMask(QPixmap(":/res/images/sliding_bar_right_test.png").mask());
     }
     else {
         qFatal("Illegal PanelSliderBar 2nd argument");
     }
-    resize(SLIDINGBAR_WIDTH, SLIDINGBAR_HEIGHT);
+    resize(SLIDINGBAR_WIDTH*2, SLIDINGBAR_HEIGHT);
 }
 
 void PanelSliderBar::paintEvent(QPaintEvent *)
index 647cfc9..1d918c5 100644 (file)
@@ -27,17 +27,24 @@ UserInfoPanel::UserInfoPanel(QWidget *parent)
     : QWidget(parent)
 {
     qDebug() << __PRETTY_FUNCTION__;
+
     m_userPanelVBox = new QVBoxLayout(this);
-    setLayout(m_userPanelVBox);
+    m_panelBase = new QWidget(this);
+    m_panelBase->setLayout(m_userPanelVBox);
+    m_panelBase->move(TOP_CORNER_X,PANEL_TOP_Y);
+    m_panelBase->resize(USERPANEL_WIDTH, USERPANEL_HEIGHT);
 
-    setAutoFillBackground(true);
     QPalette pal = palette();
     pal.setColor(QPalette::Background, QColor(0, 0, 0, 128));
-    setPalette(pal);
+    m_panelBase->setPalette(pal);
+    m_panelBase->setAutoFillBackground(true);
 
     PanelSliderBar *m_userPanelSlidingBar = new PanelSliderBar(this, LEFT);
     m_userPanelSlidingBar->move(USERPANEL_WIDTH - SLIDINGBAR_WIDTH, PANEL_TOP_Y);
 
+    // set mask to allow clicking zoom button at their default position
+    setMask(QPixmap(":/res/images/userpanel_mask.png").mask());
+
     m_userPanelStateMachine = new QStateMachine(this);
     m_userPanelStateClosed = new QState(m_userPanelStateMachine);
     m_userPanelStateClosed->assignProperty(this, "pos", QPoint(
@@ -64,5 +71,5 @@ void UserInfoPanel::reDrawUserPanel(int width, int height)
 {
     qDebug() << __PRETTY_FUNCTION__;
     Q_UNUSED(width);
-    resize(USERPANEL_WIDTH,height + MARGIN_CORRECTION);
+    resize(USERPANEL_WIDTH + SLIDINGBAR_WIDTH,height + MARGIN_CORRECTION);
 }
index a8e42f6..5a01e89 100644 (file)
@@ -63,6 +63,7 @@ public slots:
 private:
     QVBoxLayout *m_userPanelVBox; ///< Vertical layout inside the panel
     PanelSliderBar *m_userPanelSlidingBar; ///< Widget for sidebar tab item
+    QWidget *m_panelBase; ///< Widget for panel base
 
     QStateMachine *m_userPanelStateMachine; ///< State machine for sliding the panel
     QState *m_userPanelStateClosed; ///< State of the closed panel