summary refs log tree commit diff
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2018-03-22 09:16:17 +0200
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2018-03-22 09:16:17 +0200
commit64a6771dc8379ae6d14d61ced0e9bb61462f65bd (patch)
treed14d0a341999ac08df2cb592cd5cecb880c410f4
parentAdjust unread msg bubble (diff)
downloadnheko-64a6771dc8379ae6d14d61ced0e9bb61462f65bd.tar.xz
Fix text color on room switcher
fixes #245
-rw-r--r--include/QuickSwitcher.h7
-rw-r--r--resources/styles/nheko-dark.qss4
-rw-r--r--resources/styles/nheko.qss4
-rw-r--r--resources/styles/system.qss10
-rw-r--r--src/QuickSwitcher.cc12
5 files changed, 30 insertions, 7 deletions
diff --git a/include/QuickSwitcher.h b/include/QuickSwitcher.h

index 115161ab..01c5e6da 100644 --- a/include/QuickSwitcher.h +++ b/include/QuickSwitcher.h
@@ -18,9 +18,9 @@ #pragma once #include <QAbstractItemView> -#include <QFrame> #include <QKeyEvent> #include <QVBoxLayout> +#include <QWidget> #include "TextField.h" @@ -41,7 +41,7 @@ protected: bool focusNextPrevChild(bool next) override; }; -class QuickSwitcher : public QFrame +class QuickSwitcher : public QWidget { Q_OBJECT public: @@ -55,7 +55,8 @@ signals: protected: void keyPressEvent(QKeyEvent *event) override; - void showEvent(QShowEvent *event) override; + void showEvent(QShowEvent *) override { roomSearch_->setFocus(); } + void paintEvent(QPaintEvent *event) override; private: // Current highlighted selection from the completer. diff --git a/resources/styles/nheko-dark.qss b/resources/styles/nheko-dark.qss
index f84b9300..034728f3 100644 --- a/resources/styles/nheko-dark.qss +++ b/resources/styles/nheko-dark.qss
@@ -18,6 +18,10 @@ TimelineView > * { background-color: #202228; } +QuickSwitcher { + background-color: #202228; +} + RoomList, RoomList > * { background-color: #2d3139; diff --git a/resources/styles/nheko.qss b/resources/styles/nheko.qss
index e158d76d..e18704b5 100644 --- a/resources/styles/nheko.qss +++ b/resources/styles/nheko.qss
@@ -18,6 +18,10 @@ TimelineView > * { background-color: white; } +QuickSwitcher { + background-color: white; +} + RoomList, RoomList > * { background-color: white; diff --git a/resources/styles/system.qss b/resources/styles/system.qss
index 4a4faeed..60b8865a 100644 --- a/resources/styles/system.qss +++ b/resources/styles/system.qss
@@ -21,6 +21,10 @@ TimelineItem > * { background-color: palette(window); } +QuickSwitcher { + background-color: palette(window); +} + FlatButton { qproperty-foregroundColor: palette(text); } @@ -67,6 +71,12 @@ RoomInfoListItem { qproperty-timestampColor: palette(text); qproperty-highlightedTimestampColor: palette(light); + + qproperty-avatarBgColor: palette(mid); + qproperty-avatarFgColor: palette(text); + + qproperty-bubbleFgColor: palette(text); + qproperty-bubbleBgColor: palette(mid); } CommunitiesListItem { diff --git a/src/QuickSwitcher.cc b/src/QuickSwitcher.cc
index 2401f81f..e8ef1cd9 100644 --- a/src/QuickSwitcher.cc +++ b/src/QuickSwitcher.cc
@@ -16,7 +16,9 @@ */ #include <QCompleter> +#include <QPainter> #include <QStringListModel> +#include <QStyleOption> #include <QTimer> #include "QuickSwitcher.h" @@ -57,10 +59,9 @@ RoomSearchInput::hideEvent(QHideEvent *event) } QuickSwitcher::QuickSwitcher(QWidget *parent) - : QFrame(parent) + : QWidget(parent) { setMaximumWidth(450); - setStyleSheet("background-color: white"); QFont font; font.setPixelSize(20); @@ -150,9 +151,12 @@ QuickSwitcher::setRoomList(const std::map<QString, QString> &rooms) } void -QuickSwitcher::showEvent(QShowEvent *) +QuickSwitcher::paintEvent(QPaintEvent *) { - roomSearch_->setFocus(); + QStyleOption opt; + opt.init(this); + QPainter p(this); + style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); } void