From 97e2f9c110b15b264b26ae24fc86fe1ac2db8dc3 Mon Sep 17 00:00:00 2001 From: Flavio Tordini Date: Mon, 3 Aug 2015 14:25:35 +0200 Subject: [PATCH] Style tweaks --- src/refinesearchwidget.cpp | 29 +++++------------------------ src/refinesearchwidget.h | 3 --- 2 files changed, 5 insertions(+), 27 deletions(-) diff --git a/src/refinesearchwidget.cpp b/src/refinesearchwidget.cpp index 3518d71..b66f64d 100644 --- a/src/refinesearchwidget.cpp +++ b/src/refinesearchwidget.cpp @@ -39,8 +39,7 @@ void RefineSearchWidget::setup() { if (isSetup) return; isSetup = true; - static const int spacing = 15; - setFont(FontUtils::medium()); + const int spacing = 15; QBoxLayout *layout = new QVBoxLayout(this); layout->setAlignment(Qt::AlignTop | Qt::AlignHCenter); @@ -60,7 +59,6 @@ void RefineSearchWidget::setup() { foreach (const QString &actionName, sortOptions) { QAction *action = new QAction(actionName, sortBar); action->setCheckable(true); - action->setFont(FontUtils::medium()); action->setProperty("paramValue", i); sortGroup->addAction(action); sortBar->addAction(action); @@ -81,7 +79,6 @@ void RefineSearchWidget::setup() { foreach (const QString &actionName, timeSpans) { QAction *action = new QAction(actionName, timeBar); action->setCheckable(true); - action->setFont(FontUtils::medium()); action->setProperty("paramValue", i); timeGroup->addAction(action); timeBar->addAction(action); @@ -108,7 +105,6 @@ void RefineSearchWidget::setup() { QAction *action = new QAction(actionName, timeBar); action->setStatusTip(tips.at(i)); action->setCheckable(true); - action->setFont(FontUtils::medium()); action->setProperty("paramValue", i); lengthGroup->addAction(action); lengthBar->addAction(action); @@ -131,7 +127,6 @@ void RefineSearchWidget::setup() { QAction *action = new QAction(actionName, timeBar); action->setStatusTip(tips.at(i)); action->setCheckable(true); - action->setFont(FontUtils::medium()); action->setProperty("paramValue", i); qualityGroup->addAction(action); qualityBar->addAction(action); @@ -143,10 +138,11 @@ void RefineSearchWidget::setup() { doneButton->setDefault(true); doneButton->setAutoDefault(true); doneButton->setFocusPolicy(Qt::StrongFocus); - doneButton->setFont(FontUtils::medium()); +#ifndef APP_MAC doneButton->setProperty("custom", true); doneButton->setProperty("important", true); doneButton->setProperty("big", true); +#endif connect(doneButton, SIGNAL(clicked()), SLOT(doneClicked())); layout->addWidget(doneButton, 0, Qt::AlignLeft); } @@ -172,7 +168,7 @@ void RefineSearchWidget::setupLabel(const QString &text, QBoxLayout *layout, con hLayout->addWidget(icon); QLabel *label = new QLabel(text.toUpper(), this); - label->setFont(FontUtils::mediumBold()); + label->setFont(FontUtils::small()); label->setStyleSheet("color: rgba(0, 0, 0, 128);"); hLayout->addWidget(label); @@ -185,28 +181,13 @@ QToolBar* RefineSearchWidget::setupBar(const QString ¶mName) { QToolBar* bar = new QToolBar(this); bar->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); // bar->setProperty("segmented", true); - bar->setFont(FontUtils::medium()); bar->setProperty("paramName", paramName); - connect(bar, SIGNAL(actionTriggered(QAction*)), - SLOT(actionTriggered(QAction*))); + connect(bar, SIGNAL(actionTriggered(QAction*)), SLOT(actionTriggered(QAction*))); bars.insert(paramName, bar); layout()->addWidget(bar); return bar; } -void RefineSearchWidget::paintEvent(QPaintEvent * /*event*/) { -#if defined(APP_MAC) | defined(APP_WIN) - QBrush brush; - if (window()->isActiveWindow()) { - brush = QBrush(QColor(0xdd, 0xe4, 0xeb)); - } else { - brush = palette().window(); - } - QPainter painter(this); - painter.fillRect(0, 0, width(), height(), brush); -#endif -} - void RefineSearchWidget::actionTriggered(QAction *action) { QToolBar *bar = static_cast(sender()); if (!bar) { diff --git a/src/refinesearchwidget.h b/src/refinesearchwidget.h index efed109..379fc38 100644 --- a/src/refinesearchwidget.h +++ b/src/refinesearchwidget.h @@ -43,9 +43,6 @@ signals: void paramChanged(QString name, QVariant value); void searchRefined(); void done(); - -protected: - void paintEvent(QPaintEvent *); private slots: void actionTriggered(QAction* action); -- 2.39.5