Made dirty fix to enlarge the sliding bar buttons. Must be reworked
authorKaj Wallin <kaj.wallin@ixonos.com>
Tue, 18 May 2010 04:51:04 +0000 (07:51 +0300)
committerKaj Wallin <kaj.wallin@ixonos.com>
Tue, 18 May 2010 04:51:04 +0000 (07:51 +0300)
later

Reviewed by:

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/panelcommon.h
src/ui/panelsliderbar.cpp
src/ui/userpanel.cpp

index 5395087..e57ec95 100644 (file)
@@ -28,5 +28,6 @@
         <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>
     </qresource>
 </RCC>
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..a41b5e4 100644 (file)
@@ -35,6 +35,16 @@ FriendListPanel::FriendListPanel(QWidget *parent)
     m_friendsPanelVBox->setSpacing(0);
     setLayout(m_friendsPanelVBox);
 
+    QWidget *panelBase = new QWidget(this);
+    panelBase->setLayout(m_friendsPanelVBox);
+    panelBase->move(TOP_CORNER_X + SLIDINGBAR_WIDTH,PANEL_TOP_Y);
+    panelBase->resize(FRIENDPANEL_WIDTH, FRIENDPANEL_HEIGHT);
+
+    QPalette pal = palette();
+    pal.setColor(QPalette::Background, QColor(0, 0, 0, 128));
+    panelBase->setPalette(pal);
+    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,10 @@ 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_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 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 528c3d6..3e3ee7a 100644 (file)
@@ -35,8 +35,8 @@ PanelSliderBar::PanelSliderBar(QWidget *parent, Side side)
     else if(side == RIGHT) {
         setObjectName("FriendsPanelSlidingBar");
         setStyleSheet(QString(
-                "#FriendsPanelSlidingBar{background-image: url(:/res/images/sliding_bar_right.png)}"));
-        setMask(QPixmap(":/res/images/sliding_bar_right.png").mask());
+                "#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");
index 2a19ef2..c554fe7 100644 (file)
 UserInfoPanel::UserInfoPanel(QWidget *parent)
     : QWidget(parent)
 {
-    QWidget *panelBase = new QWidget(this);
     qDebug() << __PRETTY_FUNCTION__;
+
     m_userPanelVBox = new QVBoxLayout(this);
+    QWidget *panelBase = new QWidget(this);
     panelBase->setLayout(m_userPanelVBox);
-
-    panelBase->move(0,0);
+    panelBase->move(TOP_CORNER_X,PANEL_TOP_Y);
     panelBase->resize(USERPANEL_WIDTH, USERPANEL_HEIGHT);
 
-    PanelSliderBar *m_userPanelSlidingBar = new PanelSliderBar(this, LEFT);
-    m_userPanelSlidingBar->move(USERPANEL_WIDTH - SLIDINGBAR_WIDTH, PANEL_TOP_Y);
-
-    panelBase->setAutoFillBackground(true);
     QPalette pal = palette();
     pal.setColor(QPalette::Background, QColor(0, 0, 0, 128));
     panelBase->setPalette(pal);
+    panelBase->setAutoFillBackground(true);
+
+    PanelSliderBar *m_userPanelSlidingBar = new PanelSliderBar(this, LEFT);
+    m_userPanelSlidingBar->move(USERPANEL_WIDTH - SLIDINGBAR_WIDTH, PANEL_TOP_Y);
 
     setMask(QPixmap(":/res/images/userpanel_mask.png").mask());