aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/display_filter_edit.cpp
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2012-12-07 21:22:16 +0000
committerGerald Combs <gerald@wireshark.org>2012-12-07 21:22:16 +0000
commit8ed89c12c5a9f447dc3411b1b1341e83c6730d66 (patch)
tree72ecf007cab8fe5d9bbd72b37e7731b7fb6ad6e9 /ui/qt/display_filter_edit.cpp
parentbc6881157da58b173fcb1688215e04a12ff452ee (diff)
Properly resize the bookmark button so that the image centers properly.
Adjust CSS. svn path=/trunk/; revision=46451
Diffstat (limited to 'ui/qt/display_filter_edit.cpp')
-rw-r--r--ui/qt/display_filter_edit.cpp35
1 files changed, 15 insertions, 20 deletions
diff --git a/ui/qt/display_filter_edit.cpp b/ui/qt/display_filter_edit.cpp
index 916d035292..0bec245c1e 100644
--- a/ui/qt/display_filter_edit.cpp
+++ b/ui/qt/display_filter_edit.cpp
@@ -116,26 +116,20 @@ DisplayFilterEdit::DisplayFilterEdit(QWidget *parent, bool plain) :
bookmark_button_->setStyleSheet(QString(
"QToolButton { /* all types of tool button */"
" border 0 0 0 0;"
- " border-right: %1px solid gray;"
+ " border-right: %1px solid palette(shadow);"
" border-top-left-radius: 3px;"
" border-bottom-left-radius: 3px;"
" padding-left: 1px;"
- " background: palette(base) url(:/dfilter/dfilter_bookmark_normal.png) no-repeat center;"
-// " background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,"
-// " stop: 0 #f6f7fa, stop: 1 #dadbde);"
+ " image: url(:/dfilter/dfilter_bookmark_normal.png) center;"
"}"
"QToolButton:hover {"
- " background: palette(base) url(:/dfilter/dfilter_bookmark_hover.png) no-repeat center;"
+ " image: url(:/dfilter/dfilter_bookmark_hover.png) center;"
"}"
"QToolButton:pressed {"
- " background: palette(base) url(:/dfilter/dfilter_bookmark_pressed.png) no-repeat center;"
+ " image: url(:/dfilter/dfilter_bookmark_pressed.png) center;"
"}"
-// "QToolButton:pressed {"
-// " background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,"
-// " stop: 0 #dadbde, stop: 1 #f6f7fa);"
-// "}"
).arg(plain_ ? 0 : 1)
);
@@ -145,15 +139,15 @@ DisplayFilterEdit::DisplayFilterEdit(QWidget *parent, bool plain) :
clear_button_->setCursor(Qt::ArrowCursor);
clear_button_->setStyleSheet(
"QToolButton {"
- " background: palette(base) url(:/dfilter/dfilter_erase_normal.png) no-repeat center;"
+ " image: url(:/dfilter/dfilter_erase_normal.png) center;"
" border: none;"
" width: 16px;"
"}"
"QToolButton:hover {"
- " background: palette(base) url(:/dfilter/dfilter_erase_active.png) no-repeat center;"
+ " image: url(:/dfilter/dfilter_erase_active.png) center;"
"}"
"QToolButton:pressed {"
- " background: palette(base) url(:/dfilter/dfilter_erase_selected.png) no-repeat center;"
+ " image: url(:/dfilter/dfilter_erase_selected.png) center;"
"}"
);
clear_button_->hide();
@@ -170,14 +164,14 @@ DisplayFilterEdit::DisplayFilterEdit(QWidget *parent, bool plain) :
" border-top-right-radius: 3px;"
" border-bottom-right-radius: 3px;"
" padding-right: 1px;"
- " background: palette(base) url(:/dfilter/dfilter_apply_normal.png) no-repeat center;"
+ " image: url(:/dfilter/dfilter_apply_normal.png) center;"
"}"
"QToolButton:hover {"
- " background: palette(base) url(:/dfilter/dfilter_apply_hover.png) no-repeat center;"
+ " image: url(:/dfilter/dfilter_apply_hover.png) center;"
"}"
"QToolButton:pressed {"
- " background: palette(base) url(:/dfilter/dfilter_apply_pressed.png) no-repeat center;"
+ " image: url(:/dfilter/dfilter_apply_pressed.png) center;"
"}"
);
connect(apply_button_, SIGNAL(clicked()), this, SLOT(applyDisplayFilter()));
@@ -242,12 +236,13 @@ void DisplayFilterEdit::resizeEvent(QResizeEvent *)
apsz.setHeight(0); apsz.setWidth(0);
}
int frameWidth = style()->pixelMetric(QStyle::PM_DefaultFrameWidth);
- clear_button_->move(rect().right() - frameWidth - cbsz.width() - apsz.width(),
- (rect().bottom() + 1 - cbsz.height())/2);
+ clear_button_->move(contentsRect().right() - frameWidth - cbsz.width() - apsz.width(),
+ (contentsRect().bottom() + 1 - cbsz.height())/2);
if (apply_button_) {
- apply_button_->move(rect().right() - frameWidth - apsz.width(),
- (rect().bottom() + 1 - apsz.height())/2);
+ apply_button_->move(contentsRect().right() - frameWidth - apsz.width(),
+ (contentsRect().bottom() + 1 - apsz.height())/2);
}
+ bookmark_button_->setMaximumHeight(contentsRect().height());
}
void DisplayFilterEdit::checkFilter(const QString& text)