diff options
author | Konstantinos Sideris <sideris.konstantin@gmail.com> | 2017-11-22 19:09:19 +0200 |
---|---|---|
committer | Konstantinos Sideris <sideris.konstantin@gmail.com> | 2017-11-22 19:09:19 +0200 |
commit | 929b2df6fb28a1e431027afb032f5eeefd0106b7 (patch) | |
tree | 1382bcf577b1ea9ef7e1fb7b812a4f28f30bb9bf | |
parent | 937caddacd628e823ab077507611a60bf823c894 (diff) | |
parent | 19b526d4533841ca91209929f0d6aef6042a8eeb (diff) |
Merge branch 'theme'
-rw-r--r-- | include/RoomInfoListItem.h | 55 | ||||
-rw-r--r-- | include/TextInputWidget.h | 5 | ||||
-rw-r--r-- | include/TimelineItem.h | 6 | ||||
-rw-r--r-- | include/TimelineView.h | 9 | ||||
-rw-r--r-- | include/TopRoomBar.h | 2 | ||||
-rw-r--r-- | include/UserInfoWidget.h | 1 | ||||
-rw-r--r-- | include/ui/LoadingIndicator.h | 1 | ||||
-rw-r--r-- | include/ui/OverlayWidget.h | 3 | ||||
-rw-r--r-- | resources/res.qrc | 7 | ||||
-rw-r--r-- | resources/styles/nheko.qss | 56 | ||||
-rw-r--r-- | resources/styles/system.qss | 39 | ||||
-rw-r--r-- | src/ChatPage.cc | 7 | ||||
-rw-r--r-- | src/EmojiPanel.cc | 17 | ||||
-rw-r--r-- | src/LoginPage.cc | 28 | ||||
-rw-r--r-- | src/LogoutDialog.cc | 4 | ||||
-rw-r--r-- | src/MainWindow.cc | 3 | ||||
-rw-r--r-- | src/RegisterPage.cc | 32 | ||||
-rw-r--r-- | src/RoomInfoListItem.cc | 30 | ||||
-rw-r--r-- | src/RoomList.cc | 4 | ||||
-rw-r--r-- | src/TextInputWidget.cc | 13 | ||||
-rw-r--r-- | src/TimelineItem.cc | 25 | ||||
-rw-r--r-- | src/TimelineView.cc | 11 | ||||
-rw-r--r-- | src/TopRoomBar.cc | 2 | ||||
-rw-r--r-- | src/UserInfoWidget.cc | 22 | ||||
-rw-r--r-- | src/UserSettingsPage.cc | 9 | ||||
-rw-r--r-- | src/main.cc | 16 | ||||
-rw-r--r-- | src/ui/Badge.cc | 1 | ||||
-rw-r--r-- | src/ui/OverlayWidget.cc | 11 | ||||
-rw-r--r-- | src/ui/TextField.cc | 2 |
29 files changed, 326 insertions, 95 deletions
diff --git a/include/RoomInfoListItem.h b/include/RoomInfoListItem.h index a137b37f..acb1ab84 100644 --- a/include/RoomInfoListItem.h +++ b/include/RoomInfoListItem.h @@ -38,6 +38,19 @@ struct DescInfo class RoomInfoListItem : public QWidget { Q_OBJECT + Q_PROPERTY(QColor highlightedBackgroundColor READ highlightedBackgroundColor WRITE + setHighlightedBackgroundColor) + Q_PROPERTY( + QColor hoverBackgroundColor READ hoverBackgroundColor WRITE setHoverBackgroundColor) + Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor) + + Q_PROPERTY(QColor titleColor READ titleColor WRITE setTitleColor) + Q_PROPERTY(QColor subtitleColor READ subtitleColor WRITE setSubtitleColor) + + Q_PROPERTY( + QColor highlightedTitleColor READ highlightedTitleColor WRITE setHighlightedTitleColor) + Q_PROPERTY(QColor highlightedSubtitleColor READ highlightedSubtitleColor WRITE + setHighlightedSubtitleColor) public: RoomInfoListItem(QSharedPointer<RoomSettings> settings, @@ -51,13 +64,39 @@ public: void clearUnreadMessageCount(); void setState(const RoomState &state); - bool isPressed() const { return isPressed_; }; - RoomState state() const { return state_; }; - int unreadMessageCount() const { return unreadMsgCount_; }; + bool isPressed() const { return isPressed_; } + RoomState state() const { return state_; } + int unreadMessageCount() const { return unreadMsgCount_; } void setAvatar(const QImage &avatar_image); void setDescriptionMessage(const DescInfo &info); + inline QColor highlightedBackgroundColor() const { return highlightedBackgroundColor_; } + inline QColor hoverBackgroundColor() const { return hoverBackgroundColor_; } + inline QColor backgroundColor() const { return backgroundColor_; } + + inline QColor highlightedTitleColor() const { return highlightedTitleColor_; } + inline QColor highlightedSubtitleColor() const { return highlightedSubtitleColor_; } + + inline QColor titleColor() const { return titleColor_; } + inline QColor subtitleColor() const { return subtitleColor_; } + + inline void setHighlightedBackgroundColor(QColor &color) + { + highlightedBackgroundColor_ = color; + } + inline void setHoverBackgroundColor(QColor &color) { hoverBackgroundColor_ = color; } + inline void setBackgroundColor(QColor &color) { backgroundColor_ = color; } + + inline void setHighlightedTitleColor(QColor &color) { highlightedTitleColor_ = color; } + inline void setHighlightedSubtitleColor(QColor &color) + { + highlightedSubtitleColor_ = color; + } + + inline void setTitleColor(QColor &color) { titleColor_ = color; } + inline void setSubtitleColor(QColor &color) { subtitleColor_ = color; } + signals: void clicked(const QString &room_id); void leaveRoom(const QString &room_id); @@ -98,4 +137,14 @@ private: int maxHeight_; int unreadMsgCount_ = 0; + + QColor highlightedBackgroundColor_; + QColor hoverBackgroundColor_; + QColor backgroundColor_; + + QColor highlightedTitleColor_; + QColor highlightedSubtitleColor_; + + QColor titleColor_; + QColor subtitleColor_; }; diff --git a/include/TextInputWidget.h b/include/TextInputWidget.h index 70b1c213..88706e4a 100644 --- a/include/TextInputWidget.h +++ b/include/TextInputWidget.h @@ -76,7 +76,7 @@ public: public slots: void openFileSelection(); void hideUploadSpinner(); - void focusLineEdit() { input_->setFocus(); }; + void focusLineEdit() { input_->setFocus(); } private slots: void addSelectedEmoji(const QString &emoji); @@ -91,7 +91,8 @@ signals: void stoppedTyping(); protected: - void focusInEvent(QFocusEvent *event); + void focusInEvent(QFocusEvent *event) override; + void paintEvent(QPaintEvent *) override; private: void showUploadSpinner(); diff --git a/include/TimelineItem.h b/include/TimelineItem.h index 1adf574c..d90810d5 100644 --- a/include/TimelineItem.h +++ b/include/TimelineItem.h @@ -19,6 +19,9 @@ #include <QHBoxLayout> #include <QLabel> +#include <QPainter> +#include <QStyle> +#include <QStyleOption> #include "Emote.h" #include "Image.h" @@ -67,6 +70,9 @@ public: ~TimelineItem(); +protected: + void paintEvent(QPaintEvent *event) override; + private: void init(); diff --git a/include/TimelineView.h b/include/TimelineView.h index bc7c41e6..78c31e8e 100644 --- a/include/TimelineView.h +++ b/include/TimelineView.h @@ -21,6 +21,8 @@ #include <QList> #include <QQueue> #include <QScrollArea> +#include <QStyle> +#include <QStyleOption> #include "Emote.h" #include "Image.h" @@ -110,7 +112,7 @@ public slots: void addBackwardsEvents(const QString &room_id, const RoomMessages &msgs); // Whether or not the initial batch has been loaded. - bool hasLoaded() { return scroll_layout_->count() > 1 || isTimelineFinished; }; + bool hasLoaded() { return scroll_layout_->count() > 1 || isTimelineFinished; } void handleFailedMessage(int txnid); @@ -120,6 +122,9 @@ private slots: signals: void updateLastTimelineMessage(const QString &user, const DescInfo &info); +protected: + void paintEvent(QPaintEvent *event) override; + private: void init(); void addTimelineItem(TimelineItem *item, TimelineDirection direction); @@ -133,7 +138,7 @@ private: bool isPendingMessage(const QString &txnid, const QString &sender, const QString &userid); void removePendingMessage(const QString &txnid); - bool isDuplicate(const QString &event_id) { return eventIds_.contains(event_id); }; + bool isDuplicate(const QString &event_id) { return eventIds_.contains(event_id); } void handleNewUserMessage(PendingMessage msg); diff --git a/include/TopRoomBar.h b/include/TopRoomBar.h index f1e93d9d..2f65428d 100644 --- a/include/TopRoomBar.h +++ b/include/TopRoomBar.h @@ -34,7 +34,7 @@ class Menu; class OverlayModal; class RoomSettings; -static const QString URL_HTML = "<a href=\"\\1\" style=\"color: #333333\">\\1</a>"; +static const QString URL_HTML = "<a href=\"\\1\">\\1</a>"; static const QRegExp URL_REGEX("((?:https?|ftp)://\\S+)"); class TopRoomBar : public QWidget diff --git a/include/UserInfoWidget.h b/include/UserInfoWidget.h index 111f5808..2acfedb8 100644 --- a/include/UserInfoWidget.h +++ b/include/UserInfoWidget.h @@ -44,6 +44,7 @@ signals: protected: void resizeEvent(QResizeEvent *event) override; + void paintEvent(QPaintEvent *event) override; private slots: void closeLogoutDialog(bool isLoggingOut); diff --git a/include/ui/LoadingIndicator.h b/include/ui/LoadingIndicator.h index 75920dd8..bb33fe6c 100644 --- a/include/ui/LoadingIndicator.h +++ b/include/ui/LoadingIndicator.h @@ -9,6 +9,7 @@ class LoadingIndicator : public QWidget { Q_OBJECT + Q_PROPERTY(QColor color READ color WRITE setColor) public: LoadingIndicator(QWidget *parent = 0); diff --git a/include/ui/OverlayWidget.h b/include/ui/OverlayWidget.h index 2984e469..6662479d 100644 --- a/include/ui/OverlayWidget.h +++ b/include/ui/OverlayWidget.h @@ -1,6 +1,8 @@ #pragma once #include <QEvent> +#include <QPainter> +#include <QStyleOption> #include <QWidget> class OverlayWidget : public QWidget @@ -15,4 +17,5 @@ protected: bool eventFilter(QObject *obj, QEvent *event) override; QRect overlayGeometry() const; + void paintEvent(QPaintEvent *event) override; }; diff --git a/resources/res.qrc b/resources/res.qrc index 55962275..9bd977a2 100644 --- a/resources/res.qrc +++ b/resources/res.qrc @@ -42,7 +42,6 @@ <file>icons/emoji-categories/flags.png</file> <file>icons/emoji-categories/flags@2x.png</file> </qresource> - <qresource prefix="/logos"> <file>nheko.png</file> @@ -62,13 +61,15 @@ <file>nheko-32.png</file> <file>nheko-16.png</file> </qresource> - <qresource prefix="/fonts"> <file>fonts/OpenSans/OpenSans-Regular.ttf</file> <file>fonts/OpenSans/OpenSans-Italic.ttf</file> <file>fonts/OpenSans/OpenSans-Bold.ttf</file> <file>fonts/OpenSans/OpenSans-Semibold.ttf</file> - <file>fonts/EmojiOne/emojione-android.ttf</file> </qresource> + <qresource prefix="/styles"> + <file>styles/system.qss</file> + <file>styles/nheko.qss</file> + </qresource> </RCC> diff --git a/resources/styles/nheko.qss b/resources/styles/nheko.qss new file mode 100644 index 00000000..caaac6b9 --- /dev/null +++ b/resources/styles/nheko.qss @@ -0,0 +1,56 @@ +* { + color: #333; +} + +QLabel { + color: #333; +} + +#chatPage, #chatPage > * { background-color: white; } + +TimelineView, TimelineView > * { background-color: white; } + +QMenu, QMenu > * { background-color: white; } + +FlatButton { qproperty-foregroundColor: #333; } + +RaisedButton { qproperty-foregroundColor: white; } + +RoomInfoListItem +{ + qproperty-highlightedBackgroundColor: #38A3D8; + qproperty-hoverBackgroundColor: rgba(200, 200, 200, 128); + qproperty-backgroundColor: white; + + qproperty-titleColor: #333; + qproperty-subtitleColor: #5d6565; + + qproperty-highlightedTitleColor: white; + qproperty-highlightedSubtitleColor: white; +} + +#ChatPageLoadSpinner { + qproperty-color: #acc7dc; +} + +#FileUploadSpinner { + qproperty-color: #333; +} + +UserInfoWidget, UserInfoWidget > * { + background-color: #d6dde3; + color: #ebebeb; +} + +Avatar { + qproperty-textColor: black; + qproperty-backgroundColor: #eee; +} + +#displayNameLabel { + color: #171919; +} + +#userIdLabel { + color: #555459; +} diff --git a/resources/styles/system.qss b/resources/styles/system.qss new file mode 100644 index 00000000..2f15271f --- /dev/null +++ b/resources/styles/system.qss @@ -0,0 +1,39 @@ +OverlayWidget, OverlayWidget > * { + background-color: palette(window); +} + +#mainContent, #mainContent > * { + background-color: palette(base); +} + +TimelineView, TimelineView > *, TimelineItem, TimelineItem > * { + background-color: palette(base); +} + +FlatButton { + qproperty-foregroundColor: palette(text); +} + +RoomInfoListItem { + qproperty-highlightedBackgroundColor: palette(highlight); + qproperty-hoverBackgroundColor: palette(dark); + qproperty-backgroundColor: palette(window); + + qproperty-titleColor: palette(text); + qproperty-subtitleColor: palette(text); + + qproperty-highlightedTitleColor: palette(text); + qproperty-highlightedSubtitleColor: palette(text); +} + +LoadingIndicator { + qproperty-color: palette(text); +} + +#ChatPageLoadSpinner { + qproperty-color: #acc7dc; +} + +UserInfoWidget, UserInfoWidget > * { + background-color: palette(window); +} diff --git a/src/ChatPage.cc b/src/ChatPage.cc index 8dd509be..acc60c03 100644 --- a/src/ChatPage.cc +++ b/src/ChatPage.cc @@ -49,7 +49,7 @@ ChatPage::ChatPage(QSharedPointer<MatrixClient> client, QWidget *parent) : QWidget(parent) , client_(client) { - setStyleSheet("background-color: #fff;"); + setObjectName("chatPage"); topLayout_ = new QHBoxLayout(this); topLayout_->setSpacing(0); @@ -79,7 +79,8 @@ ChatPage::ChatPage(QSharedPointer<MatrixClient> client, QWidget *parent) sideBarLayout_->addWidget(sidebarActions_); // Content - content_ = new QFrame(this); + content_ = new QFrame(this); + content_->setObjectName("mainContent"); contentLayout_ = new QVBoxLayout(content_); contentLayout_->setSpacing(0); contentLayout_->setMargin(0); @@ -544,7 +545,7 @@ ChatPage::showQuickSwitcher() new OverlayModal(MainWindow::instance(), quickSwitcher_.data()), [=](OverlayModal *modal) { modal->deleteLater(); }); quickSwitcherModal_->setDuration(0); - quickSwitcherModal_->setColor(QColor(30, 30, 30, 170)); + // quickSwitcherModal_->setColor(QColor(30, 30, 30, 170)); } QMap<QString, QString> rooms; diff --git a/src/EmojiPanel.cc b/src/EmojiPanel.cc index 3f5f8369..82eb8afc 100644 --- a/src/EmojiPanel.cc +++ b/src/EmojiPanel.cc @@ -32,11 +32,9 @@ EmojiPanel::EmojiPanel(QWidget *parent) , animationDuration_{100} , categoryIconSize_{20} { - setStyleSheet("QWidget {background: #fff; color: #e8e8e8; border: none;}" - "QScrollBar:vertical { background-color: #fff; width: 8px; margin: 0px " - "2px 0 2px; }" - "QScrollBar::handle:vertical { background-color: #d6dde3; min-height: " - "20px; }" + setStyleSheet("QWidget {border: none;}" + "QScrollBar:vertical { width: 8px; margin: 0px 2px 0 2px; }" + "QScrollBar::handle:vertical { min-height: 20px; }" "QScrollBar::add-line:vertical { border: none; background: none; }" "QScrollBar::sub-line:vertical { border: none; background: none; }"); @@ -55,7 +53,7 @@ EmojiPanel::EmojiPanel(QWidget *parent) contentLayout->setMargin(0); auto emojiCategories = new QFrame(mainWidget); - emojiCategories->setStyleSheet("background-color: #f2f2f2"); + // emojiCategories->setStyleSheet("background-color: #f2f2f2"); auto categoriesLayout = new QHBoxLayout(emojiCategories); categoriesLayout->setSpacing(6); @@ -250,6 +248,10 @@ EmojiPanel::leaveEvent(QEvent *event) void EmojiPanel::paintEvent(QPaintEvent *event) { + Q_UNUSED(event); + + QStyleOption opt; + opt.init(this); QPainter p(this); DropShadow::draw(p, shadowMargin_, @@ -262,7 +264,8 @@ EmojiPanel::paintEvent(QPaintEvent *event) width(), height()); - QWidget::paintEvent(event); + style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); + // QWidget::paintEvent(event); } void diff --git a/src/LoginPage.cc b/src/LoginPage.cc index 0b65f8bc..5c766b78 100644 --- a/src/LoginPage.cc +++ b/src/LoginPage.cc @@ -30,7 +30,7 @@ LoginPage::LoginPage(QSharedPointer<MatrixClient> client, QWidget *parent) , inferredServerAddress_() , client_{client} { - setStyleSheet("background-color: #fff"); + // setStyleSheet("background-color: #fff"); top_layout_ = new QVBoxLayout(); @@ -40,7 +40,7 @@ LoginPage::LoginPage(QSharedPointer<MatrixClient> client, QWidget *parent) back_button_ = new FlatButton(this); back_button_->setMinimumSize(QSize(30, 30)); - back_button_->setForegroundColor("#333333"); + // back_button_->setForegroundColor("#333333"); top_bar_layout_->addWidget(back_button_, 0, Qt::AlignLeft | Qt::AlignVCenter); top_bar_layout_->addStretch(1); @@ -75,10 +75,10 @@ LoginPage::LoginPage(QSharedPointer<MatrixClient> client, QWidget *parent) form_wrapper_->addStretch(1); matrixid_input_ = new TextField(this); - matrixid_input_->setTextColor("#333333"); + // matrixid_input_->setTextColor("#333333"); matrixid_input_->setLabel(tr("Matrix ID")); - matrixid_input_->setInkColor("#555459"); - matrixid_input_->setBackgroundColor("#fff"); + // matrixid_input_->setInkColor("#555459"); + // matrixid_input_->setBackgroundColor("#fff"); matrixid_input_->setPlaceholderText(tr("e.g @joe:matrix.org")); spinner_ = new LoadingIndicator(this); @@ -95,17 +95,17 @@ LoginPage::LoginPage(QSharedPointer<MatrixClient> client, QWidget *parent) matrixidLayout_->addWidget(matrixid_input_, 0, Qt::AlignVCenter); password_input_ = new TextField(this); - password_input_->setTextColor("#333333"); + // password_input_->setTextColor("#333333"); password_input_->setLabel(tr("Password")); - password_input_->setInkColor("#555459"); - password_input_->setBackgroundColor("#fff"); + // password_input_->setInkColor("#555459"); + // password_input_->setBackgroundColor("#fff"); password_input_->setEchoMode(QLineEdit::Password); serverInput_ = new TextField(this); - serverInput_->setTextColor("#333333"); + // serverInput_->setTextColor("#333333"); serverInput_->setLabel("Homeserver address"); - serverInput_->setInkColor("#555459"); - serverInput_->setBackgroundColor("#fff"); + // serverInput_->setInkColor("#555459"); + // serverInput_->setBackgroundColor("#fff"); serverInput_->setPlaceholderText("matrix.org"); serverInput_->hide(); @@ -121,8 +121,8 @@ LoginPage::LoginPage(QSharedPointer<MatrixClient> client, QWidget *parent) button_layout_->setContentsMargins(0, 0, 0, 30); login_button_ = new RaisedButton(tr("LOGIN"), this); - login_button_->setBackgroundColor(QColor("#333333")); - login_button_->setForegroundColor(QColor("white")); + // login_button_->setBackgroundColor(QColor("#333333")); + // login_button_->setForegroundColor(QColor("white")); login_button_->setMinimumSize(350, 65); login_button_->setFontSize(20); login_button_->setCornerRadius(3); @@ -136,7 +136,7 @@ LoginPage::LoginPage(QSharedPointer<MatrixClient> client, QWidget *parent) error_label_ = new QLabel(this); error_label_->setFont(font); - error_label_->setStyleSheet("color: #E22826"); + // error_label_->setStyleSheet("color: #E22826"); top_layout_->addLayout(top_bar_layout_); top_layout_->addStretch(1); diff --git a/src/LogoutDialog.cc b/src/LogoutDialog.cc index 7f2cdbd3..c0db1270 100644 --- a/src/LogoutDialog.cc +++ b/src/LogoutDialog.cc @@ -27,7 +27,7 @@ LogoutDialog::LogoutDialog(QWidget *parent) : QFrame(parent) { setMaximumSize(400, 400); - setStyleSheet("background-color: #fff"); + // setStyleSheet("background-color: #fff"); auto layout = new QVBoxLayout(this); layout->setSpacing(30); @@ -52,7 +52,7 @@ LogoutDialog::LogoutDialog(QWidget *parent) auto label = new QLabel(tr("Logout. Are you sure?"), this); label->setFont(font); - label->setStyleSheet("color: #333333"); + // label->setStyleSheet("color: #333333"); layout->addWidget(label); layout->addLayout(buttonLayout); diff --git a/src/MainWindow.cc b/src/MainWindow.cc index c5735b68..04b0e8e3 100644 --- a/src/MainWindow.cc +++ b/src/MainWindow.cc @@ -43,7 +43,6 @@ MainWindow::MainWindow(QWidget *parent) { setWindowTitle("nheko"); setObjectName("MainWindow"); - setStyleSheet("QWidget#MainWindow {background-color: #fff}"); restoreWindowSize(); @@ -204,9 +203,9 @@ MainWindow::showChatPage(QString userid, QString homeserver, QString token) spinner_ = QSharedPointer<LoadingIndicator>( new LoadingIndicator(this), [=](LoadingIndicator *indicator) { indicator->deleteLater(); }); - spinner_->setColor("#acc7dc"); spinner_->setFixedHeight(100); spinner_->setFixedWidth(100); + spinner_->setObjectName("ChatPageLoadSpinner"); spinner_->start(); } diff --git a/src/RegisterPage.cc b/src/RegisterPage.cc index 304a7dc0..01f3b28f 100644 --- a/src/RegisterPage.cc +++ b/src/RegisterPage.cc @@ -28,7 +28,7 @@ RegisterPage::RegisterPage(QSharedPointer<MatrixClient> client, QWidget *parent) : QWidget(parent) , client_(client) { - setStyleSheet("background-color: #fff"); + // setStyleSheet("background-color: #fff"); top_layout_ = new QVBoxLayout(); @@ -73,30 +73,30 @@ RegisterPage::RegisterPage(QSharedPointer<MatrixClient> client, QWidget *parent) form_wrapper_->addStretch(1); username_input_ = new TextField(); - username_input_->setTextColor("#333333"); + // username_input_->setTextColor("#333333"); username_input_->setLabel(tr("Username")); - username_input_->setInkColor("#555459"); - username_input_->setBackgroundColor("#fff"); + // username_input_->setInkColor("#555459"); + // username_input_->setBackgroundColor("#fff"); password_input_ = new TextField(); - password_input_->setTextColor("#333333"); + // password_input_->setTextColor("#333333"); password_input_->setLabel(tr("Password")); - password_input_->setInkColor("#555459"); - password_input_->setBackgroundColor("#fff"); + // password_input_->setInkColor("#555459"); + // password_input_->setBackgroundColor("#fff"); password_input_->setEchoMode(QLineEdit::Password); password_confirmation_ = new TextField(); - password_confirmation_->setTextColor("#333333"); + // password_confirmation_->setTextColor("#333333"); password_confirmation_->setLabel(tr("Password confirmation")); - password_confirmation_->setInkColor("#555459"); - password_confirmation_->setBackgroundColor("#fff"); + // password_confirmation_->setInkColor("#555459"); + // password_confirmation_->setBackgroundColor("#fff"); password_confirmation_->setEchoMode(QLineEdit::Password); server_input_ = new TextField(); - server_input_->setTextColor("#333333"); + // server_input_->setTextColor("#333333"); server_input_->setLabel(tr("Home Server")); - server_input_->setInkColor("#555459"); - server_input_->setBackgroundColor("#fff"); + // server_input_->setInkColor("#555459"); + // server_input_->setBackgroundColor("#fff"); form_layout_->addWidget(username_input_, Qt::AlignHCenter, 0); form_layout_->addWidget(password_input_, Qt::AlignHCenter, 0); @@ -112,11 +112,11 @@ RegisterPage::RegisterPage(QSharedPointer<MatrixClient> client, QWidget *parent) error_label_ = new QLabel(this); error_label_->setFont(font); - error_label_->setStyleSheet("color: #E22826"); + // error_label_->setStyleSheet("color: #E22826"); register_button_ = new RaisedButton(tr("REGISTER"), this); - register_button_->setBackgroundColor(QColor("#333333")); - register_button_->setForegroundColor(QColor("white")); + // register_button_->setBackgroundColor(QColor("#333333")); + // register_button_->setForegroundColor(QColor("white")); register_button_->setMinimumSize(350, 65); register_button_->setFontSize(conf::btn::fontSize); register_button_->setCornerRadius(conf::btn::cornerRadius); diff --git a/src/RoomInfoListItem.cc b/src/RoomInfoListItem.cc index 49b24b58..875bb506 100644 --- a/src/RoomInfoListItem.cc +++ b/src/RoomInfoListItem.cc @@ -95,18 +95,19 @@ RoomInfoListItem::paintEvent(QPaintEvent *event) p.setRenderHint(QPainter::SmoothPixmapTransform); p.setRenderHint(QPainter::Antialiasing); - if (isPressed_) - p.fillRect(rect(), QColor("#38A3D8")); - else if (underMouse()) - p.fillRect(rect(), QColor(200, 200, 200, 128)); - else - p.fillRect(rect(), QColor("#FFF")); - QFont font; font.setPixelSize(conf::fontSize); QFontMetrics metrics(font); - p.setPen(QColor("#333")); + if (isPressed_) { + p.fillRect(rect(), highlightedBackgroundColor_); + } else if (underMouse()) { + p.fillRect(rect(), hoverBackgroundColor_); + } else { + p.fillRect(rect(), backgroundColor_); + } + + // p.setPen(QColor("#333")); QRect avatarRegion(Padding, Padding, IconSize, IconSize); @@ -115,10 +116,12 @@ RoomInfoListItem::paintEvent(QPaintEvent *event) if (width() > ui::sidebar::SmallSize) { if (isPressed_) { - QPen pen(QColor("white")); + QPen pen(highlightedTitleColor_); + p.setPen(pen); + } else { + QPen pen(titleColor_); p.setPen(pen); } - font.setPixelSize(conf::roomlist::fonts::heading); p.setFont(font); @@ -130,8 +133,11 @@ RoomInfoListItem::paintEvent(QPaintEvent *event) state_.getName(), Qt::ElideRight, (width() - IconSize - 2 * Padding) * 0.8); p.drawText(QPoint(2 * Padding + IconSize, top_y), name); - if (!isPressed_) { - QPen pe |