Fix text color on room switcher

fixes #245
This commit is contained in:
Konstantinos Sideris 2018-03-22 09:16:17 +02:00
parent 480de2d30b
commit 64a6771dc8
5 changed files with 30 additions and 7 deletions

View File

@ -18,9 +18,9 @@
#pragma once #pragma once
#include <QAbstractItemView> #include <QAbstractItemView>
#include <QFrame>
#include <QKeyEvent> #include <QKeyEvent>
#include <QVBoxLayout> #include <QVBoxLayout>
#include <QWidget>
#include "TextField.h" #include "TextField.h"
@ -41,7 +41,7 @@ protected:
bool focusNextPrevChild(bool next) override; bool focusNextPrevChild(bool next) override;
}; };
class QuickSwitcher : public QFrame class QuickSwitcher : public QWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
@ -55,7 +55,8 @@ signals:
protected: protected:
void keyPressEvent(QKeyEvent *event) override; void keyPressEvent(QKeyEvent *event) override;
void showEvent(QShowEvent *event) override; void showEvent(QShowEvent *) override { roomSearch_->setFocus(); }
void paintEvent(QPaintEvent *event) override;
private: private:
// Current highlighted selection from the completer. // Current highlighted selection from the completer.

View File

@ -18,6 +18,10 @@ TimelineView > * {
background-color: #202228; background-color: #202228;
} }
QuickSwitcher {
background-color: #202228;
}
RoomList, RoomList,
RoomList > * { RoomList > * {
background-color: #2d3139; background-color: #2d3139;

View File

@ -18,6 +18,10 @@ TimelineView > * {
background-color: white; background-color: white;
} }
QuickSwitcher {
background-color: white;
}
RoomList, RoomList,
RoomList > * { RoomList > * {
background-color: white; background-color: white;

View File

@ -21,6 +21,10 @@ TimelineItem > * {
background-color: palette(window); background-color: palette(window);
} }
QuickSwitcher {
background-color: palette(window);
}
FlatButton { FlatButton {
qproperty-foregroundColor: palette(text); qproperty-foregroundColor: palette(text);
} }
@ -67,6 +71,12 @@ RoomInfoListItem {
qproperty-timestampColor: palette(text); qproperty-timestampColor: palette(text);
qproperty-highlightedTimestampColor: palette(light); qproperty-highlightedTimestampColor: palette(light);
qproperty-avatarBgColor: palette(mid);
qproperty-avatarFgColor: palette(text);
qproperty-bubbleFgColor: palette(text);
qproperty-bubbleBgColor: palette(mid);
} }
CommunitiesListItem { CommunitiesListItem {

View File

@ -16,7 +16,9 @@
*/ */
#include <QCompleter> #include <QCompleter>
#include <QPainter>
#include <QStringListModel> #include <QStringListModel>
#include <QStyleOption>
#include <QTimer> #include <QTimer>
#include "QuickSwitcher.h" #include "QuickSwitcher.h"
@ -57,10 +59,9 @@ RoomSearchInput::hideEvent(QHideEvent *event)
} }
QuickSwitcher::QuickSwitcher(QWidget *parent) QuickSwitcher::QuickSwitcher(QWidget *parent)
: QFrame(parent) : QWidget(parent)
{ {
setMaximumWidth(450); setMaximumWidth(450);
setStyleSheet("background-color: white");
QFont font; QFont font;
font.setPixelSize(20); font.setPixelSize(20);
@ -150,9 +151,12 @@ QuickSwitcher::setRoomList(const std::map<QString, QString> &rooms)
} }
void 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 void