From 21df569524ed477be98e9b45784519d8090fb4b3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sami=20R=C3=A4m=C3=B6?= Date: Mon, 6 Sep 2010 10:50:52 +0300 Subject: [PATCH] Set constant width --- src/ui/listitemcontextbuttonbar.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ui/listitemcontextbuttonbar.cpp b/src/ui/listitemcontextbuttonbar.cpp index d7b6551..45fc2e0 100644 --- a/src/ui/listitemcontextbuttonbar.cpp +++ b/src/ui/listitemcontextbuttonbar.cpp @@ -42,6 +42,11 @@ ListItemContextButtonBar::ListItemContextButtonBar(QWidget *parent) : const int BAR_HEIGHT = 78; setFixedHeight(BAR_HEIGHT); + const int BUTTON_WIDTH = 74; + const int BUTTON_COUNT = 3; + const int HORIZONTAL_MARGIN = 10; + setFixedWidth(BUTTON_COUNT * BUTTON_WIDTH + 2 * HORIZONTAL_MARGIN); + m_backgroundLeft = new QPixmap(":/res/images/list_item_context_button_bar_left.png"); m_backgroundMiddle = new QPixmap(":/res/images/list_item_context_button_bar_tile.png"); m_backgroundRight = new QPixmap(":/res/images/list_item_context_button_bar_right.png"); @@ -87,11 +92,11 @@ void ListItemContextButtonBar::changeButtons() m_newContextButtons = 0; m_contextButtons->setParent(this); m_contextButtons->show(); - setFixedWidth(m_contextButtons->width()); +// setFixedWidth(m_contextButtons->width()); // center this widget horizontally to middle of the panel contents area and set outside of // the view - const int FROM_PANEL_CONTENTS_LEFT = PANEL_WIDTH / 2 - m_contextButtons->width() / 2; + const int FROM_PANEL_CONTENTS_LEFT = PANEL_WIDTH / 2 - width() / 2; move(PANEL_TAB_BAR_WIDTH + PANEL_BAR_WIDTH + FROM_PANEL_CONTENTS_LEFT, -size().height()); // update new target values for animations -- 1.7.9.5