From 125426dbf15935a904c6e673c3bd9d7934145dc6 Mon Sep 17 00:00:00 2001 From: fourtf Date: Mon, 2 Sep 2019 18:59:37 +0200 Subject: [PATCH] added header for search --- resources/qss/settings.qss | 7 +++++++ src/autogenerated/ResourcesAutogen.cpp | 1 + src/autogenerated/ResourcesAutogen.hpp | 1 + src/widgets/dialogs/SettingsDialog.cpp | 16 +++++++++++++--- src/widgets/dialogs/SettingsDialog.hpp | 5 +++++ src/widgets/helper/SettingsDialogTab.cpp | 2 ++ 6 files changed, 29 insertions(+), 3 deletions(-) diff --git a/resources/qss/settings.qss b/resources/qss/settings.qss index ec6da9e9b..3c1c97a44 100644 --- a/resources/qss/settings.qss +++ b/resources/qss/settings.qss @@ -30,6 +30,13 @@ chatterino--SettingsPage { border: 1px solid #555; } +chatterino--PageHeader { + min-height: 54px; + min-width: 64px; + border: 1px solid #555; + border-bottom: none; +} + chatterino--TitleLabel { font-family: "Segoe UI light"; font-size: 24px; diff --git a/src/autogenerated/ResourcesAutogen.cpp b/src/autogenerated/ResourcesAutogen.cpp index 54bd1db6e..9629a8f02 100644 --- a/src/autogenerated/ResourcesAutogen.cpp +++ b/src/autogenerated/ResourcesAutogen.cpp @@ -20,6 +20,7 @@ Resources2::Resources2() this->buttons.modModeDisabled2 = QPixmap(":/buttons/modModeDisabled2.png"); this->buttons.modModeEnabled = QPixmap(":/buttons/modModeEnabled.png"); this->buttons.modModeEnabled2 = QPixmap(":/buttons/modModeEnabled2.png"); + this->buttons.search = QPixmap(":/buttons/search.png"); this->buttons.timeout = QPixmap(":/buttons/timeout.png"); this->buttons.trashCan = QPixmap(":/buttons/trashCan.png"); this->buttons.unban = QPixmap(":/buttons/unban.png"); diff --git a/src/autogenerated/ResourcesAutogen.hpp b/src/autogenerated/ResourcesAutogen.hpp index 8d137fe36..c6b3dc486 100644 --- a/src/autogenerated/ResourcesAutogen.hpp +++ b/src/autogenerated/ResourcesAutogen.hpp @@ -26,6 +26,7 @@ public: QPixmap modModeDisabled2; QPixmap modModeEnabled; QPixmap modModeEnabled2; + QPixmap search; QPixmap timeout; QPixmap trashCan; QPixmap unban; diff --git a/src/widgets/dialogs/SettingsDialog.cpp b/src/widgets/dialogs/SettingsDialog.cpp index 46fc92195..dad738b2e 100644 --- a/src/widgets/dialogs/SettingsDialog.cpp +++ b/src/widgets/dialogs/SettingsDialog.cpp @@ -1,7 +1,9 @@ #include "widgets/dialogs/SettingsDialog.hpp" #include "Application.hpp" +#include "singletons/Resources.hpp" #include "util/LayoutCreator.hpp" +#include "widgets/helper/Button.hpp" #include "widgets/helper/SettingsDialogTab.hpp" #include "widgets/settingspages/AboutPage.hpp" #include "widgets/settingspages/AccountsPage.hpp" @@ -60,11 +62,15 @@ void SettingsDialog::initUi() this->layout()->setSpacing(0); // right side layout - auto right = layoutCreator.emplace().withoutMargin(); + auto right = + layoutCreator.emplace().withoutMargin().withoutSpacing(); { - auto title = right.emplace().withoutMargin(); + auto title = right.emplace(); + auto header = LayoutCreator(title.getElement()) + .setLayoutType(); - auto edit = title.emplace().assign(&this->ui_.search); + auto edit = header.emplace().assign(&this->ui_.search); + edit->setPlaceholderText("Find in settings..."); QTimer::singleShot(100, edit.getElement(), [edit = edit.getElement()]() { edit->setFocus(); }); QObject::connect( @@ -116,6 +122,10 @@ void SettingsDialog::initUi() } }); + auto searchButton = header.emplace