<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>
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);
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);
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);
}
******************************************************************************/
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
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
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
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
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 *)
: 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(
{
qDebug() << __PRETTY_FUNCTION__;
Q_UNUSED(width);
- resize(USERPANEL_WIDTH,height + MARGIN_CORRECTION);
+ resize(USERPANEL_WIDTH + SLIDINGBAR_WIDTH,height + MARGIN_CORRECTION);
}
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