aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ui/qt/main_window.cpp14
-rw-r--r--ui/qt/main_window_slots.cpp6
2 files changed, 11 insertions, 9 deletions
diff --git a/ui/qt/main_window.cpp b/ui/qt/main_window.cpp
index a5ab9aee39..2756ab4bf4 100644
--- a/ui/qt/main_window.cpp
+++ b/ui/qt/main_window.cpp
@@ -397,17 +397,17 @@ MainWindow::MainWindow(QWidget *parent) :
// larger toolbar. We do this by adding them to a child toolbar.
// https://bugreports.qt.io/browse/QTBUG-2472
filter_expression_toolbar_ = new DragDropToolBar();
- // Try to draw separator lines from the button label ascent to its baseline.
+ // Try to draw 1-pixel-wide separator lines from the button label
+ // ascent to its baseline.
int sep_margin = (filter_expression_toolbar_->fontMetrics().height() * 0.5) - 1;
QColor sep_color = ColorUtils::alphaBlend(filter_expression_toolbar_->palette().text(),
- filter_expression_toolbar_->palette().base(), 0.5);
- sep_color.setAlphaF(0.3);
+ filter_expression_toolbar_->palette().base(), 0.3);
filter_expression_toolbar_->setStyleSheet(QString(
"QToolBar { background: none; border: none; spacing: 1px; }"
- "QToolBar::separator {"
- " width: 1px; max-width: 1px;"
- " margin-top: %1px; margin-bottom: %2px;"
- " background: %3; }"
+ "QFrame {"
+ " min-width: 1px; max-width: 1px;"
+ " margin: %1px 0 %2px 0; padding: 0;"
+ " background-color: %3;"
"}"
).arg(sep_margin).arg(sep_margin - 1).arg(sep_color.name()));
diff --git a/ui/qt/main_window_slots.cpp b/ui/qt/main_window_slots.cpp
index a41aa2dbde..f5e02c4ae7 100644
--- a/ui/qt/main_window_slots.cpp
+++ b/ui/qt/main_window_slots.cpp
@@ -1009,8 +1009,10 @@ gboolean MainWindow::filter_expression_add_action(const void *key _U_, void *val
dfb_action->setProperty(dfe_property_label_, QString(fe->label));
dfb_action->setProperty(dfe_property_expression_, QString(fe->expression));
- if (data->window->filter_expression_toolbar_->actions().count() > 0) {
- data->window->filter_expression_toolbar_->addSeparator();
+ if (data->actions_added) {
+ QFrame *sep = new QFrame();
+ sep->setEnabled(false);
+ data->window->filter_expression_toolbar_->addWidget(sep);
}
data->window->filter_expression_toolbar_->addAction(dfb_action);
connect(dfb_action, SIGNAL(triggered()), data->window, SLOT(displayFilterButtonClicked()));