From 87d6883a0fc50d5dbe28ceae2e70577717e56817 Mon Sep 17 00:00:00 2001 From: TriKriSta Date: Mon, 18 Feb 2019 20:53:43 +0200 Subject: [PATCH 1/8] style: add dark style --- res.qrc | 67 ++++- src/chatlog/chatlog.cpp | 4 +- src/chatlog/chatmessage.cpp | 6 +- src/chatlog/content/text.cpp | 1 + src/chatlog/content/text.h | 3 +- src/widget/form/genericchatform.cpp | 2 + src/widget/style.cpp | 25 +- src/widget/widget.cpp | 2 + themes/dark/acceptCall/acceptCall.svg | 45 ++++ themes/dark/centralWidget/centralWidget.css | 24 ++ themes/dark/chatArea/chatArea.css | 15 ++ themes/dark/chatArea/chatHead.css | 42 +++ themes/dark/chatArea/error.svg | 62 +++++ themes/dark/chatArea/info.svg | 62 +++++ themes/dark/chatArea/innerStyle.css | 37 +++ themes/dark/chatArea/scrollBarDownArrow.svg | 23 ++ themes/dark/chatArea/scrollBarLeftArrow.svg | 23 ++ themes/dark/chatArea/scrollBarRightArrow.svg | 23 ++ themes/dark/chatArea/scrollBarUpArrow.svg | 23 ++ themes/dark/chatArea/spinner.svg | 43 ++++ themes/dark/chatArea/symbols.svg | 208 +++++++++++++++ themes/dark/chatArea/typing.svg | 61 +++++ themes/dark/chatForm/buttons.css | 183 +++++++++++++ themes/dark/chatForm/callButton.svg | 22 ++ themes/dark/chatForm/emoteButton.svg | 28 ++ themes/dark/chatForm/exitFullScreenButton.svg | 42 +++ themes/dark/chatForm/fileButton.svg | 27 ++ themes/dark/chatForm/fullScreenButtons.css | 78 ++++++ themes/dark/chatForm/labels.css | 14 + themes/dark/chatForm/micButton.svg | 61 +++++ themes/dark/chatForm/micButtonRed.svg | 67 +++++ themes/dark/chatForm/screenshotButton.svg | 8 + themes/dark/chatForm/searchCalendarButton.svg | 98 +++++++ themes/dark/chatForm/searchDownButton.svg | 80 ++++++ themes/dark/chatForm/searchHideButton.svg | 79 ++++++ themes/dark/chatForm/searchSettingsButton.svg | 53 ++++ themes/dark/chatForm/searchUpButton.svg | 80 ++++++ themes/dark/chatForm/sendButton.svg | 22 ++ themes/dark/chatForm/videoButton.svg | 27 ++ themes/dark/chatForm/videoButtonRed.svg | 29 +++ themes/dark/chatForm/videoPreview.svg | 42 +++ themes/dark/chatForm/videoPreviewRed.svg | 41 +++ themes/dark/chatForm/volButton.svg | 52 ++++ themes/dark/chatForm/volButtonRed.svg | 61 +++++ themes/dark/contentDialog/contentDialog.css | 16 ++ themes/dark/emoteButton/emoteButton.css | 26 ++ themes/dark/emoteButton/emoteButton.svg | 28 ++ themes/dark/emoticonWidget/dot_page.svg | 40 +++ .../dark/emoticonWidget/dot_page_current.svg | 40 +++ themes/dark/emoticonWidget/dot_page_hover.svg | 40 +++ themes/dark/emoticonWidget/emoticonWidget.css | 40 +++ themes/dark/fileButton/fileButton.css | 30 +++ themes/dark/fileButton/fileButton.svg | 27 ++ .../dark/fileTransferInstance/arrow_white.svg | 23 ++ themes/dark/fileTransferInstance/browse.svg | 147 +++++++++++ themes/dark/fileTransferInstance/dir.svg | 63 +++++ .../filetransferWidget.css | 27 ++ themes/dark/fileTransferInstance/no.svg | 46 ++++ themes/dark/fileTransferInstance/pause.svg | 56 ++++ themes/dark/fileTransferInstance/yes.svg | 46 ++++ themes/dark/fileTransferWidget/fileDone.svg | 30 +++ .../fileTransferWidget/fileTransferWidget.css | 26 ++ themes/dark/friendList/friendList.css | 84 ++++++ .../dark/genericChatForm/genericChatForm.css | 4 + themes/dark/loginScreen/loginScreen.css | 80 ++++++ themes/dark/msgEdit/msgEdit.css | 33 +++ .../notificationEdge/notificationEdge.css | 9 + themes/dark/rejectCall/rejectCall.svg | 45 ++++ .../screenshotButton/screenshotButton.css | 31 +++ .../screenshotButton/screenshotButton.svg | 8 + themes/dark/sendButton/sendButton.css | 26 ++ themes/dark/sendButton/sendButton.svg | 22 ++ themes/dark/settings/mainContent.css | 242 ++++++++++++++++++ themes/dark/settings/mainHead.css | 5 + themes/dark/statusButton/menu_indicator.svg | 23 ++ themes/dark/statusButton/statusButton.css | 41 +++ themes/dark/tooliconsZone/tooliconsZone.css | 35 +++ themes/dark/window/general.css | 13 + themes/dark/window/profile.css | 5 + themes/dark/window/statusPanel.css | 127 +++++++++ themes/dark/window/window.css | 72 ++++++ .../genericChatForm/genericChatForm.css | 4 + 82 files changed, 3643 insertions(+), 12 deletions(-) create mode 100644 themes/dark/acceptCall/acceptCall.svg create mode 100644 themes/dark/centralWidget/centralWidget.css create mode 100644 themes/dark/chatArea/chatArea.css create mode 100644 themes/dark/chatArea/chatHead.css create mode 100644 themes/dark/chatArea/error.svg create mode 100644 themes/dark/chatArea/info.svg create mode 100644 themes/dark/chatArea/innerStyle.css create mode 100644 themes/dark/chatArea/scrollBarDownArrow.svg create mode 100644 themes/dark/chatArea/scrollBarLeftArrow.svg create mode 100644 themes/dark/chatArea/scrollBarRightArrow.svg create mode 100644 themes/dark/chatArea/scrollBarUpArrow.svg create mode 100644 themes/dark/chatArea/spinner.svg create mode 100644 themes/dark/chatArea/symbols.svg create mode 100644 themes/dark/chatArea/typing.svg create mode 100644 themes/dark/chatForm/buttons.css create mode 100644 themes/dark/chatForm/callButton.svg create mode 100644 themes/dark/chatForm/emoteButton.svg create mode 100644 themes/dark/chatForm/exitFullScreenButton.svg create mode 100644 themes/dark/chatForm/fileButton.svg create mode 100644 themes/dark/chatForm/fullScreenButtons.css create mode 100644 themes/dark/chatForm/labels.css create mode 100644 themes/dark/chatForm/micButton.svg create mode 100644 themes/dark/chatForm/micButtonRed.svg create mode 100644 themes/dark/chatForm/screenshotButton.svg create mode 100644 themes/dark/chatForm/searchCalendarButton.svg create mode 100644 themes/dark/chatForm/searchDownButton.svg create mode 100644 themes/dark/chatForm/searchHideButton.svg create mode 100644 themes/dark/chatForm/searchSettingsButton.svg create mode 100644 themes/dark/chatForm/searchUpButton.svg create mode 100644 themes/dark/chatForm/sendButton.svg create mode 100644 themes/dark/chatForm/videoButton.svg create mode 100644 themes/dark/chatForm/videoButtonRed.svg create mode 100644 themes/dark/chatForm/videoPreview.svg create mode 100644 themes/dark/chatForm/videoPreviewRed.svg create mode 100644 themes/dark/chatForm/volButton.svg create mode 100644 themes/dark/chatForm/volButtonRed.svg create mode 100644 themes/dark/contentDialog/contentDialog.css create mode 100644 themes/dark/emoteButton/emoteButton.css create mode 100644 themes/dark/emoteButton/emoteButton.svg create mode 100644 themes/dark/emoticonWidget/dot_page.svg create mode 100644 themes/dark/emoticonWidget/dot_page_current.svg create mode 100644 themes/dark/emoticonWidget/dot_page_hover.svg create mode 100644 themes/dark/emoticonWidget/emoticonWidget.css create mode 100644 themes/dark/fileButton/fileButton.css create mode 100644 themes/dark/fileButton/fileButton.svg create mode 100644 themes/dark/fileTransferInstance/arrow_white.svg create mode 100644 themes/dark/fileTransferInstance/browse.svg create mode 100644 themes/dark/fileTransferInstance/dir.svg create mode 100644 themes/dark/fileTransferInstance/filetransferWidget.css create mode 100644 themes/dark/fileTransferInstance/no.svg create mode 100644 themes/dark/fileTransferInstance/pause.svg create mode 100644 themes/dark/fileTransferInstance/yes.svg create mode 100644 themes/dark/fileTransferWidget/fileDone.svg create mode 100644 themes/dark/fileTransferWidget/fileTransferWidget.css create mode 100644 themes/dark/friendList/friendList.css create mode 100644 themes/dark/genericChatForm/genericChatForm.css create mode 100644 themes/dark/loginScreen/loginScreen.css create mode 100644 themes/dark/msgEdit/msgEdit.css create mode 100644 themes/dark/notificationEdge/notificationEdge.css create mode 100644 themes/dark/rejectCall/rejectCall.svg create mode 100644 themes/dark/screenshotButton/screenshotButton.css create mode 100644 themes/dark/screenshotButton/screenshotButton.svg create mode 100644 themes/dark/sendButton/sendButton.css create mode 100644 themes/dark/sendButton/sendButton.svg create mode 100644 themes/dark/settings/mainContent.css create mode 100644 themes/dark/settings/mainHead.css create mode 100644 themes/dark/statusButton/menu_indicator.svg create mode 100644 themes/dark/statusButton/statusButton.css create mode 100644 themes/dark/tooliconsZone/tooliconsZone.css create mode 100644 themes/dark/window/general.css create mode 100644 themes/dark/window/profile.css create mode 100644 themes/dark/window/statusPanel.css create mode 100644 themes/dark/window/window.css create mode 100644 themes/default/genericChatForm/genericChatForm.css diff --git a/res.qrc b/res.qrc index fe47fbbe7..55df2abba 100644 --- a/res.qrc +++ b/res.qrc @@ -44,7 +44,71 @@ img/taskbar/light/taskbar_offline.svg img/taskbar/light/taskbar_event.svg img/transfer.svg - themes/default/fileTransferWidget/fileDone.svg + themes/dark/fileTransferWidget/fileDone.svg + themes/dark/centralWidget/centralWidget.css + themes/dark/chatArea/chatArea.css + themes/dark/chatArea/chatHead.css + themes/dark/chatArea/innerStyle.css + themes/dark/chatArea/scrollBarUpArrow.svg + themes/dark/chatArea/scrollBarDownArrow.svg + themes/dark/chatArea/scrollBarLeftArrow.svg + themes/dark/chatArea/scrollBarRightArrow.svg + themes/dark/chatForm/buttons.css + themes/dark/chatForm/fullScreenButtons.css + themes/dark/chatForm/callButton.svg + themes/dark/chatForm/labels.css + themes/dark/chatForm/micButton.svg + themes/dark/chatForm/micButtonRed.svg + themes/dark/chatForm/videoButton.svg + themes/dark/chatForm/videoButtonRed.svg + themes/dark/chatForm/volButton.svg + themes/dark/chatForm/volButtonRed.svg + themes/dark/chatForm/videoPreview.svg + themes/dark/chatForm/videoPreviewRed.svg + themes/dark/chatForm/emoteButton.svg + themes/dark/chatForm/fileButton.svg + themes/dark/chatForm/screenshotButton.svg + themes/dark/chatForm/searchCalendarButton.svg + themes/dark/chatForm/searchDownButton.svg + themes/dark/chatForm/searchHideButton.svg + themes/dark/chatForm/searchSettingsButton.svg + themes/dark/chatForm/searchUpButton.svg + themes/dark/chatForm/sendButton.svg + themes/dark/chatForm/exitFullScreenButton.svg + themes/dark/emoticonWidget/dot_page.svg + themes/dark/emoticonWidget/dot_page_current.svg + themes/dark/emoticonWidget/dot_page_hover.svg + themes/dark/emoticonWidget/emoticonWidget.css + themes/dark/fileTransferWidget/fileTransferWidget.css + themes/dark/friendList/friendList.css + themes/dark/msgEdit/msgEdit.css + themes/dark/settings/mainContent.css + themes/dark/settings/mainHead.css + themes/dark/statusButton/statusButton.css + themes/dark/statusButton/menu_indicator.svg + themes/dark/window/general.css + themes/dark/window/profile.css + themes/dark/window/statusPanel.css + themes/dark/window/window.css + themes/dark/chatArea/info.svg + themes/dark/chatArea/spinner.svg + themes/dark/chatArea/typing.svg + themes/dark/chatArea/error.svg + themes/dark/fileTransferInstance/no.svg + themes/dark/fileTransferInstance/pause.svg + themes/dark/fileTransferInstance/yes.svg + themes/dark/fileTransferInstance/dir.svg + themes/dark/fileTransferInstance/arrow_white.svg + themes/dark/fileTransferInstance/browse.svg + themes/dark/fileTransferInstance/filetransferWidget.css + themes/dark/genericChatForm/genericChatForm.css + themes/dark/acceptCall/acceptCall.svg + themes/dark/rejectCall/rejectCall.svg + themes/dark/notificationEdge/notificationEdge.css + themes/dark/loginScreen/loginScreen.css + themes/dark/contentDialog/contentDialog.css + themes/dark/tooliconsZone/tooliconsZone.css + themes/default/fileTransferWidget/fileDone.svg themes/default/centralWidget/centralWidget.css themes/default/chatArea/chatArea.css themes/default/chatArea/chatHead.css @@ -101,6 +165,7 @@ themes/default/fileTransferInstance/arrow_white.svg themes/default/fileTransferInstance/browse.svg themes/default/fileTransferInstance/filetransferWidget.css + themes/default/genericChatForm/genericChatForm.css themes/default/acceptCall/acceptCall.svg themes/default/rejectCall/rejectCall.svg img/login_logo.svg diff --git a/src/chatlog/chatlog.cpp b/src/chatlog/chatlog.cpp index f21eecc8f..c999e8d71 100644 --- a/src/chatlog/chatlog.cpp +++ b/src/chatlog/chatlog.cpp @@ -23,6 +23,7 @@ #include "chatmessage.h" #include "content/filetransferwidget.h" #include "src/widget/translator.h" +#include "src/widget/style.h" #include #include @@ -65,7 +66,8 @@ ChatLog::ChatLog(QWidget* parent) setDragMode(QGraphicsView::NoDrag); setViewportUpdateMode(MinimalViewportUpdate); setContextMenuPolicy(Qt::CustomContextMenu); - setBackgroundBrush(QBrush(Qt::white, Qt::SolidPattern)); +// setBackgroundBrush(QBrush(Qt::white, Qt::SolidPattern)); // NOTE: default + setBackgroundBrush(QBrush(Style::getColor(Style::White), Qt::SolidPattern)); // NOTE: dark // The selection rect for multi-line selection selGraphItem = scene->addRect(0, 0, 0, 0, selectionRectColor.darker(120), selectionRectColor); diff --git a/src/chatlog/chatmessage.cpp b/src/chatlog/chatmessage.cpp index 42f4ea2e2..8f5eb2216 100644 --- a/src/chatlog/chatmessage.cpp +++ b/src/chatlog/chatmessage.cpp @@ -51,7 +51,8 @@ ChatMessage::Ptr ChatMessage::createChatMessage(const QString& sender, const QSt QString senderText = sender; const QColor actionColor = - QColor("#1818FF"); // has to match the color in innerStyle.css (div.action) +// QColor("#1818FF"); // has to match the color in innerStyle.css (div.action) // NOTE: Default + QColor("#546eff"); // NOTE: Dark // smileys if (Settings::getInstance().getUseEmoticons()) @@ -88,7 +89,8 @@ ChatMessage::Ptr ChatMessage::createChatMessage(const QString& sender, const QSt if (isMe) authorFont.setBold(true); - QColor color = QColor(0, 0, 0); +// QColor color = QColor(0, 0, 0); // NOTE: Default + QColor color = QColor("#c3c3c3"); // NOTE: Dark QColor authorColor; if (colorizeName && Settings::getInstance().getEnableGroupChatsColor()) diff --git a/src/chatlog/content/text.cpp b/src/chatlog/content/text.cpp index f6f1d2fb1..c5309bdeb 100644 --- a/src/chatlog/content/text.cpp +++ b/src/chatlog/content/text.cpp @@ -43,6 +43,7 @@ Text::Text(const QString& txt, const QFont& font, bool enableElide, const QStrin , defStyleSheet(Style::getStylesheet(QStringLiteral("chatArea/innerStyle.css"), font)) , color(c) { + QString ct = c.name(); setText(txt); setAcceptedMouseButtons(Qt::LeftButton); setAcceptHoverEvents(true); diff --git a/src/chatlog/content/text.h b/src/chatlog/content/text.h index 91b0c7f84..9bdb491e1 100644 --- a/src/chatlog/content/text.h +++ b/src/chatlog/content/text.h @@ -32,7 +32,8 @@ class Text : public ChatLineContent public: Text(const QString& txt = "", const QFont& font = QFont(), bool enableElide = false, - const QString& rawText = QString(), const QColor c = Qt::black); +// const QString& rawText = QString(), const QColor c = Qt::black); // NOTE: Default + const QString& rawText = QString(), const QColor c = QColor("#c3c3c3")); // NOTE: Dark virtual ~Text(); void setText(const QString& txt); diff --git a/src/widget/form/genericchatform.cpp b/src/widget/form/genericchatform.cpp index d75aecdb0..a2c95f425 100644 --- a/src/widget/form/genericchatform.cpp +++ b/src/widget/form/genericchatform.cpp @@ -170,6 +170,8 @@ GenericChatForm::GenericChatForm(const Contact* contact, QWidget* parent) fileLayout->setSpacing(0); fileLayout->setMargin(0); + setStyleSheet(Style::getStylesheet("genericChatForm/genericChatForm.css")); + msgEdit->setStyleSheet(Style::getStylesheet("msgEdit/msgEdit.css") + fontToCss(s.getChatMessageFont(), "QTextEdit")); msgEdit->setFixedHeight(MESSAGE_EDIT_HEIGHT); diff --git a/src/widget/style.cpp b/src/widget/style.cpp index 05d534c80..a87093b09 100644 --- a/src/widget/style.cpp +++ b/src/widget/style.cpp @@ -64,7 +64,7 @@ namespace { const QLatin1Literal ThemeSubFolder{"themes/"}; - const QLatin1Literal BuiltinThemePath{":themes/default/"}; + const QLatin1Literal BuiltinThemePath{":themes/dark/"}; } // helper functions @@ -83,13 +83,22 @@ QString qssifyFont(QFont font) // colors as defined in // https://github.com/ItsDuke/Tox-UI/blob/master/UI%20GUIDELINES.md -static QColor palette[] = { - QColor("#6bc260"), QColor("#cebf44"), QColor("#c84e4e"), QColor("#000000"), QColor("#1c1c1c"), - QColor("#414141"), QColor("#414141").lighter(120), QColor("#d1d1d1"), QColor("#ffffff"), +//static QColor palette[] = { // NOTE: Default +// QColor("#6bc260"), QColor("#cebf44"), QColor("#c84e4e"), QColor("#000000"), QColor("#1c1c1c"), +// QColor("#414141"), QColor("#414141").lighter(120), QColor("#d1d1d1"), QColor("#ffffff"), +// QColor("#ff7700"), + +// // Theme colors +// QColor("#1c1c1c"), QColor("#2a2a2a"), QColor("#414141"), QColor("#4e4e4e"), +//}; + +static QColor palette[] = { // NOTE: Dark + QColor("#6bc260"), QColor("#cebf44"), QColor("#c84e4e"), QColor("#000000"), QColor("#c3c3c3"), + QColor("#d1d1d1"), QColor("#100f0f").lighter(120), QColor("#d1d1d1"), QColor("#201f1f"), QColor("#ff7700"), // Theme colors - QColor("#1c1c1c"), QColor("#2a2a2a"), QColor("#414141"), QColor("#4e4e4e"), + QColor("#1c1c1c"), QColor("#2a2a2a"), QColor("#100f0f"), QColor("#201f1f"), }; static QMap dict; @@ -318,8 +327,10 @@ void Style::setThemeColor(const QColor& color) // Reset to default palette[ThemeDark] = QColor("#1c1c1c"); palette[ThemeMediumDark] = QColor("#2a2a2a"); - palette[ThemeMedium] = QColor("#414141"); - palette[ThemeLight] = QColor("#4e4e4e"); +// palette[ThemeMedium] = QColor("#414141"); // NOTE: Default + palette[ThemeMedium] = QColor("#100f0f"); // NOTE: Dark +// palette[ThemeLight] = QColor("#4e4e4e"); // MOTE: Default + palette[ThemeLight] = QColor("#201f1f"); // MOTE: Dark } else { palette[ThemeDark] = color.darker(155); palette[ThemeMediumDark] = color.darker(135); diff --git a/src/widget/widget.cpp b/src/widget/widget.cpp index eef00170d..96cc99e89 100644 --- a/src/widget/widget.cpp +++ b/src/widget/widget.cpp @@ -677,6 +677,8 @@ void Widget::onSeparateWindowChanged(bool separate, bool clicked) } QWidget* contentWidget = new QWidget(this); + contentWidget->setObjectName("contentWidget"); + contentLayout = new ContentLayout(contentWidget); ui->mainSplitter->addWidget(contentWidget); diff --git a/themes/dark/acceptCall/acceptCall.svg b/themes/dark/acceptCall/acceptCall.svg new file mode 100644 index 000000000..3938b6e2c --- /dev/null +++ b/themes/dark/acceptCall/acceptCall.svg @@ -0,0 +1,45 @@ + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/themes/dark/centralWidget/centralWidget.css b/themes/dark/centralWidget/centralWidget.css new file mode 100644 index 000000000..caa044dcf --- /dev/null +++ b/themes/dark/centralWidget/centralWidget.css @@ -0,0 +1,24 @@ +QLabel +{ + color: #c3c3c3; +} + +QLineEdit +{ + color: #c3c3c3; +} + +QTextEdit +{ + color: #c3c3c3; +} + +QSpinBox +{ + color: #c3c3c3; +} + +QListView +{ + color: #c3c3c3; +} diff --git a/themes/dark/chatArea/chatArea.css b/themes/dark/chatArea/chatArea.css new file mode 100644 index 000000000..0d04c2634 --- /dev/null +++ b/themes/dark/chatArea/chatArea.css @@ -0,0 +1,15 @@ +QTextEdit +{ + background: white; + color: black; +} + +QGraphicsView +{ + border: none; +} + +QWidget +{ + background: #201f1f; +} diff --git a/themes/dark/chatArea/chatHead.css b/themes/dark/chatArea/chatHead.css new file mode 100644 index 000000000..0955fa69a --- /dev/null +++ b/themes/dark/chatArea/chatHead.css @@ -0,0 +1,42 @@ +QLineEdit +{ + color: @black; + background: white; + border: 0px; +} + +#nameLabel +{ + color: #c3c3c3; + font: @mediumBold; + font-size:12px; +} + +#statusLabel +{ + color: @mediumGrey; + font: @medium; + font-size:12px; +} + +#peersLabel +{ + color: @mediumGrey; + font: @medium; + font-size:12px; +} + +QLabel[peerType="our"] +{ + color: green; +} + +QLabel[peerType="muted"] +{ + color: darkred; +} + +QLabel[playingAudio="true"] +{ + font-weight: bold; +} diff --git a/themes/dark/chatArea/error.svg b/themes/dark/chatArea/error.svg new file mode 100644 index 000000000..4a28a42fa --- /dev/null +++ b/themes/dark/chatArea/error.svg @@ -0,0 +1,62 @@ + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + diff --git a/themes/dark/chatArea/info.svg b/themes/dark/chatArea/info.svg new file mode 100644 index 000000000..c6eb5b0e4 --- /dev/null +++ b/themes/dark/chatArea/info.svg @@ -0,0 +1,62 @@ + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + diff --git a/themes/dark/chatArea/innerStyle.css b/themes/dark/chatArea/innerStyle.css new file mode 100644 index 000000000..fcb5b5486 --- /dev/null +++ b/themes/dark/chatArea/innerStyle.css @@ -0,0 +1,37 @@ +body { + font: @baseFont; +} + +p { + white-space: pre-wrap; +} + +.action { + color: #546eff; + font-style: italic; + font-weight: bold; +} + +.typing { + color: @mediumGreyLight; +} + +.quote { + color: #279419; +} + +.alert { + margin-left: 0px; + margin-right: 0px; + background-color: @orange; +} + +.alert_name { + background-color: @orange; + font: @bigBold; +} + +a { + color: #d292ff; + font-weight: bold +} diff --git a/themes/dark/chatArea/scrollBarDownArrow.svg b/themes/dark/chatArea/scrollBarDownArrow.svg new file mode 100644 index 000000000..6c1713ffc --- /dev/null +++ b/themes/dark/chatArea/scrollBarDownArrow.svg @@ -0,0 +1,23 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/themes/dark/chatArea/scrollBarLeftArrow.svg b/themes/dark/chatArea/scrollBarLeftArrow.svg new file mode 100644 index 000000000..90406d516 --- /dev/null +++ b/themes/dark/chatArea/scrollBarLeftArrow.svg @@ -0,0 +1,23 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/themes/dark/chatArea/scrollBarRightArrow.svg b/themes/dark/chatArea/scrollBarRightArrow.svg new file mode 100644 index 000000000..4d63e65cb --- /dev/null +++ b/themes/dark/chatArea/scrollBarRightArrow.svg @@ -0,0 +1,23 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/themes/dark/chatArea/scrollBarUpArrow.svg b/themes/dark/chatArea/scrollBarUpArrow.svg new file mode 100644 index 000000000..da4930657 --- /dev/null +++ b/themes/dark/chatArea/scrollBarUpArrow.svg @@ -0,0 +1,23 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/themes/dark/chatArea/spinner.svg b/themes/dark/chatArea/spinner.svg new file mode 100644 index 000000000..0887474b8 --- /dev/null +++ b/themes/dark/chatArea/spinner.svg @@ -0,0 +1,43 @@ + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/themes/dark/chatArea/symbols.svg b/themes/dark/chatArea/symbols.svg new file mode 100644 index 000000000..68ef8e4b6 --- /dev/null +++ b/themes/dark/chatArea/symbols.svg @@ -0,0 +1,208 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + ! + + + + + + + + + + i + + + + + + + + + + + + + + + + + + diff --git a/themes/dark/chatArea/typing.svg b/themes/dark/chatArea/typing.svg new file mode 100644 index 000000000..35c3e1d5b --- /dev/null +++ b/themes/dark/chatArea/typing.svg @@ -0,0 +1,61 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/themes/dark/chatForm/buttons.css b/themes/dark/chatForm/buttons.css new file mode 100644 index 000000000..11316d9c3 --- /dev/null +++ b/themes/dark/chatForm/buttons.css @@ -0,0 +1,183 @@ +/* Message edit */ + +QAbstractButton#emoteButton +{ + background-image: url("@getImagePath(chatForm/emoteButton.svg)"); + border-top-right-radius: 5px; + width: 24px; + height: 24px; +} + +QAbstractButton#fileButton +{ + background-image: url("@getImagePath(chatForm/fileButton.svg)"); + border-bottom-right-radius: 5px; + width: 24px; + height: 24px; +} + +QAbstractButton#screenshotButton +{ + background-image: url("@getImagePath(chatForm/screenshotButton.svg)"); + border-top-left-radius: 5px; + width: 24px; + height: 24px; +} + +QAbstractButton#sendButton +{ + background-image: url("@getImagePath(chatForm/sendButton.svg)"); + border-radius: 5px; + width: 50px; + height: 50px; + +} + +/* Header */ + +QAbstractButton#volButton +{ + border-image: url("@getImagePath(chatForm/volButton.svg)"); + border-radius: 5px; + width: 22px; + height: 18px; +} + +QAbstractButton#micButton +{ + border-image: url("@getImagePath(chatForm/micButton.svg)"); + border-radius: 5px; + width: 22px; + height: 18px; +} + +QAbstractButton#videoButton +{ + background-image: url("@getImagePath(chatForm/videoButton.svg)"); + border-radius: 5px; + width: 50px; + height: 40px; +} + +QAbstractButton#callButton +{ + background-image: url("@getImagePath(chatForm/callButton.svg)"); + border-radius: 5px; + width: 50px; + height: 40px; +} + +/* SearchLine */ + +QAbstractButton#searchSettingsButton +{ + background-image: url("@getImagePath(chatForm/searchSettingsButton.svg)"); + border-radius: 5px; + width: 35px; + height: 35px; +} + +QAbstractButton#searchHideButton +{ + background-image: url("@getImagePath(chatForm/searchHideButton.svg)"); + border-radius: 5px; + width: 35px; + height: 35px; +} + +QAbstractButton#searchUpButton +{ + background-image: url("@getImagePath(chatForm/searchUpButton.svg)"); + border-radius: 5px; + width: 35px; + height: 35px; +} + +QAbstractButton#searchDownButton +{ + background-image: url("@getImagePath(chatForm/searchDownButton.svg)"); + border-radius: 5px; + width: 35px; + height: 35px; +} + +QAbstractButton#choiceDateButton +{ + background-image: url("@getImagePath(chatForm/searchCalendarButton.svg)"); + border-radius: 5px; + width: 45px; + height: 35px; +} + +QAbstractButton#startButton +{ + border-radius: 5px; + width: 60px; + height: 35px; + color: #fff +} + +/* Common */ + +QAbstractButton +{ + background-repeat: none; + background-position: center; + border: none; +} + +QAbstractButton:disabled +{ + color: gray; + background-color: #515151; +} + +QAbstractButton:focus +{ + outline: none; +} + +QAbstractButton[state="green"] +{ + background-color: #529449; +} + +QAbstractButton[state="green"]:hover +{ + background-color: #589f4e; +} + +QAbstractButton[state="green"]:pressed +{ + background-color: #437a3c; +} + +QAbstractButton[state="red"] +{ + background-color: #9e2525; +} + +QAbstractButton[state="red"]:hover +{ + background-color: #bd2c2c; +} + +QAbstractButton[state="red"]:pressed +{ + background-color: #8f2121; +} + +QAbstractButton[state="yellow"] +{ + background-color: #e6a850; +} + +QAbstractButton[state="yellow"]:hover +{ + background-color: #e6bd5d; +} + +QAbstractButton[state="yellow"]:pressed +{ + background-color: #e6843e; +} diff --git a/themes/dark/chatForm/callButton.svg b/themes/dark/chatForm/callButton.svg new file mode 100644 index 000000000..3af0fdc19 --- /dev/null +++ b/themes/dark/chatForm/callButton.svg @@ -0,0 +1,22 @@ + + + +image/svg+xml diff --git a/themes/dark/chatForm/emoteButton.svg b/themes/dark/chatForm/emoteButton.svg new file mode 100644 index 000000000..2acca2c20 --- /dev/null +++ b/themes/dark/chatForm/emoteButton.svg @@ -0,0 +1,28 @@ + + + +image/svg+xml diff --git a/themes/dark/chatForm/exitFullScreenButton.svg b/themes/dark/chatForm/exitFullScreenButton.svg new file mode 100644 index 000000000..6e7159f0a --- /dev/null +++ b/themes/dark/chatForm/exitFullScreenButton.svg @@ -0,0 +1,42 @@ + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/themes/dark/chatForm/fileButton.svg b/themes/dark/chatForm/fileButton.svg new file mode 100644 index 000000000..284cd5cdd --- /dev/null +++ b/themes/dark/chatForm/fileButton.svg @@ -0,0 +1,27 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/themes/dark/chatForm/fullScreenButtons.css b/themes/dark/chatForm/fullScreenButtons.css new file mode 100644 index 000000000..1fdc96e2e --- /dev/null +++ b/themes/dark/chatForm/fullScreenButtons.css @@ -0,0 +1,78 @@ +QFrame +{ + background-color: rgba(50, 50, 50, 0.6); + border-radius: 20px; +} + +QAbstractButton +{ + background-color: transparent; + background-repeat: none; + background-position: center; + border: none; + border-radius: 5px; +} + +QAbstractButton:hover +{ + background-color: rgba(255,255,255, 0.2); +} + +QAbstractButton:pressed +{ + background-color: rgba(0,0,0, 0.2); +} + +QAbstractButton#volButtonFullScreen +{ + background-image: url("@getImagePath(chatForm/volButton.svg)"); + width: 11px; + height: 9px; + padding: 12px; +} + +QAbstractButton#micButtonFullScreen +{ + background-image: url("@getImagePath(chatForm/micButton.svg)"); + width: 11px; + height: 9px; + padding: 12px; +} + +QAbstractButton#videoButtonFullScreen +{ + background-image: url("@getImagePath(chatForm/videoButtonRed.svg)"); + width: 37px; + height: 33px; +} + +QAbstractButton#videoPreviewButton +{ + background-image: url("@getImagePath(chatForm/videoPreview.svg)"); + width: 13px; + height: 13px; + padding: 10px; +} + +QAbstractButton#exitFullScreenButton +{ + background-image: url("@getImagePath(chatForm/exitFullScreenButton.svg)"); + width: 30px; + height: 30px; + padding: 1px; +} + +QAbstractButton#volButtonFullScreen[state="red"] +{ + background-image: url("@getImagePath(chatForm/volButtonRed.svg)"); +} + +QAbstractButton#micButtonFullScreen[state="red"] +{ + background-image: url("@getImagePath(chatForm/micButtonRed.svg)"); +} + +QAbstractButton#videoPreviewButton[state="red"] +{ + background-image: url("@getImagePath(chatForm/videoPreviewRed.svg)"); +} diff --git a/themes/dark/chatForm/labels.css b/themes/dark/chatForm/labels.css new file mode 100644 index 000000000..8f0b0173b --- /dev/null +++ b/themes/dark/chatForm/labels.css @@ -0,0 +1,14 @@ +QLabel +{ + color: #000; +} + +QLabel:disabled +{ + color: #ddd; +} + +QLabel[state="red"] +{ + color: #e84747; +} diff --git a/themes/dark/chatForm/micButton.svg b/themes/dark/chatForm/micButton.svg new file mode 100644 index 000000000..b45e8fccb --- /dev/null +++ b/themes/dark/chatForm/micButton.svg @@ -0,0 +1,61 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/themes/dark/chatForm/micButtonRed.svg b/themes/dark/chatForm/micButtonRed.svg new file mode 100644 index 000000000..8a8979014 --- /dev/null +++ b/themes/dark/chatForm/micButtonRed.svg @@ -0,0 +1,67 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/themes/dark/chatForm/screenshotButton.svg b/themes/dark/chatForm/screenshotButton.svg new file mode 100644 index 000000000..25a250ce3 --- /dev/null +++ b/themes/dark/chatForm/screenshotButton.svg @@ -0,0 +1,8 @@ + + image/svg+xml + + Layer 1 + + + + \ No newline at end of file diff --git a/themes/dark/chatForm/searchCalendarButton.svg b/themes/dark/chatForm/searchCalendarButton.svg new file mode 100644 index 000000000..e0839be6c --- /dev/null +++ b/themes/dark/chatForm/searchCalendarButton.svg @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/themes/dark/chatForm/searchDownButton.svg b/themes/dark/chatForm/searchDownButton.svg new file mode 100644 index 000000000..9068ae888 --- /dev/null +++ b/themes/dark/chatForm/searchDownButton.svg @@ -0,0 +1,80 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/themes/dark/chatForm/searchHideButton.svg b/themes/dark/chatForm/searchHideButton.svg new file mode 100644 index 000000000..5b0fb80c3 --- /dev/null +++ b/themes/dark/chatForm/searchHideButton.svg @@ -0,0 +1,79 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/themes/dark/chatForm/searchSettingsButton.svg b/themes/dark/chatForm/searchSettingsButton.svg new file mode 100644 index 000000000..6f498e3f5 --- /dev/null +++ b/themes/dark/chatForm/searchSettingsButton.svg @@ -0,0 +1,53 @@ + + + +image/svg+xml + + diff --git a/themes/dark/chatForm/searchUpButton.svg b/themes/dark/chatForm/searchUpButton.svg new file mode 100644 index 000000000..e425ae579 --- /dev/null +++ b/themes/dark/chatForm/searchUpButton.svg @@ -0,0 +1,80 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/themes/dark/chatForm/sendButton.svg b/themes/dark/chatForm/sendButton.svg new file mode 100644 index 000000000..3699eb11b --- /dev/null +++ b/themes/dark/chatForm/sendButton.svg @@ -0,0 +1,22 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/themes/dark/chatForm/videoButton.svg b/themes/dark/chatForm/videoButton.svg new file mode 100644 index 000000000..9d243f378 --- /dev/null +++ b/themes/dark/chatForm/videoButton.svg @@ -0,0 +1,27 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/themes/dark/chatForm/videoButtonRed.svg b/themes/dark/chatForm/videoButtonRed.svg new file mode 100644 index 000000000..c292b1b33 --- /dev/null +++ b/themes/dark/chatForm/videoButtonRed.svg @@ -0,0 +1,29 @@ + + + +image/svg+xml diff --git a/themes/dark/chatForm/videoPreview.svg b/themes/dark/chatForm/videoPreview.svg new file mode 100644 index 000000000..be8ffeb00 --- /dev/null +++ b/themes/dark/chatForm/videoPreview.svg @@ -0,0 +1,42 @@ + + + +image/svg+xml diff --git a/themes/dark/chatForm/videoPreviewRed.svg b/themes/dark/chatForm/videoPreviewRed.svg new file mode 100644 index 000000000..ec7501430 --- /dev/null +++ b/themes/dark/chatForm/videoPreviewRed.svg @@ -0,0 +1,41 @@ + + + +image/svg+xml diff --git a/themes/dark/chatForm/volButton.svg b/themes/dark/chatForm/volButton.svg new file mode 100644 index 000000000..18adc13b3 --- /dev/null +++ b/themes/dark/chatForm/volButton.svg @@ -0,0 +1,52 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/themes/dark/chatForm/volButtonRed.svg b/themes/dark/chatForm/volButtonRed.svg new file mode 100644 index 000000000..5934f4539 --- /dev/null +++ b/themes/dark/chatForm/volButtonRed.svg @@ -0,0 +1,61 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/themes/dark/contentDialog/contentDialog.css b/themes/dark/contentDialog/contentDialog.css new file mode 100644 index 000000000..ebfe7c1da --- /dev/null +++ b/themes/dark/contentDialog/contentDialog.css @@ -0,0 +1,16 @@ +QSplitter +{ + color: white; + background-color: white; + alternate-background-color: white; + border-color: white; + gridline-color: white; + selection-color: white; + selection-background-color: white; +} + +QSplitter:handle +{ + color: white; + background-color: white; +} diff --git a/themes/dark/emoteButton/emoteButton.css b/themes/dark/emoteButton/emoteButton.css new file mode 100644 index 000000000..0d9ba959d --- /dev/null +++ b/themes/dark/emoteButton/emoteButton.css @@ -0,0 +1,26 @@ +QPushButton +{ + background-color: #6bc260; + background-image: url("@getImagePath(emoteButton/emoteButton.svg)"); + background-repeat: none; + background-position: center; + border-top-right-radius: 5px; + border: none; + width: 24px; + height: 24px; +} + +QPushButton:hover +{ + background-color: #79c76f; +} + +QPushButton:pressed +{ + background-color: #51b244; +} + +QPushButton:focus +{ + outline: none; +} diff --git a/themes/dark/emoteButton/emoteButton.svg b/themes/dark/emoteButton/emoteButton.svg new file mode 100644 index 000000000..2acca2c20 --- /dev/null +++ b/themes/dark/emoteButton/emoteButton.svg @@ -0,0 +1,28 @@ + + + +image/svg+xml diff --git a/themes/dark/emoticonWidget/dot_page.svg b/themes/dark/emoticonWidget/dot_page.svg new file mode 100644 index 000000000..470860765 --- /dev/null +++ b/themes/dark/emoticonWidget/dot_page.svg @@ -0,0 +1,40 @@ + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/themes/dark/emoticonWidget/dot_page_current.svg b/themes/dark/emoticonWidget/dot_page_current.svg new file mode 100644 index 000000000..c0a960492 --- /dev/null +++ b/themes/dark/emoticonWidget/dot_page_current.svg @@ -0,0 +1,40 @@ + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/themes/dark/emoticonWidget/dot_page_hover.svg b/themes/dark/emoticonWidget/dot_page_hover.svg new file mode 100644 index 000000000..09d9e56ac --- /dev/null +++ b/themes/dark/emoticonWidget/dot_page_hover.svg @@ -0,0 +1,40 @@ + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/themes/dark/emoticonWidget/emoticonWidget.css b/themes/dark/emoticonWidget/emoticonWidget.css new file mode 100644 index 000000000..9074241e4 --- /dev/null +++ b/themes/dark/emoticonWidget/emoticonWidget.css @@ -0,0 +1,40 @@ +QPushButton +{ + background-color: transparent; + background-repeat: none; + border: none; + width: 24px; + height: 24px; +} + +QRadioButton::indicator +{ + width: 10px; + height: 10px; +} + +QRadioButton::indicator:unchecked +{ + image: url(@getImagePath(emoticonWidget/dot_page.svg)); +} + +QRadioButton::indicator:unchecked:hover +{ + image: url(@getImagePath(emoticonWidget/dot_page_hover.svg)); +} + +QRadioButton::indicator:unchecked:pressed +{ + image: url(@getImagePath(emoticonWidget/dot_page_hover.svg)); +} + +QRadioButton::indicator:checked +{ + image: url(@getImagePath(emoticonWidget/dot_page_current.svg)); +} + +QMenu +{ + background-color: @mediumGrey; /* sets background of the menu */ + border: 0px solid; +} diff --git a/themes/dark/fileButton/fileButton.css b/themes/dark/fileButton/fileButton.css new file mode 100644 index 000000000..7d6fb6258 --- /dev/null +++ b/themes/dark/fileButton/fileButton.css @@ -0,0 +1,30 @@ +QPushButton +{ + background-color: #6bc260; + background-image: url("@getImagePath(fileButton/fileButton.svg)"); + background-repeat: none; + background-position: center; + border-bottom-right-radius: 5px; + border: none; + width: 24px; + height: 24px; +} + +QAbstractButton:hover +{ + background-color: #79c76f; +} + +QPushButton:pressed +{ + background-color: #51b244; +} + +QPushButton[enabled="false"] +{ + background-color: #919191; +} + +QPushButton:focus { + outline: none; +} diff --git a/themes/dark/fileButton/fileButton.svg b/themes/dark/fileButton/fileButton.svg new file mode 100644 index 000000000..284cd5cdd --- /dev/null +++ b/themes/dark/fileButton/fileButton.svg @@ -0,0 +1,27 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/themes/dark/fileTransferInstance/arrow_white.svg b/themes/dark/fileTransferInstance/arrow_white.svg new file mode 100644 index 000000000..ee2e9fdcd --- /dev/null +++ b/themes/dark/fileTransferInstance/arrow_white.svg @@ -0,0 +1,23 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/themes/dark/fileTransferInstance/browse.svg b/themes/dark/fileTransferInstance/browse.svg new file mode 100644 index 000000000..378802171 --- /dev/null +++ b/themes/dark/fileTransferInstance/browse.svg @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + diff --git a/themes/dark/fileTransferInstance/dir.svg b/themes/dark/fileTransferInstance/dir.svg new file mode 100644 index 000000000..1d9580b8b --- /dev/null +++ b/themes/dark/fileTransferInstance/dir.svg @@ -0,0 +1,63 @@ + + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/themes/dark/fileTransferInstance/filetransferWidget.css b/themes/dark/fileTransferInstance/filetransferWidget.css new file mode 100644 index 000000000..3f1d5c5ea --- /dev/null +++ b/themes/dark/fileTransferInstance/filetransferWidget.css @@ -0,0 +1,27 @@ +[fontColor="white"] QLabel { + color:white; + font:@big; +} + +[fontColor="black"] QLabel { + color:@mediumGrey; + font:@big; +} + +QPushButton { + margin:0; + border: none; +} + + + +QProgressBar { + border: 2px solid @mediumGrey; + border-radius: 0px; + background-color: @mediumGrey; +} + +QProgressBar::chunk { + background-color: @lightGrey; + width: 1px; +} \ No newline at end of file diff --git a/themes/dark/fileTransferInstance/no.svg b/themes/dark/fileTransferInstance/no.svg new file mode 100644 index 000000000..2ca1c5c1b --- /dev/null +++ b/themes/dark/fileTransferInstance/no.svg @@ -0,0 +1,46 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/themes/dark/fileTransferInstance/pause.svg b/themes/dark/fileTransferInstance/pause.svg new file mode 100644 index 000000000..6a203bd0b --- /dev/null +++ b/themes/dark/fileTransferInstance/pause.svg @@ -0,0 +1,56 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/themes/dark/fileTransferInstance/yes.svg b/themes/dark/fileTransferInstance/yes.svg new file mode 100644 index 000000000..2d4c45ea4 --- /dev/null +++ b/themes/dark/fileTransferInstance/yes.svg @@ -0,0 +1,46 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/themes/dark/fileTransferWidget/fileDone.svg b/themes/dark/fileTransferWidget/fileDone.svg new file mode 100644 index 000000000..5bc56410a --- /dev/null +++ b/themes/dark/fileTransferWidget/fileDone.svg @@ -0,0 +1,30 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/themes/dark/fileTransferWidget/fileTransferWidget.css b/themes/dark/fileTransferWidget/fileTransferWidget.css new file mode 100644 index 000000000..ab306fb9c --- /dev/null +++ b/themes/dark/fileTransferWidget/fileTransferWidget.css @@ -0,0 +1,26 @@ +#default { + border-top-left-radius: 6px; + border-bottom-left-radius: 6px; + background-color: rgb(209,209,209); +} + +#error { + border-radius: 6px; + background-color: rgb(200,78,78); +} + +#success { + background-color: rgb(107,194,96); + border-radius: 6px; +} + +QProgressBar { + background-color: transparent; + border: 1px solid rgb(150,150,150); + height: 11px; + } + + QProgressBar::chunk { + background-color: rgb(150,150,150); + width: 2px; + } \ No newline at end of file diff --git a/themes/dark/friendList/friendList.css b/themes/dark/friendList/friendList.css new file mode 100644 index 000000000..3bfd4cfa2 --- /dev/null +++ b/themes/dark/friendList/friendList.css @@ -0,0 +1,84 @@ +QScrollArea +{ + background: @themeMedium; +} + +QScrollBar:vertical +{ + background: @themeMedium; + width: 16px; + padding: 0px 3px 0px 3px; +} + +QScrollBar:handle:vertical +{ + background: @themeDark; + min-height: 20px; + border-radius: 5px; + margin: 3px 0px 3px 0px; +} + +QScrollBar:handle:vertical:hover +{ + background: @themeMediumDark; +} + +QScrollBar:handle:vertical:pressed +{ + background: @themeDark; +} + +QScrollBar:add-line:vertical +{ + height: 0px; + subcontrol-position: bottom; + subcontrol-origin: margin; +} + +QScrollBar:sub-line:vertical +{ + height: 0px; + subcontrol-position: top; + subcontrol-origin: margin; +} + +QScrollBar:add-page:vertical, QScrollBar::sub-page:vertical +{ + background: none; +} + +QWidget#circleWidgetContainer > QFrame#line +{ + color: white; +} + +QWidget#circleWidgetContainer +{ + background-color: @themeMedium; +} + +QWidget#circleWidgetContainer:hover +{ + background-color: @themeLight; +} + +QWidget#circleWidgetContainer QLineEdit +{ + background-color: @themeLight; +} + +QWidget#circleWidgetContainer > QLabel#status +{ + font: @small; + color: #c3c3c3; +} + +QWidget#circleWidgetContainer > QLabel#name +{ + font: @big; + color: #a3a3a3; +} + +QLabel { + color: white; +} diff --git a/themes/dark/genericChatForm/genericChatForm.css b/themes/dark/genericChatForm/genericChatForm.css new file mode 100644 index 000000000..dca16fd57 --- /dev/null +++ b/themes/dark/genericChatForm/genericChatForm.css @@ -0,0 +1,4 @@ +QWidget +{ + background: #201f1f; +} diff --git a/themes/dark/loginScreen/loginScreen.css b/themes/dark/loginScreen/loginScreen.css new file mode 100644 index 000000000..4ebb07658 --- /dev/null +++ b/themes/dark/loginScreen/loginScreen.css @@ -0,0 +1,80 @@ +#LoginScreen +{ + background-color: #1c1c1c; +} + +#line +{ + color: #757575; +} + +#stackedWidget +{ + background-color: #100f0f; +} + +#labelNewProfile, +#labelLoadProfile +{ + border-style: solid; + border-width: 15px 0 15px 15px; + border-color: #100f0f #100f0f #100f0f #1c1c1c; +} +#labelNewProfile +{ + margin-top:125px; + margin-bottom:45px; +} +#labelLoadProfile +{ + margin-top:165px; + margin-bottom:5px; +} + +LoginScreen > QPushButton, +QStackedWidget QPushButton +{ + background: transparent; + border: none; + color: white; + font-size: 9pt; + font-weight: bold; +} + +#loginButton, +#importButton, +#createAccountButton +{ + border-radius:5px; + padding:5px; + background-color: #529449; +} + +#loginButton:hover, +#importButton:hover, +#createAccountButton:hover +{ + background: #589f4e; +} + +QLabel +{ + color: #c3c3c3; + background: #100f0f; +} + +QLabel#label_7 +{ + background: #1c1c1c; +} + +QCheckBox, QProgressBar, QComboBox, QLineEdit, QListView +{ + color: #c3c3c3; + background: #201f1f; +} + +QCheckBox:disabled +{ + color: gray; +} diff --git a/themes/dark/msgEdit/msgEdit.css b/themes/dark/msgEdit/msgEdit.css new file mode 100644 index 000000000..7c43a0625 --- /dev/null +++ b/themes/dark/msgEdit/msgEdit.css @@ -0,0 +1,33 @@ +QTextEdit +{ + border-color: @lightGrey; + border-style: solid; + border-width: 1px 0 1px 1px; + background: #201f1f; +} + +QTextEdit:hover +{ + border-color: #d7d4d1; +} + +QTextEdit:pressed +{ + border-color: #46465b; +} + +QTextEdit#group +{ + /*border-radius: 0 6px 6px 0; would use to round corners in groupchat, but Qt's implementation seems to be bugged*/ + border: 1px solid #c4c1bd; +} + +QTextEdit#group:hover +{ + border-color: #d7d4d1; +} + +QTextEdit#group:pressed +{ + border-color: #46465b; +} diff --git a/themes/dark/notificationEdge/notificationEdge.css b/themes/dark/notificationEdge/notificationEdge.css new file mode 100644 index 000000000..9676b81a7 --- /dev/null +++ b/themes/dark/notificationEdge/notificationEdge.css @@ -0,0 +1,9 @@ +NotificationEdgeWidget +{ + background-color: #6bc260; +} + +NotificationEdgeWidget > QLabel +{ + color: white; +} diff --git a/themes/dark/rejectCall/rejectCall.svg b/themes/dark/rejectCall/rejectCall.svg new file mode 100644 index 000000000..98f83b064 --- /dev/null +++ b/themes/dark/rejectCall/rejectCall.svg @@ -0,0 +1,45 @@ + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/themes/dark/screenshotButton/screenshotButton.css b/themes/dark/screenshotButton/screenshotButton.css new file mode 100644 index 000000000..7e5a94a57 --- /dev/null +++ b/themes/dark/screenshotButton/screenshotButton.css @@ -0,0 +1,31 @@ +QPushButton +{ + background-color: #6bc260; + background-image: url("@getImagePath(screenshotButton/screenshotButton.svg)"); + background-repeat: none; + background-position: center; + border-top-left-radius: 5px; + border: none; + width: 24px; + height: 24px; +} + +QPushButton:hover +{ + background-color: #79c76f; +} + +QPushButton:pressed +{ + background-color: #51b244; +} + +QPushButton[enabled="false"] +{ + background-color: #919191; +} + +QPushButton:focus +{ + outline: none; +} diff --git a/themes/dark/screenshotButton/screenshotButton.svg b/themes/dark/screenshotButton/screenshotButton.svg new file mode 100644 index 000000000..25a250ce3 --- /dev/null +++ b/themes/dark/screenshotButton/screenshotButton.svg @@ -0,0 +1,8 @@ + + image/svg+xml + + Layer 1 + + + + \ No newline at end of file diff --git a/themes/dark/sendButton/sendButton.css b/themes/dark/sendButton/sendButton.css new file mode 100644 index 000000000..249a9737f --- /dev/null +++ b/themes/dark/sendButton/sendButton.css @@ -0,0 +1,26 @@ +QPushButton +{ + background-color: #6bc260; + background-image: url("@getImagePath(sendButton/sendButton.svg)"); + background-repeat: none; + background-position: center; + border: none; + border-radius: 5px; + width: 50px; + height: 50px; +} + +QPushButton:hover +{ + background-color: #79c76f; +} + +QPushButton:pressed +{ + background-color: #51b244; +} + +QPushButton:focus +{ + outline: none; +} diff --git a/themes/dark/sendButton/sendButton.svg b/themes/dark/sendButton/sendButton.svg new file mode 100644 index 000000000..3699eb11b --- /dev/null +++ b/themes/dark/sendButton/sendButton.svg @@ -0,0 +1,22 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/themes/dark/settings/mainContent.css b/themes/dark/settings/mainContent.css new file mode 100644 index 000000000..80e47019d --- /dev/null +++ b/themes/dark/settings/mainContent.css @@ -0,0 +1,242 @@ +QTextEdit +{ + border-color: @lightGrey; + border-style: solid; + border-width: 1px 0 1px 1px; + background: #201f1f; + border: 1px solid #c4c1bd; +} + +QListWidget +{ + background-color: #201f1f; +} + +QMessageBox +{ + background-color: #201f1f; +} + +QCheckBox +{ + color: #c3c3c3; +} + +QCheckBox:disabled +{ + color: grey; +} + +QSpinBox +{ + background-color: #201f1f; +} + +QSpinBox:disabled +{ + background-color: lightGrey; +} + +QGroupBox +{ + color: #c3c3c3; + background-color: #201f1f; + font: @bigBold; +} + +QComboBox +{ + color: #c3c3c3; + background-color: #201f1f; +} + +QComboBox QAbstractItemView { + background-color: #201f1f; +} + +QLineEdit +{ + background-color: #201f1f; +} + +QLineEdit:disabled +{ + background-color: #262424 + color: #201f1f; +} + +QTabWidget +{ + background-color: #100f0f; +} + +QTabBar::tab:selected +{ + background: #100f0f; + color: #c3c3c3; +} + +QTabBar::tab:!selected +{ + background: #444242; + color: #8e8e8e; +} + +QScrollArea +{ + background-color: #201f1f; +} + +QScrollArea > QWidget > QWidget +{ + background: transparent; +} + +QScrollArea::corner +{ + background-color: #201f1f; + border: none; +} + +QScrollBar:vertical +{ + background: transparent; + width: 12px; + margin-top: 2px; + margin-bottom: 2px; +} + +/* using last is a bit of a hack, but QTabBar otherwise doesn't allow selecting single tabs */ +QTabBar::tab:last:!selected[update-available=true] +{ + background-color: #80c580; +} + +QPushButton#updateAvailableButton +{ + background-color: #21da21; +} + +QScrollBar::handle:vertical +{ + background-color: #d1d1d1; + min-height: 20px; + border-radius: 3px; + margin-left: 2px; +} + +QScrollBar::handle:vertical:hover +{ + background-color: #e3e3e3; +} + +QScrollBar::handle:vertical:pressed +{ + background-color: #b1b1b1; +} + +QScrollBar::add-line:vertical +{ + background-color: white; + height: 0px; + subcontrol-position: bottom; + subcontrol-origin: margin; +} + +QScrollBar::sub-line:vertical +{ + background-color: white; + height: 0px; + subcontrol-position: top; + subcontrol-origin: margin; +} + +QScrollBar:QScrollBar::down-arrow:vertical +{ + width: 10; + height: 10px; + background-color: white; +} + +QScrollBar:QScrollBar::up-arrow:vertical +{ + width: 10px; + height: 10px; + background-color: white; +} + +QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical +{ + background: none; +} + +QScrollBar:horizontal +{ + background-color: white; + height: 10px; + margin: 0 2px 0 2px; +} + +QScrollBar::handle:horizontal +{ + background-color: #d1d1d1; + min-width: 20px; + border-radius: 2px; +} + +QScrollBar::handle:horizontal:hover +{ + background-color: #e3e3e3; +} + +QScrollBar::handle:horizontal:pressed +{ + background-color: #b1b1b1; +} + +QScrollBar::add-line:horizontal +{ + background-color: white; + width: 0px; + subcontrol-position: right; + subcontrol-origin: margin; +} + +QScrollBar::sub-line:horizontal +{ + background-color: white; + width: 0px; + subcontrol-position: left; + subcontrol-origin: margin; +} + +QScrollBar:QScrollBar::down-arrow:horizontal +{ + width: 10; + height: 10px; + background-color: white; +} + +QScrollBar:QScrollBar::up-arrow:horizontal +{ + width: 10px; + height: 10px; + background-color: white; +} + +QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal +{ + background: none; +} + +QRadioButton +{ + background: #201f1f; + color: #c3c3c3; +} + +QPushButton +{ + background: #323030; + color: #c3c3c3; +} diff --git a/themes/dark/settings/mainHead.css b/themes/dark/settings/mainHead.css new file mode 100644 index 000000000..9f818366f --- /dev/null +++ b/themes/dark/settings/mainHead.css @@ -0,0 +1,5 @@ +QWidget .QLabel, QWidget .QLineEdit +{ + color: #c3c3c3; + background: #201f1f; +} diff --git a/themes/dark/statusButton/menu_indicator.svg b/themes/dark/statusButton/menu_indicator.svg new file mode 100644 index 000000000..36d6c3cd7 --- /dev/null +++ b/themes/dark/statusButton/menu_indicator.svg @@ -0,0 +1,23 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/themes/dark/statusButton/statusButton.css b/themes/dark/statusButton/statusButton.css new file mode 100644 index 000000000..515153bad --- /dev/null +++ b/themes/dark/statusButton/statusButton.css @@ -0,0 +1,41 @@ +QPushButton +{ + background: none; + background-color: @themeMediumDark; + border: none; + border-radius: 6px; + width: 20px; + height: 40px; +} + +QPushButton:default +{ + background-color: @themeMediumDark; +} + +/*Bugged in Qt, but it's probably better to leave enabled so that users can tell it's clickable*/ +QPushButton:hover +{ + background-color: @themeMedium; +} + +QPushButton:pressed +{ + background-color: @themeMediumDark; +} + +QPushButton:focus +{ + outline: none; +} + +QPushButton::menu-indicator {image: none;} + +QPushButton::menu-indicator:pressed, QPushButton::menu-indicator:open +{ + image: url("@getImagePath(statusButton/menu_indicator.svg)"); + subcontrol-origin: padding; + subcontrol-position: bottom center; + position: relative; + bottom: 2px; +} diff --git a/themes/dark/tooliconsZone/tooliconsZone.css b/themes/dark/tooliconsZone/tooliconsZone.css new file mode 100644 index 000000000..24c1d8b4a --- /dev/null +++ b/themes/dark/tooliconsZone/tooliconsZone.css @@ -0,0 +1,35 @@ +QPushButton[update-available=true] +{ + background-color: #115508; + border: none; +} + +QPushButton:hover[update-available=true] +{ + background-color: #2b9e1c; + border: none; +} + +QPushButton +{ + background-color: @themeDark; + border: none; +} + +QPushButton:hover +{ + background-color: @themeMediumDark; + border: none; +} + +QPushButton:checked +{ + background-color: @themeMedium; + border: none; +} + +QPushButton:pressed +{ + background-color: @themeMediumLight; + border: none; +} diff --git a/themes/dark/window/general.css b/themes/dark/window/general.css new file mode 100644 index 000000000..0d4653ecb --- /dev/null +++ b/themes/dark/window/general.css @@ -0,0 +1,13 @@ +QToolTip +{ + /* explicit border width is required https://bugreports.qt.io/browse/QTBUG-41313 */ + border: 0px; + color: black; + background: #ffffdc; +} + +QWidget#contentWidget +{ + background: #201f1f; +} + diff --git a/themes/dark/window/profile.css b/themes/dark/window/profile.css new file mode 100644 index 000000000..daddea876 --- /dev/null +++ b/themes/dark/window/profile.css @@ -0,0 +1,5 @@ +#selfAvatar:hover +{ + border-radius: 6px; + background-color: #ccc; +} diff --git a/themes/dark/window/statusPanel.css b/themes/dark/window/statusPanel.css new file mode 100644 index 000000000..f0bab5f38 --- /dev/null +++ b/themes/dark/window/statusPanel.css @@ -0,0 +1,127 @@ +QLineEdit +{ + background: none; + background-color: @themeMedium; + color: white; + border: 0px; + border-radius: 4px; +} + +QToolButton +{ + background: none; + background-color: @themeMedium; + color: white; + border-style: none; + border-radius: 4px; +} + +QToolButton:pressed +{ + background-color: @themeMediumDark; + border-radius: 4px; + color: white; +} + +QToolButton::menu-indicator +{ + image: none +} + +QPushButton#green +{ + background: none; + background-color: #6bc260; + color: white; + border-style: none; + border-radius: 4px; + padding: 4px; + margin: 4px 8px; +} + +QPushButton#green:hover +{ + background-color: #79c76f; +} + +QPushButton#green:pressed +{ + background-color: #51b244; +} + +/** + Uncomment this after https://github.com/qTox/qTox/pull/1640 + is merged! +QComboBox:down-arrow +{ + image: url(ui/css/down_arrow.png); +} +**/ + +QListView +{ + background-color: @themeLight; + border-style: none; + border-radius: 4px; +} + +#statusPanel +{ + background-color: @themeDark; +} + +#statusPanel > #statusHead +{ + background-color: @themeDark; +} + +#statusPanel > #statusHead > #nameLabel +{ + background-color: @themeDark; + font: @extraBig; + color: @white; +} + +#statusPanel > #statusHead > #statusLabel +{ + background-color: @themeDark; + font: @medium; + color: @lightGrey; +} + +#statusPanel > #statusHead > #statusButton +{ + background: none; + background-color: @themeMedium; + border: none; + border-radius: 6px; + width: 20px; + height: 40px; +} + +/*Bugged in Qt, but it's probably better to leave enabled so that users can tell it's clickable*/ +#statusPanel > #statusHead > #statusButton:hover +{ + background-color: @themeLight; +} + +#statusPanel > #statusHead > #statusButton:pressed +{ + background-color: @themeMedium; +} + +#statusPanel > #statusHead > #statusButton:focus +{ + outline: none; +} + +#statusPanel > #statusHead > #statusButton::menu-indicator {image: none;} + +#statusPanel > #statusHead > #statusButton::menu-indicator:pressed, #statusPanel > #statusHead > #statusButton::menu-indicator:open +{ + image: url("@getImagePath(statusButton/menu_indicator.svg)"); + subcontrol-origin: padding; + subcontrol-position: bottom center; + position: relative; + bottom: 2px; +} diff --git a/themes/dark/window/window.css b/themes/dark/window/window.css new file mode 100644 index 000000000..c56387d25 --- /dev/null +++ b/themes/dark/window/window.css @@ -0,0 +1,72 @@ +Widget#activeWindow +{ + background-color: #DFDFDF; + border: 2px solid #ABABAB; +} + +Widget#inactiveWindow +{ + background-color: #f4f4f4; + border: 2px solid #ABABAB; +} +/* +Widget#titleBar +{ + border: 10px solid #ABABAB; + border-top: 0px solid transparent; + background-color: #DFDFDF; +} + +Widget#titleBarInactive +{ + border: 5px solid #ABABAB; + border-top: 0px solid transparent; + background-color: #F1F1F1; +}*/ + +QToolButton#tbMenu +{ + border: 0px solid transparent; + background-color: transparent; +} + + +QPushButton#minimizeButton +{ + border: 0px solid transparent; + background-color: transparent; + image: url("@getImagePath(window/minimizeButton.png)"); +} +QPushButton#minimizeButton:hover {image: url("@getImagePath(window/minimizeButtonHover.png)");} +QPushButton#minimizeButton:pressed {image: url("@getImagePath(window/minimizeButtonPressed.png)");} +QPushButton#minimizeButton:focus {outline: none;} + +QPushButton#maximizeButton +{ + border: 0px solid transparent; + background-color: transparent; + image: url("@getImagePath(window/maximizeButton.png"); +} +QPushButton#maximizeButton:hover {image: url("@getImagePath(window/maximizeButtonHover.png)");} +QPushButton#maximizeButton:pressed {image: url("@getImagePath(window/maximizeButtonPressed.png)");} +QPushButton#maximizeButton:focus {outline: none;} + +QPushButton#closeButton +{ + border: 0px solid transparent; + background-color: transparent; + image: url("@getImagePath(window/closeButton.png"); +} +QPushButton#closeButton:hover {image: url("@getImagePath(window/closeButtonHover.png)");} +QPushButton#closeButton:pressed {image: url("@getImagePath(window/closeButtonPressed.png)");} +QPushButton#closeButton:focus {outline: none;} + +QPushButton#restoreButton +{ + border: 0px solid transparent; + background-color: transparent; + image: url("@getImagePath(window/restoreButton.png)"); +} +QPushButton#restoreButton:hover {image: url("@getImagePath(window/restoreButtonHover.png)");} +QPushButton#restoreButton:pressed {image: url("@getImagePath(window/restoreButtonPressed.png)");} +QPushButton#restoreButton:focus {outline: none;} diff --git a/themes/default/genericChatForm/genericChatForm.css b/themes/default/genericChatForm/genericChatForm.css new file mode 100644 index 000000000..b0b454c8d --- /dev/null +++ b/themes/default/genericChatForm/genericChatForm.css @@ -0,0 +1,4 @@ +QWidget +{ + background: white; +} From 5bc27b08bc774db37ad84d8f9563821f2f5dee18 Mon Sep 17 00:00:00 2001 From: TriKriSta Date: Wed, 20 Feb 2019 15:42:53 +0200 Subject: [PATCH 2/8] refactor: move palette colors in ini files --- res.qrc | 4 +- src/chatlog/chatlog.cpp | 3 +- src/chatlog/chatmessage.cpp | 7 +-- src/chatlog/content/text.cpp | 2 - src/chatlog/content/text.h | 4 +- src/widget/style.cpp | 70 ++++++++++++++++---------- src/widget/style.h | 3 ++ themes/dark/chatArea/innerStyle.css | 2 +- themes/dark/palette.ini | 16 ++++++ themes/default/chatArea/innerStyle.css | 2 +- themes/default/palette.ini | 16 ++++++ 11 files changed, 89 insertions(+), 40 deletions(-) create mode 100644 themes/dark/palette.ini create mode 100644 themes/default/palette.ini diff --git a/res.qrc b/res.qrc index 55df2abba..302d8727d 100644 --- a/res.qrc +++ b/res.qrc @@ -44,6 +44,7 @@ img/taskbar/light/taskbar_offline.svg img/taskbar/light/taskbar_event.svg img/transfer.svg + themes/dark/palette.ini themes/dark/fileTransferWidget/fileDone.svg themes/dark/centralWidget/centralWidget.css themes/dark/chatArea/chatArea.css @@ -108,7 +109,8 @@ themes/dark/loginScreen/loginScreen.css themes/dark/contentDialog/contentDialog.css themes/dark/tooliconsZone/tooliconsZone.css - themes/default/fileTransferWidget/fileDone.svg + themes/default/palette.ini + themes/default/fileTransferWidget/fileDone.svg themes/default/centralWidget/centralWidget.css themes/default/chatArea/chatArea.css themes/default/chatArea/chatHead.css diff --git a/src/chatlog/chatlog.cpp b/src/chatlog/chatlog.cpp index c999e8d71..888424a11 100644 --- a/src/chatlog/chatlog.cpp +++ b/src/chatlog/chatlog.cpp @@ -66,8 +66,7 @@ ChatLog::ChatLog(QWidget* parent) setDragMode(QGraphicsView::NoDrag); setViewportUpdateMode(MinimalViewportUpdate); setContextMenuPolicy(Qt::CustomContextMenu); -// setBackgroundBrush(QBrush(Qt::white, Qt::SolidPattern)); // NOTE: default - setBackgroundBrush(QBrush(Style::getColor(Style::White), Qt::SolidPattern)); // NOTE: dark + setBackgroundBrush(QBrush(Style::getColor(Style::White), Qt::SolidPattern)); // The selection rect for multi-line selection selGraphItem = scene->addRect(0, 0, 0, 0, selectionRectColor.darker(120), selectionRectColor); diff --git a/src/chatlog/chatmessage.cpp b/src/chatlog/chatmessage.cpp index 8f5eb2216..125c8ceec 100644 --- a/src/chatlog/chatmessage.cpp +++ b/src/chatlog/chatmessage.cpp @@ -50,9 +50,7 @@ ChatMessage::Ptr ChatMessage::createChatMessage(const QString& sender, const QSt QString text = rawMessage.toHtmlEscaped(); QString senderText = sender; - const QColor actionColor = -// QColor("#1818FF"); // has to match the color in innerStyle.css (div.action) // NOTE: Default - QColor("#546eff"); // NOTE: Dark + const QColor actionColor = Style::getColor(Style::Action); // smileys if (Settings::getInstance().getUseEmoticons()) @@ -89,8 +87,7 @@ ChatMessage::Ptr ChatMessage::createChatMessage(const QString& sender, const QSt if (isMe) authorFont.setBold(true); -// QColor color = QColor(0, 0, 0); // NOTE: Default - QColor color = QColor("#c3c3c3"); // NOTE: Dark + QColor color = Style::getColor(Style::Black); QColor authorColor; if (colorizeName && Settings::getInstance().getEnableGroupChatsColor()) diff --git a/src/chatlog/content/text.cpp b/src/chatlog/content/text.cpp index c5309bdeb..0dd717156 100644 --- a/src/chatlog/content/text.cpp +++ b/src/chatlog/content/text.cpp @@ -31,8 +31,6 @@ #include #include -#include "src/widget/style.h" - static const QString COLOR_HIGHLIGHT = QStringLiteral("#ff7626"); Text::Text(const QString& txt, const QFont& font, bool enableElide, const QString& rwText, diff --git a/src/chatlog/content/text.h b/src/chatlog/content/text.h index 9bdb491e1..aba23d4ba 100644 --- a/src/chatlog/content/text.h +++ b/src/chatlog/content/text.h @@ -21,6 +21,7 @@ #define TEXT_H #include "../chatlinecontent.h" +#include "src/widget/style.h" #include @@ -32,8 +33,7 @@ class Text : public ChatLineContent public: Text(const QString& txt = "", const QFont& font = QFont(), bool enableElide = false, -// const QString& rawText = QString(), const QColor c = Qt::black); // NOTE: Default - const QString& rawText = QString(), const QColor c = QColor("#c3c3c3")); // NOTE: Dark + const QString& rawText = QString(), const QColor c = Style::getColor(Style::Black)); virtual ~Text(); void setText(const QString& txt); diff --git a/src/widget/style.cpp b/src/widget/style.cpp index a87093b09..38f16f77c 100644 --- a/src/widget/style.cpp +++ b/src/widget/style.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -81,25 +82,7 @@ QString qssifyFont(QFont font) return QString("%1 %2px \"%3\"").arg(font.weight() * 8).arg(font.pixelSize()).arg(font.family()); } -// colors as defined in -// https://github.com/ItsDuke/Tox-UI/blob/master/UI%20GUIDELINES.md -//static QColor palette[] = { // NOTE: Default -// QColor("#6bc260"), QColor("#cebf44"), QColor("#c84e4e"), QColor("#000000"), QColor("#1c1c1c"), -// QColor("#414141"), QColor("#414141").lighter(120), QColor("#d1d1d1"), QColor("#ffffff"), -// QColor("#ff7700"), - -// // Theme colors -// QColor("#1c1c1c"), QColor("#2a2a2a"), QColor("#414141"), QColor("#4e4e4e"), -//}; - -static QColor palette[] = { // NOTE: Dark - QColor("#6bc260"), QColor("#cebf44"), QColor("#c84e4e"), QColor("#000000"), QColor("#c3c3c3"), - QColor("#d1d1d1"), QColor("#100f0f").lighter(120), QColor("#d1d1d1"), QColor("#201f1f"), - QColor("#ff7700"), - - // Theme colors - QColor("#1c1c1c"), QColor("#2a2a2a"), QColor("#100f0f"), QColor("#201f1f"), -}; +static QMap palette; static QMap dict; @@ -134,6 +117,22 @@ QString Style::getThemeFolder() QList Style::themeColorColors = {QColor(), QColor("#004aa4"), QColor("#97ba00"), QColor("#c23716"), QColor("#4617b5")}; +QMap Style::aliasColors = {{Green, "green"}, + {Yellow, "yellow"}, + {Red, "red"}, + {Black,"black"}, + {DarkGrey, "darkGrey"}, + {MediumGrey,"mediumGrey"}, + {MediumGreyLight, "mediumGreyLight"}, + {LightGrey, "lightGrey"}, + {White, "white"}, + {Orange, "orange"}, + {ThemeDark, "themeDark"}, + {ThemeMediumDark, "themeMediumDark"}, + {ThemeMedium, "themeMedium"}, + {ThemeLight, "themeLight"}, + {Action, "action"}}; + // stylesheet filename, font -> stylesheet // QString implicit sharing deduplicates stylesheets rather than constructing a new one each time std::map, const QString> Style::stylesheetsCache; @@ -230,12 +229,16 @@ const QString Style::resolve(const QString& filename, const QFont& baseFont) } } + if (palette.isEmpty()) { + initPalette(); + } + if (dict.isEmpty()) { dict = {// colors {"@green", Style::getColor(Style::Green).name()}, {"@yellow", Style::getColor(Style::Yellow).name()}, {"@red", Style::getColor(Style::Red).name()}, - {"@black", Style::getColor(Style::Black).name()}, + {"@black", Style::getColor(Style::Black).name()}, // NOTE: (Dark) rename to textColor {"@darkGrey", Style::getColor(Style::DarkGrey).name()}, {"@mediumGrey", Style::getColor(Style::MediumGrey).name()}, {"@mediumGreyLight", Style::getColor(Style::MediumGreyLight).name()}, @@ -246,6 +249,7 @@ const QString Style::resolve(const QString& filename, const QFont& baseFont) {"@themeMediumDark", Style::getColor(Style::ThemeMediumDark).name()}, {"@themeMedium", Style::getColor(Style::ThemeMedium).name()}, {"@themeLight", Style::getColor(Style::ThemeLight).name()}, + {"@action", Style::getColor(Style::Action).name()}, // fonts {"@baseFont", @@ -325,12 +329,10 @@ void Style::setThemeColor(const QColor& color) { if (!color.isValid()) { // Reset to default - palette[ThemeDark] = QColor("#1c1c1c"); - palette[ThemeMediumDark] = QColor("#2a2a2a"); -// palette[ThemeMedium] = QColor("#414141"); // NOTE: Default - palette[ThemeMedium] = QColor("#100f0f"); // NOTE: Dark -// palette[ThemeLight] = QColor("#4e4e4e"); // MOTE: Default - palette[ThemeLight] = QColor("#201f1f"); // MOTE: Dark + palette[ThemeDark] = getColor(ThemeDark); + palette[ThemeMediumDark] = getColor(ThemeMediumDark); + palette[ThemeMedium] = getColor(ThemeMedium); + palette[ThemeLight] = getColor(ThemeLight); } else { palette[ThemeDark] = color.darker(155); palette[ThemeMediumDark] = color.darker(135); @@ -361,3 +363,19 @@ QPixmap Style::scaleSvgImage(const QString& path, uint32_t width, uint32_t heigh render.render(&painter, pixmap.rect()); return pixmap; } + +void Style::initPalette() +{ + QSettings settings(BuiltinThemePath % "palette.ini", QSettings::IniFormat); + + auto keys = aliasColors.keys(); + + settings.beginGroup("colors"); + + for (auto k : keys) { + palette[k] = QColor(settings.value(aliasColors[k], "#000").toString()); + } + + settings.endGroup(); + +} diff --git a/src/widget/style.h b/src/widget/style.h index b7d43b653..23da6d27e 100644 --- a/src/widget/style.h +++ b/src/widget/style.h @@ -45,6 +45,7 @@ public: ThemeMediumDark, ThemeMedium, ThemeLight, + Action }; enum Font @@ -71,6 +72,7 @@ public: static void setThemeColor(const QColor& color); static void applyTheme(); static QPixmap scaleSvgImage(const QString& path, uint32_t width, uint32_t height); + static void initPalette(); signals: void themeChanged(); @@ -81,6 +83,7 @@ private: private: static QList themeColorColors; static std::map, const QString> stylesheetsCache; + static QMap aliasColors; }; #endif // STYLE_H diff --git a/themes/dark/chatArea/innerStyle.css b/themes/dark/chatArea/innerStyle.css index fcb5b5486..55a94c24e 100644 --- a/themes/dark/chatArea/innerStyle.css +++ b/themes/dark/chatArea/innerStyle.css @@ -7,7 +7,7 @@ p { } .action { - color: #546eff; + color: @action; font-style: italic; font-weight: bold; } diff --git a/themes/dark/palette.ini b/themes/dark/palette.ini new file mode 100644 index 000000000..6ef7fbc61 --- /dev/null +++ b/themes/dark/palette.ini @@ -0,0 +1,16 @@ +[colors] +green="#6bc260" +yellow="#cebf44" +red="#c84e4e" +black="#c3c3c3" +darkGrey="#c3c3c3" +mediumGrey="#d1d1d1" +mediumGreyLight="#131212" +lightGrey="#d1d1d1" +white="#201f1f" +orange="#ff7700" +themeDark="#1c1c1c" +themeMediumDark="#2a2a2a" +themeMedium="#100f0f" +themeLight="#201f1f" +action="#546eff" \ No newline at end of file diff --git a/themes/default/chatArea/innerStyle.css b/themes/default/chatArea/innerStyle.css index bc1ef8f92..03bab638c 100644 --- a/themes/default/chatArea/innerStyle.css +++ b/themes/default/chatArea/innerStyle.css @@ -7,7 +7,7 @@ p { } .action { - color: #1818FF; + color: @action; font-style: italic; } diff --git a/themes/default/palette.ini b/themes/default/palette.ini new file mode 100644 index 000000000..adbd063d7 --- /dev/null +++ b/themes/default/palette.ini @@ -0,0 +1,16 @@ +[colors] +green="#6bc260" +yellow="#cebf44" +red="#c84e4e" +black="#000000" +darkGrey="#1c1c1c" +mediumGrey="#414141" +mediumGreyLight="#4e4e4e" +lightGrey="#d1d1d1" +white="#ffffff" +orange="#ff7700" +themeDark="#1c1c1c" +themeMediumDark="#2a2a2a" +themeMedium="#414141" +themeLight="#4e4e4e" +action="#1818FF" \ No newline at end of file From e146c11f0fbe52e91dda2267a54f83943768d410 Mon Sep 17 00:00:00 2001 From: TriKriSta Date: Thu, 21 Feb 2019 15:53:31 +0200 Subject: [PATCH 3/8] feat: edit reload themes --- src/chatlog/chatline.cpp | 7 ++ src/chatlog/chatline.h | 1 + src/chatlog/chatlinecontent.cpp | 4 + src/chatlog/chatlinecontent.h | 1 + src/chatlog/chatlog.cpp | 9 ++ src/chatlog/chatlog.h | 1 + src/chatlog/chatmessage.cpp | 19 ++-- src/chatlog/content/text.cpp | 28 +++++- src/chatlog/content/text.h | 15 ++- src/widget/chatformheader.cpp | 8 ++ src/widget/chatformheader.h | 2 + src/widget/contentlayout.cpp | 13 ++- src/widget/contentlayout.h | 1 + src/widget/form/genericchatform.cpp | 27 ++++-- src/widget/form/genericchatform.h | 1 + src/widget/form/searchsettingsform.cpp | 9 +- src/widget/form/searchsettingsform.h | 1 + src/widget/searchform.cpp | 11 +++ src/widget/searchform.h | 1 + src/widget/style.cpp | 121 ++++++++++++++++--------- src/widget/style.h | 2 + src/widget/widget.cpp | 25 +++-- 22 files changed, 224 insertions(+), 83 deletions(-) diff --git a/src/chatlog/chatline.cpp b/src/chatlog/chatline.cpp index aebfa79cd..caded2169 100644 --- a/src/chatlog/chatline.cpp +++ b/src/chatlog/chatline.cpp @@ -119,6 +119,13 @@ void ChatLine::fontChanged(const QFont& font) c->fontChanged(font); } +void ChatLine::reloadTheme() +{ + for (ChatLineContent* c : content) { + c->reloadTheme(); + } +} + int ChatLine::getColumnCount() { return content.size(); diff --git a/src/chatlog/chatline.h b/src/chatlog/chatline.h index 3e32590e6..b9832d716 100644 --- a/src/chatlog/chatline.h +++ b/src/chatlog/chatline.h @@ -82,6 +82,7 @@ public: void selectionCleared(); void selectionFocusChanged(bool focusIn); void fontChanged(const QFont& font); + void reloadTheme(); int getColumnCount(); int getRow() const; diff --git a/src/chatlog/chatlinecontent.cpp b/src/chatlog/chatlinecontent.cpp index b4cd2592f..82f61d6e4 100644 --- a/src/chatlog/chatlinecontent.cpp +++ b/src/chatlog/chatlinecontent.cpp @@ -88,6 +88,10 @@ void ChatLineContent::visibilityChanged(bool) { } +void ChatLineContent::reloadTheme() +{ +} + QString ChatLineContent::getText() const { return QString(); diff --git a/src/chatlog/chatlinecontent.h b/src/chatlog/chatlinecontent.h index 39af04274..d58bbeb35 100644 --- a/src/chatlog/chatlinecontent.h +++ b/src/chatlog/chatlinecontent.h @@ -59,6 +59,7 @@ public: virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) = 0; virtual void visibilityChanged(bool visible); + virtual void reloadTheme(); private: friend class ChatLine; diff --git a/src/chatlog/chatlog.cpp b/src/chatlog/chatlog.cpp index 888424a11..a4180645b 100644 --- a/src/chatlog/chatlog.cpp +++ b/src/chatlog/chatlog.cpp @@ -660,6 +660,15 @@ void ChatLog::fontChanged(const QFont& font) } } +void ChatLog::reloadTheme() +{ + setBackgroundBrush(QBrush(Style::getColor(Style::White), Qt::SolidPattern)); + + for (ChatLine::Ptr l : lines) { + l->reloadTheme(); + } +} + void ChatLog::forceRelayout() { startResizeWorker(); diff --git a/src/chatlog/chatlog.h b/src/chatlog/chatlog.h index 9ac12806f..f0533ad0d 100644 --- a/src/chatlog/chatlog.h +++ b/src/chatlog/chatlog.h @@ -53,6 +53,7 @@ public: void scrollToLine(ChatLine::Ptr line); void selectAll(); void fontChanged(const QFont& font); + void reloadTheme(); QString getSelectedText() const; diff --git a/src/chatlog/chatmessage.cpp b/src/chatlog/chatmessage.cpp index 125c8ceec..4a4de016b 100644 --- a/src/chatlog/chatmessage.cpp +++ b/src/chatlog/chatmessage.cpp @@ -50,8 +50,7 @@ ChatMessage::Ptr ChatMessage::createChatMessage(const QString& sender, const QSt QString text = rawMessage.toHtmlEscaped(); QString senderText = sender; - const QColor actionColor = Style::getColor(Style::Action); - + auto textType = Text::NORMAL; // smileys if (Settings::getInstance().getUseEmoticons()) text = SmileyPack::getInstance().smileyfied(text); @@ -72,6 +71,7 @@ ChatMessage::Ptr ChatMessage::createChatMessage(const QString& sender, const QSt text = wrapDiv(text, "msg"); break; case ACTION: + textType = Text::ACTION; senderText = "*"; text = wrapDiv(QString("%1 %2").arg(sender.toHtmlEscaped(), text), "action"); msg->setAsAction(); @@ -88,23 +88,18 @@ ChatMessage::Ptr ChatMessage::createChatMessage(const QString& sender, const QSt authorFont.setBold(true); QColor color = Style::getColor(Style::Black); - QColor authorColor; - - if (colorizeName && Settings::getInstance().getEnableGroupChatsColor()) - { + if (colorizeName && Settings::getInstance().getEnableGroupChatsColor()) { QByteArray hash = QCryptographicHash::hash((sender.toUtf8()), QCryptographicHash::Sha256); quint8 *data = (quint8*)hash.data(); - authorColor.setHsv(data[0], 255, 196); + color.setHsv(data[0], 255, 196); - if (!isMe) - { - color = authorColor; + if (!isMe && textType == Text::NORMAL) { + textType = Text::CUSTOM; } } - msg->addColumn(new Text(senderText, authorFont, true, sender, - type == ACTION ? actionColor : color), + msg->addColumn(new Text(senderText, authorFont, true, sender, textType, color), ColumnFormat(NAME_COL_WIDTH, ColumnFormat::FixedSize, ColumnFormat::Right)); msg->addColumn(new Text(text, baseFont, false, ((type == ACTION) && isMe) ? QString("%1 %2").arg(sender, rawMessage) diff --git a/src/chatlog/content/text.cpp b/src/chatlog/content/text.cpp index 0dd717156..7d2f73862 100644 --- a/src/chatlog/content/text.cpp +++ b/src/chatlog/content/text.cpp @@ -34,14 +34,15 @@ static const QString COLOR_HIGHLIGHT = QStringLiteral("#ff7626"); Text::Text(const QString& txt, const QFont& font, bool enableElide, const QString& rwText, - const QColor c) + const TextType& type, const QColor& custom) : rawText(rwText) , elide(enableElide) , defFont(font) , defStyleSheet(Style::getStylesheet(QStringLiteral("chatArea/innerStyle.css"), font)) - , color(c) + , textType(type) + , customColor(custom) { - QString ct = c.name(); + color = textColor(); setText(txt); setAcceptedMouseButtons(Qt::LeftButton); setAcceptHoverEvents(true); @@ -247,6 +248,15 @@ void Text::visibilityChanged(bool visible) update(); } +void Text::reloadTheme() +{ + defStyleSheet = Style::getStylesheet(QStringLiteral("chatArea/innerStyle.css"), defFont); + color = textColor(); + dirty = true; + regenerate(); + update(); +} + qreal Text::getAscent() const { return ascent; @@ -458,3 +468,15 @@ void Text::selectText(QTextCursor& cursor, const std::pair& point) update(); } } + +QColor Text::textColor() const +{ + QColor c = Style::getColor(Style::Black); + if (textType == ACTION) { + c = Style::getColor(Style::Action); + } else if (textType == CUSTOM) { + c = customColor; + } + + return c; +} diff --git a/src/chatlog/content/text.h b/src/chatlog/content/text.h index aba23d4ba..b3f26533d 100644 --- a/src/chatlog/content/text.h +++ b/src/chatlog/content/text.h @@ -32,8 +32,15 @@ class Text : public ChatLineContent Q_OBJECT public: + enum TextType + { + NORMAL, + ACTION, + CUSTOM + }; + Text(const QString& txt = "", const QFont& font = QFont(), bool enableElide = false, - const QString& rawText = QString(), const QColor c = Style::getColor(Style::Black)); + const QString& rawText = QString(), const TextType& type = NORMAL, const QColor& custom = Style::getColor(Style::Black)); virtual ~Text(); void setText(const QString& txt); @@ -57,11 +64,12 @@ public: virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) final; virtual void visibilityChanged(bool keepInMemory) final; + virtual void reloadTheme() final override; virtual qreal getAscent() const final; virtual void mousePressEvent(QGraphicsSceneMouseEvent* event) final override; virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent* event) final override; - void hoverMoveEvent(QGraphicsSceneHoverEvent* event) final override; + void hoverMoveEvent(QGraphicsSceneHoverEvent* event) final override; virtual QString getText() const final; QString getLinkAt(QPointF scenePos) const; @@ -85,6 +93,7 @@ protected: private: void selectText(QTextCursor& cursor, const std::pair& point); + QColor textColor() const; QString text; QString rawText; @@ -98,7 +107,9 @@ private: qreal ascent = 0.0; QFont defFont; QString defStyleSheet; + TextType textType; QColor color; + QColor customColor; }; #endif // TEXT_H diff --git a/src/widget/chatformheader.cpp b/src/widget/chatformheader.cpp index 82ada779d..e03e4892b 100644 --- a/src/widget/chatformheader.cpp +++ b/src/widget/chatformheader.cpp @@ -281,6 +281,14 @@ QSize ChatFormHeader::getAvatarSize() const return QSize{avatar->width(), avatar->height()}; } +void ChatFormHeader::reloadTheme() +{ + callButton->setStyleSheet(Style::getStylesheet(STYLE_PATH)); + videoButton->setStyleSheet(Style::getStylesheet(STYLE_PATH)); + volButton->setStyleSheet(Style::getStylesheet(STYLE_PATH)); + micButton->setStyleSheet(Style::getStylesheet(STYLE_PATH)); +} + void ChatFormHeader::addWidget(QWidget* widget, int stretch, Qt::Alignment alignment) { headTextLayout->addWidget(widget, stretch, alignment); diff --git a/src/widget/chatformheader.h b/src/widget/chatformheader.h index bc1b89907..7121fcda2 100644 --- a/src/widget/chatformheader.h +++ b/src/widget/chatformheader.h @@ -72,6 +72,8 @@ public: void setAvatar(const QPixmap& img); QSize getAvatarSize() const; + void reloadTheme(); + // TODO: Remove void addWidget(QWidget* widget, int stretch = 0, Qt::Alignment alignment = Qt::Alignment()); void addLayout(QLayout* layout); diff --git a/src/widget/contentlayout.cpp b/src/widget/contentlayout.cpp index 4c3a0e259..29f932449 100644 --- a/src/widget/contentlayout.cpp +++ b/src/widget/contentlayout.cpp @@ -66,6 +66,14 @@ ContentLayout::~ContentLayout() mainContent->deleteLater(); } +void ContentLayout::reloadTheme() +{ +#ifndef Q_OS_MAC + mainHead->setStyleSheet(Style::getStylesheet("settings/mainHead.css")); + mainContent->setStyleSheet(Style::getStylesheet("settings/mainContent.css")); +#endif +} + void ContentLayout::clear() { QLayoutItem* item; @@ -110,10 +118,7 @@ void ContentLayout::init() mainContent->setStyle(QStyleFactory::create(Settings::getInstance().getStyle())); } -#ifndef Q_OS_MAC - mainHead->setStyleSheet(Style::getStylesheet("settings/mainHead.css")); - mainContent->setStyleSheet(Style::getStylesheet("settings/mainContent.css")); -#endif + reloadTheme(); mainHLineLayout.addWidget(&mainHLine); mainHLineLayout.addSpacing(5); diff --git a/src/widget/contentlayout.h b/src/widget/contentlayout.h index 6ab3e4d90..cc4d93712 100644 --- a/src/widget/contentlayout.h +++ b/src/widget/contentlayout.h @@ -30,6 +30,7 @@ public: explicit ContentLayout(QWidget* parent); ~ContentLayout(); + void reloadTheme(); void clear(); QFrame mainHLine; diff --git a/src/widget/form/genericchatform.cpp b/src/widget/form/genericchatform.cpp index a2c95f425..6591e853b 100644 --- a/src/widget/form/genericchatform.cpp +++ b/src/widget/form/genericchatform.cpp @@ -170,10 +170,6 @@ GenericChatForm::GenericChatForm(const Contact* contact, QWidget* parent) fileLayout->setSpacing(0); fileLayout->setMargin(0); - setStyleSheet(Style::getStylesheet("genericChatForm/genericChatForm.css")); - - msgEdit->setStyleSheet(Style::getStylesheet("msgEdit/msgEdit.css") - + fontToCss(s.getChatMessageFont(), "QTextEdit")); msgEdit->setFixedHeight(MESSAGE_EDIT_HEIGHT); msgEdit->setFrameStyle(QFrame::NoFrame); @@ -240,8 +236,7 @@ GenericChatForm::GenericChatForm(const Contact* contact, QWidget* parent) connect(chatWidget, &ChatLog::workerTimeoutFinished, this, &GenericChatForm::onContinueSearch); - chatWidget->setStyleSheet(Style::getStylesheet("chatArea/chatArea.css")); - headWidget->setStyleSheet(Style::getStylesheet("chatArea/chatHead.css")); + reloadTheme(); fileFlyout->setFixedSize(FILE_FLYOUT_SIZE); fileFlyout->setParent(this); @@ -295,6 +290,26 @@ QDate GenericChatForm::getFirstDate() const return getDate(chatWidget->getFirstLine()); } +void GenericChatForm::reloadTheme() +{ + const Settings& s = Settings::getInstance(); + setStyleSheet(Style::getStylesheet("genericChatForm/genericChatForm.css")); + + msgEdit->setStyleSheet(Style::getStylesheet("msgEdit/msgEdit.css") + + fontToCss(s.getChatMessageFont(), "QTextEdit")); + + chatWidget->setStyleSheet(Style::getStylesheet("chatArea/chatArea.css")); + headWidget->setStyleSheet(Style::getStylesheet("chatArea/chatHead.css")); + chatWidget->reloadTheme(); + headWidget->reloadTheme(); + searchForm->reloadTheme(); + + emoteButton->setStyleSheet(Style::getStylesheet(STYLE_PATH)); + fileButton->setStyleSheet(Style::getStylesheet(STYLE_PATH)); + screenshotButton->setStyleSheet(Style::getStylesheet(STYLE_PATH)); + sendButton->setStyleSheet(Style::getStylesheet(STYLE_PATH)); +} + void GenericChatForm::setName(const QString& newName) { headWidget->setName(newName); diff --git a/src/widget/form/genericchatform.h b/src/widget/form/genericchatform.h index ff04bb0d3..f97d365a4 100644 --- a/src/widget/form/genericchatform.h +++ b/src/widget/form/genericchatform.h @@ -83,6 +83,7 @@ public: static QString resolveToxPk(const ToxPk& pk); QDate getLatestDate() const; QDate getFirstDate() const; + void reloadTheme(); signals: void sendMessage(uint32_t, QString); diff --git a/src/widget/form/searchsettingsform.cpp b/src/widget/form/searchsettingsform.cpp index 4d993ad06..b55c26dde 100644 --- a/src/widget/form/searchsettingsform.cpp +++ b/src/widget/form/searchsettingsform.cpp @@ -15,9 +15,8 @@ SearchSettingsForm::SearchSettingsForm(QWidget *parent) : ui->choiceDateButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); ui->choiceDateButton->setObjectName(QStringLiteral("choiceDateButton")); - ui->choiceDateButton->setStyleSheet(Style::getStylesheet(QStringLiteral("chatForm/buttons.css"))); - ui->startDateLabel->setStyleSheet(Style::getStylesheet(QStringLiteral("chatForm/labels.css"))); + reloadTheme(); connect(ui->startSearchComboBox, static_cast(&QComboBox::currentIndexChanged), this, &SearchSettingsForm::onStartSearchSelected); @@ -75,6 +74,12 @@ ParameterSearch SearchSettingsForm::getParameterSearch() return ps; } +void SearchSettingsForm::reloadTheme() +{ + ui->choiceDateButton->setStyleSheet(Style::getStylesheet(QStringLiteral("chatForm/buttons.css"))); + ui->startDateLabel->setStyleSheet(Style::getStylesheet(QStringLiteral("chatForm/labels.css"))); +} + void SearchSettingsForm::updateStartDateLabel() { ui->startDateLabel->setText(startDate.toString(Settings::getInstance().getDateFormat())); diff --git a/src/widget/form/searchsettingsform.h b/src/widget/form/searchsettingsform.h index bf9c15d8c..624d6a597 100644 --- a/src/widget/form/searchsettingsform.h +++ b/src/widget/form/searchsettingsform.h @@ -17,6 +17,7 @@ public: ~SearchSettingsForm(); ParameterSearch getParameterSearch(); + void reloadTheme(); private: Ui::SearchSettingsForm *ui; diff --git a/src/widget/searchform.cpp b/src/widget/searchform.cpp index 6aca3f67e..74af10d62 100644 --- a/src/widget/searchform.cpp +++ b/src/widget/searchform.cpp @@ -118,6 +118,17 @@ void SearchForm::insertEditor(const QString &text) searchLine->insert(text); } +void SearchForm::reloadTheme() +{ + settingsButton->setStyleSheet(Style::getStylesheet(QStringLiteral("chatForm/buttons.css"))); + upButton->setStyleSheet(Style::getStylesheet(QStringLiteral("chatForm/buttons.css"))); + downButton->setStyleSheet(Style::getStylesheet(QStringLiteral("chatForm/buttons.css"))); + hideButton->setStyleSheet(Style::getStylesheet(QStringLiteral("chatForm/buttons.css"))); + startButton->setStyleSheet(Style::getStylesheet(QStringLiteral("chatForm/buttons.css"))); + + settings->reloadTheme(); +} + void SearchForm::showEvent(QShowEvent* event) { QWidget::showEvent(event); diff --git a/src/widget/searchform.h b/src/widget/searchform.h index 4adc4103c..def40567a 100644 --- a/src/widget/searchform.h +++ b/src/widget/searchform.h @@ -45,6 +45,7 @@ public: ParameterSearch getParameterSearch(); void setFocusEditor(); void insertEditor(const QString &text); + void reloadTheme(); protected: virtual void showEvent(QShowEvent* event) final override; diff --git a/src/widget/style.cpp b/src/widget/style.cpp index 38f16f77c..b87621b05 100644 --- a/src/widget/style.cpp +++ b/src/widget/style.cpp @@ -65,7 +65,8 @@ namespace { const QLatin1Literal ThemeSubFolder{"themes/"}; - const QLatin1Literal BuiltinThemePath{":themes/dark/"}; + const QLatin1Literal BuiltinThemeDefaultPath{":themes/default/"}; + const QLatin1Literal BuiltinThemeDarkPath{":themes/dark/"}; } // helper functions @@ -84,12 +85,15 @@ QString qssifyFont(QFont font) static QMap palette; -static QMap dict; +static QMap dictColor; +static QMap dictFont; +static QMap dictTheme; QStringList Style::getThemeColorNames() { return {QObject::tr("Default"), QObject::tr("Blue"), QObject::tr("Olive"), QObject::tr("Red"), - QObject::tr("Violet")}; + QObject::tr("Violet"), QObject::tr("Dark"), QObject::tr("Dark blue"), QObject::tr("Dark olive"), + QObject::tr("Dark red"), QObject::tr("Dark violet")}; } QString Style::getThemeName() @@ -108,14 +112,16 @@ QString Style::getThemeFolder() // No themes available, fallback to builtin if(fullPath.isEmpty()) { - return BuiltinThemePath; + return getThemePath(); } return fullPath % QDir::separator(); } QList Style::themeColorColors = {QColor(), QColor("#004aa4"), QColor("#97ba00"), - QColor("#c23716"), QColor("#4617b5")}; + QColor("#c23716"), QColor("#4617b5"), + QColor(), QColor("#00336d"), QColor("#4d5f00"), + QColor("#7a210d"), QColor("#280d6c")}; QMap Style::aliasColors = {{Green, "green"}, {Yellow, "yellow"}, @@ -170,7 +176,7 @@ const QString Style::getImagePath(const QString& filename) } else { qWarning() << "Failed to open file (using defaults):" << fullPath; - fullPath = BuiltinThemePath % filename; + fullPath = getThemePath() % filename; if (QFileInfo::exists(fullPath)) { return fullPath; @@ -218,7 +224,7 @@ const QString Style::resolve(const QString& filename, const QFont& baseFont) } else { qWarning() << "Failed to open file (using defaults):" << fullPath; - fullPath = BuiltinThemePath; + fullPath = getThemePath(); QFile file{fullPath}; if (file.open(QFile::ReadOnly | QFile::Text)) { @@ -233,38 +239,33 @@ const QString Style::resolve(const QString& filename, const QFont& baseFont) initPalette(); } - if (dict.isEmpty()) { - dict = {// colors - {"@green", Style::getColor(Style::Green).name()}, - {"@yellow", Style::getColor(Style::Yellow).name()}, - {"@red", Style::getColor(Style::Red).name()}, - {"@black", Style::getColor(Style::Black).name()}, // NOTE: (Dark) rename to textColor - {"@darkGrey", Style::getColor(Style::DarkGrey).name()}, - {"@mediumGrey", Style::getColor(Style::MediumGrey).name()}, - {"@mediumGreyLight", Style::getColor(Style::MediumGreyLight).name()}, - {"@lightGrey", Style::getColor(Style::LightGrey).name()}, - {"@white", Style::getColor(Style::White).name()}, - {"@orange", Style::getColor(Style::Orange).name()}, - {"@themeDark", Style::getColor(Style::ThemeDark).name()}, - {"@themeMediumDark", Style::getColor(Style::ThemeMediumDark).name()}, - {"@themeMedium", Style::getColor(Style::ThemeMedium).name()}, - {"@themeLight", Style::getColor(Style::ThemeLight).name()}, - {"@action", Style::getColor(Style::Action).name()}, - - // fonts - {"@baseFont", - QString::fromUtf8("'%1' %2px").arg(baseFont.family()).arg(QFontInfo(baseFont).pixelSize())}, - {"@extraBig", qssifyFont(Style::getFont(Style::ExtraBig))}, - {"@big", qssifyFont(Style::getFont(Style::Big))}, - {"@bigBold", qssifyFont(Style::getFont(Style::BigBold))}, - {"@medium", qssifyFont(Style::getFont(Style::Medium))}, - {"@mediumBold", qssifyFont(Style::getFont(Style::MediumBold))}, - {"@small", qssifyFont(Style::getFont(Style::Small))}, - {"@smallLight", qssifyFont(Style::getFont(Style::SmallLight))}}; + if (dictColor.isEmpty()) { + initDictColor(); } - for (const QString& key : dict.keys()) { - qss.replace(QRegularExpression(key % QLatin1Literal{"\\b"}), dict[key]); + if (dictFont.isEmpty()) { + dictFont = { + {"@baseFont", + QString::fromUtf8("'%1' %2px").arg(baseFont.family()).arg(QFontInfo(baseFont).pixelSize())}, + {"@extraBig", qssifyFont(Style::getFont(Style::ExtraBig))}, + {"@big", qssifyFont(Style::getFont(Style::Big))}, + {"@bigBold", qssifyFont(Style::getFont(Style::BigBold))}, + {"@medium", qssifyFont(Style::getFont(Style::Medium))}, + {"@mediumBold", qssifyFont(Style::getFont(Style::MediumBold))}, + {"@small", qssifyFont(Style::getFont(Style::Small))}, + {"@smallLight", qssifyFont(Style::getFont(Style::SmallLight))}}; + } + + for (const QString& key : dictColor.keys()) { + qss.replace(QRegularExpression(key % QLatin1Literal{"\\b"}), dictColor[key]); + } + + for (const QString& key : dictFont.keys()) { + qss.replace(QRegularExpression(key % QLatin1Literal{"\\b"}), dictFont[key]); + } + + for (const QString& key : dictTheme.keys()) { + qss.replace(QRegularExpression(key % QLatin1Literal{"\\b"}), dictTheme[key]); } // @getImagePath() function @@ -286,7 +287,7 @@ const QString Style::resolve(const QString& filename, const QFont& baseFont) existingImagesCache << fullImagePath; } else { qWarning() << "Failed to open file (using defaults):" << fullImagePath; - fullImagePath = BuiltinThemePath % path; + fullImagePath = getThemePath() % path; } } @@ -313,6 +314,10 @@ void Style::repolish(QWidget* w) void Style::setThemeColor(int color) { stylesheetsCache.clear(); // clear stylesheet cache which includes color info + palette.clear(); + dictColor.clear(); + initPalette(); + initDictColor(); if (color < 0 || color >= themeColorColors.size()) setThemeColor(QColor()); else @@ -340,10 +345,10 @@ void Style::setThemeColor(const QColor& color) palette[ThemeLight] = color.lighter(110); } - dict["@themeDark"] = getColor(ThemeDark).name(); - dict["@themeMediumDark"] = getColor(ThemeMediumDark).name(); - dict["@themeMedium"] = getColor(ThemeMedium).name(); - dict["@themeLight"] = getColor(ThemeLight).name(); + dictTheme["@themeDark"] = getColor(ThemeDark).name(); + dictTheme["@themeMediumDark"] = getColor(ThemeMediumDark).name(); + dictTheme["@themeMedium"] = getColor(ThemeMedium).name(); + dictTheme["@themeLight"] = getColor(ThemeLight).name(); } /** @@ -366,16 +371,42 @@ QPixmap Style::scaleSvgImage(const QString& path, uint32_t width, uint32_t heigh void Style::initPalette() { - QSettings settings(BuiltinThemePath % "palette.ini", QSettings::IniFormat); + QSettings settings(getThemePath() % "palette.ini", QSettings::IniFormat); auto keys = aliasColors.keys(); settings.beginGroup("colors"); - + QMap c; for (auto k : keys) { + c[k] = settings.value(aliasColors[k], "#000").toString(); palette[k] = QColor(settings.value(aliasColors[k], "#000").toString()); } - + auto p = palette; settings.endGroup(); } + +void Style::initDictColor() +{ + dictColor = { + {"@green", Style::getColor(Style::Green).name()}, + {"@yellow", Style::getColor(Style::Yellow).name()}, + {"@red", Style::getColor(Style::Red).name()}, + {"@black", Style::getColor(Style::Black).name()}, // NOTE: (Dark) rename to textColor + {"@darkGrey", Style::getColor(Style::DarkGrey).name()}, + {"@mediumGrey", Style::getColor(Style::MediumGrey).name()}, + {"@mediumGreyLight", Style::getColor(Style::MediumGreyLight).name()}, + {"@lightGrey", Style::getColor(Style::LightGrey).name()}, + {"@white", Style::getColor(Style::White).name()}, + {"@orange", Style::getColor(Style::Orange).name()}, + {"@action", Style::getColor(Style::Action).name()}}; +} + +QString Style::getThemePath() +{ + if (Settings::getInstance().getThemeColor() > 4) { + return BuiltinThemeDarkPath; + } + + return BuiltinThemeDefaultPath; +} diff --git a/src/widget/style.h b/src/widget/style.h index 23da6d27e..883de2564 100644 --- a/src/widget/style.h +++ b/src/widget/style.h @@ -73,6 +73,8 @@ public: static void applyTheme(); static QPixmap scaleSvgImage(const QString& path, uint32_t width, uint32_t height); static void initPalette(); + static void initDictColor(); + static QString getThemePath(); signals: void themeChanged(); diff --git a/src/widget/widget.cpp b/src/widget/widget.cpp index 96cc99e89..dc2c68a5e 100644 --- a/src/widget/widget.cpp +++ b/src/widget/widget.cpp @@ -150,14 +150,11 @@ void Widget::init() connect(actionQuit, &QAction::triggered, qApp, &QApplication::quit); layout()->setContentsMargins(0, 0, 0, 0); - ui->centralwidget->setStyleSheet(Style::getStylesheet(QStringLiteral("centralWidget/centralWidget.css"))); - ui->friendList->setStyleSheet(Style::getStylesheet("friendList/friendList.css")); profilePicture = new MaskablePixmapWidget(this, QSize(40, 40), ":/img/avatar_mask.svg"); profilePicture->setPixmap(QPixmap(":/img/contact_dark.svg")); profilePicture->setClickable(true); profilePicture->setObjectName("selfAvatar"); - profilePicture->setStyleSheet(Style::getStylesheet("window/profile.css")); ui->myProfile->insertWidget(0, profilePicture); ui->myProfile->insertSpacing(1, 7); @@ -200,10 +197,6 @@ void Widget::init() ui->searchContactFilterBox->setMenu(filterMenu); -#ifndef Q_OS_MAC - ui->statusHead->setStyleSheet(Style::getStylesheet("window/statusPanel.css")); -#endif - contactListWidget = new FriendListWidget(this, settings.getGroupchatPosition()); ui->friendList->setWidget(contactListWidget); ui->friendList->setLayoutDirection(Qt::RightToLeft); @@ -211,8 +204,6 @@ void Widget::init() ui->statusLabel->setEditable(true); - ui->statusPanel->setStyleSheet(Style::getStylesheet("window/statusPanel.css")); - QMenu* statusButtonMenu = new QMenu(ui->statusButton); statusButtonMenu->addAction(statusOnline); statusButtonMenu->addAction(statusAway); @@ -2176,6 +2167,7 @@ void Widget::reloadTheme() { this->setStyleSheet(Style::getStylesheet("window/general.css")); QString statusPanelStyle = Style::getStylesheet("window/statusPanel.css"); + ui->centralwidget->setStyleSheet(Style::getStylesheet(QStringLiteral("centralWidget/centralWidget.css"))); ui->tooliconsZone->setStyleSheet(Style::getStylesheet("tooliconsZone/tooliconsZone.css")); ui->statusPanel->setStyleSheet(statusPanelStyle); ui->statusHead->setStyleSheet(statusPanelStyle); @@ -2183,6 +2175,12 @@ void Widget::reloadTheme() ui->statusButton->setStyleSheet(Style::getStylesheet("statusButton/statusButton.css")); contactListWidget->reDraw(); + profilePicture->setStyleSheet(Style::getStylesheet("window/profile.css")); + + if (contentLayout != nullptr) { + contentLayout->reloadTheme(); + } + for (Friend* f : FriendList::getAllFriends()) { uint32_t friendId = f->getId(); friendWidgets[friendId]->reloadTheme(); @@ -2192,6 +2190,15 @@ void Widget::reloadTheme() uint32_t groupId = g->getId(); groupWidgets[groupId]->reloadTheme(); } + + + for (auto f : FriendList::getAllFriends()) { + chatForms[f->getId()]->reloadTheme(); + } + + for (auto g : GroupList::getAllGroups()) { + groupChatForms[g->getId()]->reloadTheme(); + } } void Widget::nextContact() From c6142e428719d881d6e714e6025b359b14461261 Mon Sep 17 00:00:00 2001 From: TriKriSta Date: Fri, 22 Feb 2019 18:01:43 +0200 Subject: [PATCH 4/8] refactor: rename palette colors --- src/chatlog/chatlog.cpp | 4 +- src/chatlog/chatmessage.cpp | 2 +- src/chatlog/content/filetransferwidget.cpp | 8 ++-- src/chatlog/content/text.cpp | 2 +- src/chatlog/content/text.h | 2 +- src/widget/genericchatroomwidget.cpp | 10 ++--- src/widget/style.cpp | 22 +++++------ src/widget/style.h | 11 +++--- themes/dark/centralWidget/centralWidget.css | 10 ++--- themes/dark/chatArea/chatArea.css | 2 +- themes/dark/chatArea/chatHead.css | 8 ++-- themes/dark/chatArea/innerStyle.css | 2 +- themes/dark/emoticonWidget/emoticonWidget.css | 2 +- .../filetransferWidget.css | 18 ++++----- themes/dark/friendList/friendList.css | 2 +- .../dark/genericChatForm/genericChatForm.css | 2 +- themes/dark/loginScreen/loginScreen.css | 6 +-- themes/dark/msgEdit/msgEdit.css | 4 +- themes/dark/palette.ini | 13 +++---- themes/dark/settings/mainContent.css | 38 +++++++++---------- themes/dark/settings/mainHead.css | 4 +- themes/dark/window/general.css | 2 +- themes/dark/window/statusPanel.css | 4 +- .../default/centralWidget/centralWidget.css | 10 ++--- themes/default/chatArea/chatHead.css | 8 ++-- themes/default/chatArea/innerStyle.css | 2 +- .../default/emoticonWidget/emoticonWidget.css | 2 +- .../filetransferWidget.css | 16 ++++---- themes/default/friendList/friendList.css | 4 +- themes/default/msgEdit/msgEdit.css | 2 +- themes/default/palette.ini | 13 +++---- themes/default/settings/mainContent.css | 2 +- themes/default/window/statusPanel.css | 4 +- 33 files changed, 118 insertions(+), 123 deletions(-) diff --git a/src/chatlog/chatlog.cpp b/src/chatlog/chatlog.cpp index a4180645b..14df1af95 100644 --- a/src/chatlog/chatlog.cpp +++ b/src/chatlog/chatlog.cpp @@ -66,7 +66,7 @@ ChatLog::ChatLog(QWidget* parent) setDragMode(QGraphicsView::NoDrag); setViewportUpdateMode(MinimalViewportUpdate); setContextMenuPolicy(Qt::CustomContextMenu); - setBackgroundBrush(QBrush(Style::getColor(Style::White), Qt::SolidPattern)); + setBackgroundBrush(QBrush(Style::getColor(Style::GroundBase), Qt::SolidPattern)); // The selection rect for multi-line selection selGraphItem = scene->addRect(0, 0, 0, 0, selectionRectColor.darker(120), selectionRectColor); @@ -662,7 +662,7 @@ void ChatLog::fontChanged(const QFont& font) void ChatLog::reloadTheme() { - setBackgroundBrush(QBrush(Style::getColor(Style::White), Qt::SolidPattern)); + setBackgroundBrush(QBrush(Style::getColor(Style::GroundBase), Qt::SolidPattern)); for (ChatLine::Ptr l : lines) { l->reloadTheme(); diff --git a/src/chatlog/chatmessage.cpp b/src/chatlog/chatmessage.cpp index 4a4de016b..247d768b7 100644 --- a/src/chatlog/chatmessage.cpp +++ b/src/chatlog/chatmessage.cpp @@ -87,7 +87,7 @@ ChatMessage::Ptr ChatMessage::createChatMessage(const QString& sender, const QSt if (isMe) authorFont.setBold(true); - QColor color = Style::getColor(Style::Black); + QColor color = Style::getColor(Style::MainText); if (colorizeName && Settings::getInstance().getEnableGroupChatsColor()) { QByteArray hash = QCryptographicHash::hash((sender.toUtf8()), QCryptographicHash::Sha256); quint8 *data = (quint8*)hash.data(); diff --git a/src/chatlog/content/filetransferwidget.cpp b/src/chatlog/content/filetransferwidget.cpp index a236e4ff7..fc43bce04 100644 --- a/src/chatlog/content/filetransferwidget.cpp +++ b/src/chatlog/content/filetransferwidget.cpp @@ -52,9 +52,9 @@ FileTransferWidget::FileTransferWidget(QWidget* parent, ToxFile file) : QWidget(parent) , ui(new Ui::FileTransferWidget) , fileInfo(file) - , backgroundColor(Style::getColor(Style::LightGrey)) + , backgroundColor(Style::getColor(Style::GroundExtra)) , buttonColor(Style::getColor(Style::Yellow)) - , buttonBackgroundColor(Style::getColor(Style::White)) + , buttonBackgroundColor(Style::getColor(Style::GroundBase)) , active(true) { ui->setupUi(this); @@ -329,7 +329,7 @@ void FileTransferWidget::updateWidgetColor(ToxFile const& file) case ToxFile::INITIALIZING: case ToxFile::PAUSED: case ToxFile::TRANSMITTING: - setBackgroundColor(Style::getColor(Style::LightGrey), false); + setBackgroundColor(Style::getColor(Style::GroundExtra), false); break; case ToxFile::BROKEN: case ToxFile::CANCELED: @@ -510,7 +510,7 @@ void FileTransferWidget::setupButtons(ToxFile const& file) ui->rightButton->setObjectName("cancel"); ui->rightButton->setToolTip(tr("Cancel transfer")); - setButtonColor(Style::getColor(Style::LightGrey)); + setButtonColor(Style::getColor(Style::GroundExtra)); break; case ToxFile::INITIALIZING: diff --git a/src/chatlog/content/text.cpp b/src/chatlog/content/text.cpp index 7d2f73862..5e5fb553d 100644 --- a/src/chatlog/content/text.cpp +++ b/src/chatlog/content/text.cpp @@ -471,7 +471,7 @@ void Text::selectText(QTextCursor& cursor, const std::pair& point) QColor Text::textColor() const { - QColor c = Style::getColor(Style::Black); + QColor c = Style::getColor(Style::MainText); if (textType == ACTION) { c = Style::getColor(Style::Action); } else if (textType == CUSTOM) { diff --git a/src/chatlog/content/text.h b/src/chatlog/content/text.h index b3f26533d..fe5161a2c 100644 --- a/src/chatlog/content/text.h +++ b/src/chatlog/content/text.h @@ -40,7 +40,7 @@ public: }; Text(const QString& txt = "", const QFont& font = QFont(), bool enableElide = false, - const QString& rawText = QString(), const TextType& type = NORMAL, const QColor& custom = Style::getColor(Style::Black)); + const QString& rawText = QString(), const TextType& type = NORMAL, const QColor& custom = Style::getColor(Style::MainText)); virtual ~Text(); void setText(const QString& txt); diff --git a/src/widget/genericchatroomwidget.cpp b/src/widget/genericchatroomwidget.cpp index d8a3919f4..170d4c3f5 100644 --- a/src/widget/genericchatroomwidget.cpp +++ b/src/widget/genericchatroomwidget.cpp @@ -163,19 +163,19 @@ void GenericChatroomWidget::reloadTheme() QPalette p; p = statusMessageLabel->palette(); - p.setColor(QPalette::WindowText, Style::getColor(Style::LightGrey)); // Base color - p.setColor(QPalette::HighlightedText, Style::getColor(Style::MediumGrey)); // Color when active + p.setColor(QPalette::WindowText, Style::getColor(Style::GroundExtra)); // Base color + p.setColor(QPalette::HighlightedText, Style::getColor(Style::StatusActive)); // Color when active statusMessageLabel->setPalette(p); p = nameLabel->palette(); - p.setColor(QPalette::WindowText, Style::getColor(Style::White)); // Base color - p.setColor(QPalette::HighlightedText, Style::getColor(Style::DarkGrey)); // Color when active + p.setColor(QPalette::WindowText, Style::getColor(Style::GroundBase)); // Base color + p.setColor(QPalette::HighlightedText, Style::getColor(Style::NameActive)); // Color when active nameLabel->setPalette(p); p = palette(); p.setColor(QPalette::Window, Style::getColor(Style::ThemeMedium)); // Base background color p.setColor(QPalette::Highlight, Style::getColor(Style::ThemeLight)); // On mouse over - p.setColor(QPalette::Light, Style::getColor(Style::White)); // When active + p.setColor(QPalette::Light, Style::getColor(Style::GroundBase)); // When active setPalette(p); } diff --git a/src/widget/style.cpp b/src/widget/style.cpp index b87621b05..f4a454ab1 100644 --- a/src/widget/style.cpp +++ b/src/widget/style.cpp @@ -126,12 +126,11 @@ QList Style::themeColorColors = {QColor(), QColor("#004aa4"), QColor("#9 QMap Style::aliasColors = {{Green, "green"}, {Yellow, "yellow"}, {Red, "red"}, - {Black,"black"}, - {DarkGrey, "darkGrey"}, - {MediumGrey,"mediumGrey"}, - {MediumGreyLight, "mediumGreyLight"}, - {LightGrey, "lightGrey"}, - {White, "white"}, + {MainText,"mainText"}, + {NameActive, "nameActive"}, + {StatusActive,"statusActive"}, + {GroundExtra, "groundExtra"}, + {GroundBase, "groundBase"}, {Orange, "orange"}, {ThemeDark, "themeDark"}, {ThemeMediumDark, "themeMediumDark"}, @@ -392,12 +391,11 @@ void Style::initDictColor() {"@green", Style::getColor(Style::Green).name()}, {"@yellow", Style::getColor(Style::Yellow).name()}, {"@red", Style::getColor(Style::Red).name()}, - {"@black", Style::getColor(Style::Black).name()}, // NOTE: (Dark) rename to textColor - {"@darkGrey", Style::getColor(Style::DarkGrey).name()}, - {"@mediumGrey", Style::getColor(Style::MediumGrey).name()}, - {"@mediumGreyLight", Style::getColor(Style::MediumGreyLight).name()}, - {"@lightGrey", Style::getColor(Style::LightGrey).name()}, - {"@white", Style::getColor(Style::White).name()}, + {"@mainText", Style::getColor(Style::MainText).name()}, + {"@nameActive", Style::getColor(Style::NameActive).name()}, + {"@statusActive", Style::getColor(Style::StatusActive).name()}, + {"@groundExtra", Style::getColor(Style::GroundExtra).name()}, + {"@groundBase", Style::getColor(Style::GroundBase).name()}, {"@orange", Style::getColor(Style::Orange).name()}, {"@action", Style::getColor(Style::Action).name()}}; } diff --git a/src/widget/style.h b/src/widget/style.h index 883de2564..3bb7a10f6 100644 --- a/src/widget/style.h +++ b/src/widget/style.h @@ -34,12 +34,11 @@ public: Green, Yellow, Red, - Black, - DarkGrey, - MediumGrey, - MediumGreyLight, - LightGrey, - White, + MainText, + NameActive, + StatusActive, + GroundExtra, + GroundBase, Orange, ThemeDark, ThemeMediumDark, diff --git a/themes/dark/centralWidget/centralWidget.css b/themes/dark/centralWidget/centralWidget.css index caa044dcf..a41924745 100644 --- a/themes/dark/centralWidget/centralWidget.css +++ b/themes/dark/centralWidget/centralWidget.css @@ -1,24 +1,24 @@ QLabel { - color: #c3c3c3; + color: @mainText; } QLineEdit { - color: #c3c3c3; + color: @mainText; } QTextEdit { - color: #c3c3c3; + color: @mainText; } QSpinBox { - color: #c3c3c3; + color: @mainText; } QListView { - color: #c3c3c3; + color: @mainText; } diff --git a/themes/dark/chatArea/chatArea.css b/themes/dark/chatArea/chatArea.css index 0d04c2634..3411e1866 100644 --- a/themes/dark/chatArea/chatArea.css +++ b/themes/dark/chatArea/chatArea.css @@ -11,5 +11,5 @@ QGraphicsView QWidget { - background: #201f1f; + background: @groundBase; } diff --git a/themes/dark/chatArea/chatHead.css b/themes/dark/chatArea/chatHead.css index 0955fa69a..15d3a89fb 100644 --- a/themes/dark/chatArea/chatHead.css +++ b/themes/dark/chatArea/chatHead.css @@ -1,27 +1,27 @@ QLineEdit { - color: @black; + color: @mainText; background: white; border: 0px; } #nameLabel { - color: #c3c3c3; + color: @mainText; font: @mediumBold; font-size:12px; } #statusLabel { - color: @mediumGrey; + color: @statusActive; font: @medium; font-size:12px; } #peersLabel { - color: @mediumGrey; + color: @statusActive; font: @medium; font-size:12px; } diff --git a/themes/dark/chatArea/innerStyle.css b/themes/dark/chatArea/innerStyle.css index 55a94c24e..4756642fd 100644 --- a/themes/dark/chatArea/innerStyle.css +++ b/themes/dark/chatArea/innerStyle.css @@ -13,7 +13,7 @@ p { } .typing { - color: @mediumGreyLight; + color: #131212; } .quote { diff --git a/themes/dark/emoticonWidget/emoticonWidget.css b/themes/dark/emoticonWidget/emoticonWidget.css index 9074241e4..2dcbca875 100644 --- a/themes/dark/emoticonWidget/emoticonWidget.css +++ b/themes/dark/emoticonWidget/emoticonWidget.css @@ -35,6 +35,6 @@ QRadioButton::indicator:checked QMenu { - background-color: @mediumGrey; /* sets background of the menu */ + background-color: @statusActive; /* sets background of the menu */ border: 0px solid; } diff --git a/themes/dark/fileTransferInstance/filetransferWidget.css b/themes/dark/fileTransferInstance/filetransferWidget.css index 3f1d5c5ea..499c095d8 100644 --- a/themes/dark/fileTransferInstance/filetransferWidget.css +++ b/themes/dark/fileTransferInstance/filetransferWidget.css @@ -1,27 +1,27 @@ [fontColor="white"] QLabel { - color:white; - font:@big; + color: white; + font: @big; } [fontColor="black"] QLabel { - color:@mediumGrey; - font:@big; + color: @statusActive; + font: @big; } QPushButton { - margin:0; + margin: 0; border: none; } QProgressBar { - border: 2px solid @mediumGrey; + border: 2px solid @statusActive; border-radius: 0px; - background-color: @mediumGrey; + background-color: @statusActive; } QProgressBar::chunk { - background-color: @lightGrey; + background-color: @groundExtra; width: 1px; -} \ No newline at end of file +} diff --git a/themes/dark/friendList/friendList.css b/themes/dark/friendList/friendList.css index 3bfd4cfa2..314033995 100644 --- a/themes/dark/friendList/friendList.css +++ b/themes/dark/friendList/friendList.css @@ -70,7 +70,7 @@ QWidget#circleWidgetContainer QLineEdit QWidget#circleWidgetContainer > QLabel#status { font: @small; - color: #c3c3c3; + color: @mainText; } QWidget#circleWidgetContainer > QLabel#name diff --git a/themes/dark/genericChatForm/genericChatForm.css b/themes/dark/genericChatForm/genericChatForm.css index dca16fd57..cc02e94e9 100644 --- a/themes/dark/genericChatForm/genericChatForm.css +++ b/themes/dark/genericChatForm/genericChatForm.css @@ -1,4 +1,4 @@ QWidget { - background: #201f1f; + background: @groundBase; } diff --git a/themes/dark/loginScreen/loginScreen.css b/themes/dark/loginScreen/loginScreen.css index 4ebb07658..f8f2bbd9f 100644 --- a/themes/dark/loginScreen/loginScreen.css +++ b/themes/dark/loginScreen/loginScreen.css @@ -59,7 +59,7 @@ QStackedWidget QPushButton QLabel { - color: #c3c3c3; + color: @mainText; background: #100f0f; } @@ -70,8 +70,8 @@ QLabel#label_7 QCheckBox, QProgressBar, QComboBox, QLineEdit, QListView { - color: #c3c3c3; - background: #201f1f; + color: @mainText; + background: @groundBase; } QCheckBox:disabled diff --git a/themes/dark/msgEdit/msgEdit.css b/themes/dark/msgEdit/msgEdit.css index 7c43a0625..05326d44e 100644 --- a/themes/dark/msgEdit/msgEdit.css +++ b/themes/dark/msgEdit/msgEdit.css @@ -1,9 +1,9 @@ QTextEdit { - border-color: @lightGrey; + border-color: @groundExtra; border-style: solid; border-width: 1px 0 1px 1px; - background: #201f1f; + background: @groundBase; } QTextEdit:hover diff --git a/themes/dark/palette.ini b/themes/dark/palette.ini index 6ef7fbc61..968772eba 100644 --- a/themes/dark/palette.ini +++ b/themes/dark/palette.ini @@ -2,15 +2,14 @@ green="#6bc260" yellow="#cebf44" red="#c84e4e" -black="#c3c3c3" -darkGrey="#c3c3c3" -mediumGrey="#d1d1d1" -mediumGreyLight="#131212" -lightGrey="#d1d1d1" -white="#201f1f" +mainText="#c3c3c3" +nameActive="#c3c3c3" +statusActive="#d1d1d1" +groundExtra="#d1d1d1" +groundBase="#201f1f" orange="#ff7700" themeDark="#1c1c1c" themeMediumDark="#2a2a2a" themeMedium="#100f0f" themeLight="#201f1f" -action="#546eff" \ No newline at end of file +action="#546eff" diff --git a/themes/dark/settings/mainContent.css b/themes/dark/settings/mainContent.css index 80e47019d..d70156eef 100644 --- a/themes/dark/settings/mainContent.css +++ b/themes/dark/settings/mainContent.css @@ -1,25 +1,25 @@ QTextEdit { - border-color: @lightGrey; + border-color: @groundExtra; border-style: solid; border-width: 1px 0 1px 1px; - background: #201f1f; + background: @groundBase; border: 1px solid #c4c1bd; } QListWidget { - background-color: #201f1f; + background-color: @groundBase; } QMessageBox { - background-color: #201f1f; + background-color: @groundBase; } QCheckBox { - color: #c3c3c3; + color: @mainText; } QCheckBox:disabled @@ -29,7 +29,7 @@ QCheckBox:disabled QSpinBox { - background-color: #201f1f; + background-color: @groundBase; } QSpinBox:disabled @@ -39,30 +39,30 @@ QSpinBox:disabled QGroupBox { - color: #c3c3c3; - background-color: #201f1f; + color: @mainText; + background-color: @groundBase; font: @bigBold; } QComboBox { - color: #c3c3c3; - background-color: #201f1f; + color: @mainText; + background-color: @groundBase; } QComboBox QAbstractItemView { - background-color: #201f1f; + background-color: @groundBase; } QLineEdit { - background-color: #201f1f; + background-color: @groundBase; } QLineEdit:disabled { background-color: #262424 - color: #201f1f; + color: @groundBase; } QTabWidget @@ -73,7 +73,7 @@ QTabWidget QTabBar::tab:selected { background: #100f0f; - color: #c3c3c3; + color: @mainText; } QTabBar::tab:!selected @@ -84,7 +84,7 @@ QTabBar::tab:!selected QScrollArea { - background-color: #201f1f; + background-color: @groundBase; } QScrollArea > QWidget > QWidget @@ -94,7 +94,7 @@ QScrollArea > QWidget > QWidget QScrollArea::corner { - background-color: #201f1f; + background-color: @groundBase; border: none; } @@ -231,12 +231,12 @@ QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal QRadioButton { - background: #201f1f; - color: #c3c3c3; + background: @groundBase; + color: @mainText; } QPushButton { background: #323030; - color: #c3c3c3; + color: @mainText; } diff --git a/themes/dark/settings/mainHead.css b/themes/dark/settings/mainHead.css index 9f818366f..b65c8eebd 100644 --- a/themes/dark/settings/mainHead.css +++ b/themes/dark/settings/mainHead.css @@ -1,5 +1,5 @@ QWidget .QLabel, QWidget .QLineEdit { - color: #c3c3c3; - background: #201f1f; + color: @mainText; + background: @groundBase; } diff --git a/themes/dark/window/general.css b/themes/dark/window/general.css index 0d4653ecb..45e9bddbd 100644 --- a/themes/dark/window/general.css +++ b/themes/dark/window/general.css @@ -8,6 +8,6 @@ QToolTip QWidget#contentWidget { - background: #201f1f; + background: @groundBase; } diff --git a/themes/dark/window/statusPanel.css b/themes/dark/window/statusPanel.css index f0bab5f38..4b8ae3d88 100644 --- a/themes/dark/window/statusPanel.css +++ b/themes/dark/window/statusPanel.css @@ -79,14 +79,14 @@ QListView { background-color: @themeDark; font: @extraBig; - color: @white; + color: @groundBase; } #statusPanel > #statusHead > #statusLabel { background-color: @themeDark; font: @medium; - color: @lightGrey; + color: @groundExtra; } #statusPanel > #statusHead > #statusButton diff --git a/themes/default/centralWidget/centralWidget.css b/themes/default/centralWidget/centralWidget.css index 4e0f66a09..a41924745 100644 --- a/themes/default/centralWidget/centralWidget.css +++ b/themes/default/centralWidget/centralWidget.css @@ -1,24 +1,24 @@ QLabel { - color: black; + color: @mainText; } QLineEdit { - color: black; + color: @mainText; } QTextEdit { - color: black; + color: @mainText; } QSpinBox { - color: black; + color: @mainText; } QListView { - color: black; + color: @mainText; } diff --git a/themes/default/chatArea/chatHead.css b/themes/default/chatArea/chatHead.css index c0f9ee85b..15d3a89fb 100644 --- a/themes/default/chatArea/chatHead.css +++ b/themes/default/chatArea/chatHead.css @@ -1,27 +1,27 @@ QLineEdit { - color: @black; + color: @mainText; background: white; border: 0px; } #nameLabel { - color: @black; + color: @mainText; font: @mediumBold; font-size:12px; } #statusLabel { - color: @mediumGrey; + color: @statusActive; font: @medium; font-size:12px; } #peersLabel { - color: @mediumGrey; + color: @statusActive; font: @medium; font-size:12px; } diff --git a/themes/default/chatArea/innerStyle.css b/themes/default/chatArea/innerStyle.css index 03bab638c..9a99959ca 100644 --- a/themes/default/chatArea/innerStyle.css +++ b/themes/default/chatArea/innerStyle.css @@ -12,7 +12,7 @@ p { } .typing { - color: @mediumGreyLight; + color: #4e4e4e; } .quote { diff --git a/themes/default/emoticonWidget/emoticonWidget.css b/themes/default/emoticonWidget/emoticonWidget.css index 9074241e4..2dcbca875 100644 --- a/themes/default/emoticonWidget/emoticonWidget.css +++ b/themes/default/emoticonWidget/emoticonWidget.css @@ -35,6 +35,6 @@ QRadioButton::indicator:checked QMenu { - background-color: @mediumGrey; /* sets background of the menu */ + background-color: @statusActive; /* sets background of the menu */ border: 0px solid; } diff --git a/themes/default/fileTransferInstance/filetransferWidget.css b/themes/default/fileTransferInstance/filetransferWidget.css index 3f1d5c5ea..5a0a37a0e 100644 --- a/themes/default/fileTransferInstance/filetransferWidget.css +++ b/themes/default/fileTransferInstance/filetransferWidget.css @@ -1,11 +1,11 @@ [fontColor="white"] QLabel { - color:white; - font:@big; + color: white; + font: @big; } [fontColor="black"] QLabel { - color:@mediumGrey; - font:@big; + color: @statusActive; + font: @big; } QPushButton { @@ -16,12 +16,12 @@ QPushButton { QProgressBar { - border: 2px solid @mediumGrey; + border: 2px solid @statusActive; border-radius: 0px; - background-color: @mediumGrey; + background-color: @statusActive; } QProgressBar::chunk { - background-color: @lightGrey; + background-color: @groundExtra; width: 1px; -} \ No newline at end of file +} diff --git a/themes/default/friendList/friendList.css b/themes/default/friendList/friendList.css index 7768e0591..4ae2ef596 100644 --- a/themes/default/friendList/friendList.css +++ b/themes/default/friendList/friendList.css @@ -70,13 +70,13 @@ QWidget#circleWidgetContainer QLineEdit QWidget#circleWidgetContainer > QLabel#status { font: @small; - color: @lightGrey; + color: @groundExtra; } QWidget#circleWidgetContainer > QLabel#name { font: @big; - color: @white; + color: @groundBase; } QLabel { diff --git a/themes/default/msgEdit/msgEdit.css b/themes/default/msgEdit/msgEdit.css index 27125a6c1..85c4ce43d 100644 --- a/themes/default/msgEdit/msgEdit.css +++ b/themes/default/msgEdit/msgEdit.css @@ -1,6 +1,6 @@ QTextEdit { - border-color: @lightGrey; + border-color: @groundExtra; border-style: solid; border-width: 1px 0 1px 1px; background: white; diff --git a/themes/default/palette.ini b/themes/default/palette.ini index adbd063d7..da5fd3d03 100644 --- a/themes/default/palette.ini +++ b/themes/default/palette.ini @@ -2,15 +2,14 @@ green="#6bc260" yellow="#cebf44" red="#c84e4e" -black="#000000" -darkGrey="#1c1c1c" -mediumGrey="#414141" -mediumGreyLight="#4e4e4e" -lightGrey="#d1d1d1" -white="#ffffff" +mainText="#000000" +nameActive="#1c1c1c" +statusActive="#414141" +groundExtra="#d1d1d1" +groundBase="#ffffff" orange="#ff7700" themeDark="#1c1c1c" themeMediumDark="#2a2a2a" themeMedium="#414141" themeLight="#4e4e4e" -action="#1818FF" \ No newline at end of file +action="#1818FF" diff --git a/themes/default/settings/mainContent.css b/themes/default/settings/mainContent.css index dd3aadd50..9e81f3618 100644 --- a/themes/default/settings/mainContent.css +++ b/themes/default/settings/mainContent.css @@ -1,6 +1,6 @@ QTextEdit { - border-color: @lightGrey; + border-color: @groundExtra; border-style: solid; border-width: 1px 0 1px 1px; background: white; diff --git a/themes/default/window/statusPanel.css b/themes/default/window/statusPanel.css index f0bab5f38..4b8ae3d88 100644 --- a/themes/default/window/statusPanel.css +++ b/themes/default/window/statusPanel.css @@ -79,14 +79,14 @@ QListView { background-color: @themeDark; font: @extraBig; - color: @white; + color: @groundBase; } #statusPanel > #statusHead > #statusLabel { background-color: @themeDark; font: @medium; - color: @lightGrey; + color: @groundExtra; } #statusPanel > #statusHead > #statusButton From 9a82d8144f7204fc7ead6920d5e4b25f7fdbd5a5 Mon Sep 17 00:00:00 2001 From: TriKriSta Date: Sat, 23 Feb 2019 17:11:30 +0200 Subject: [PATCH 5/8] style: edit styles --- src/widget/form/settings/aboutsettings.ui | 2 +- themes/dark/centralWidget/centralWidget.css | 2 +- themes/dark/chatArea/chatArea.css | 4 ++-- themes/dark/chatArea/chatHead.css | 2 +- themes/dark/chatForm/labels.css | 4 ++-- themes/dark/contentDialog/contentDialog.css | 23 +++++++++++-------- themes/dark/emoticonWidget/emoticonWidget.css | 2 +- themes/dark/loginScreen/loginScreen.css | 2 +- themes/dark/settings/mainContent.css | 18 +++++++-------- themes/dark/window/general.css | 16 +++++++++++++ themes/dark/window/statusPanel.css | 2 +- .../default/centralWidget/centralWidget.css | 2 +- themes/default/settings/mainContent.css | 21 ++--------------- themes/default/window/general.css | 17 ++++++++++++++ 14 files changed, 69 insertions(+), 48 deletions(-) diff --git a/src/widget/form/settings/aboutsettings.ui b/src/widget/form/settings/aboutsettings.ui index a761d5fa9..4e381f8ec 100644 --- a/src/widget/form/settings/aboutsettings.ui +++ b/src/widget/form/settings/aboutsettings.ui @@ -280,7 +280,7 @@ <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Noto Sans'; font-size:10pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; color:#000000;">Copyright © 2014-2018 by The qTox Project Contributors</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif';">Copyright © 2014-2018 by The qTox Project Contributors</span></p> <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu';">qTox is a Qt-based graphical interface for Tox.</span></p> <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif';">qTox is libre software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.</span></p> <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif';">qTox is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. </span></p> diff --git a/themes/dark/centralWidget/centralWidget.css b/themes/dark/centralWidget/centralWidget.css index a41924745..6aefd33b3 100644 --- a/themes/dark/centralWidget/centralWidget.css +++ b/themes/dark/centralWidget/centralWidget.css @@ -13,7 +13,7 @@ QTextEdit color: @mainText; } -QSpinBox +QSpinBox, QDoubleSpinBox { color: @mainText; } diff --git a/themes/dark/chatArea/chatArea.css b/themes/dark/chatArea/chatArea.css index 3411e1866..4dce22394 100644 --- a/themes/dark/chatArea/chatArea.css +++ b/themes/dark/chatArea/chatArea.css @@ -1,7 +1,7 @@ QTextEdit { - background: white; - color: black; + background: @groundBase; + color: @mainText; } QGraphicsView diff --git a/themes/dark/chatArea/chatHead.css b/themes/dark/chatArea/chatHead.css index 15d3a89fb..53073ebb3 100644 --- a/themes/dark/chatArea/chatHead.css +++ b/themes/dark/chatArea/chatHead.css @@ -1,7 +1,7 @@ QLineEdit { color: @mainText; - background: white; + background: @groundBase; border: 0px; } diff --git a/themes/dark/chatForm/labels.css b/themes/dark/chatForm/labels.css index 8f0b0173b..8dfbf20bd 100644 --- a/themes/dark/chatForm/labels.css +++ b/themes/dark/chatForm/labels.css @@ -1,11 +1,11 @@ QLabel { - color: #000; + color: @mainText; } QLabel:disabled { - color: #ddd; + color: #2d2b2b; } QLabel[state="red"] diff --git a/themes/dark/contentDialog/contentDialog.css b/themes/dark/contentDialog/contentDialog.css index ebfe7c1da..dd15f6a25 100644 --- a/themes/dark/contentDialog/contentDialog.css +++ b/themes/dark/contentDialog/contentDialog.css @@ -1,16 +1,21 @@ QSplitter { - color: white; - background-color: white; - alternate-background-color: white; - border-color: white; - gridline-color: white; - selection-color: white; - selection-background-color: white; + color: @groundExtra; + background-color: @groundExtra; + alternate-background-color: @groundExtra; + border-color: @groundExtra; + gridline-color: @groundExtra; + selection-color: @groundExtra; + selection-background-color: @groundExtra; } QSplitter:handle { - color: white; - background-color: white; + color: @groundExtra; + background-color: @groundExtra; +} + +QWidget +{ + background: @groundBase; } diff --git a/themes/dark/emoticonWidget/emoticonWidget.css b/themes/dark/emoticonWidget/emoticonWidget.css index 2dcbca875..ffb8e841a 100644 --- a/themes/dark/emoticonWidget/emoticonWidget.css +++ b/themes/dark/emoticonWidget/emoticonWidget.css @@ -35,6 +35,6 @@ QRadioButton::indicator:checked QMenu { - background-color: @statusActive; /* sets background of the menu */ + background-color: #363434; /* sets background of the menu */ border: 0px solid; } diff --git a/themes/dark/loginScreen/loginScreen.css b/themes/dark/loginScreen/loginScreen.css index f8f2bbd9f..2649e4b9c 100644 --- a/themes/dark/loginScreen/loginScreen.css +++ b/themes/dark/loginScreen/loginScreen.css @@ -57,7 +57,7 @@ QStackedWidget QPushButton background: #589f4e; } -QLabel +QMessageBox, QLabel { color: @mainText; background: #100f0f; diff --git a/themes/dark/settings/mainContent.css b/themes/dark/settings/mainContent.css index d70156eef..bad7b6fed 100644 --- a/themes/dark/settings/mainContent.css +++ b/themes/dark/settings/mainContent.css @@ -27,12 +27,12 @@ QCheckBox:disabled color: grey; } -QSpinBox +QSpinBox, QDoubleSpinBox { background-color: @groundBase; } -QSpinBox:disabled +QSpinBox:disabled, QDoubleSpinBox:disabled { background-color: lightGrey; } @@ -61,7 +61,7 @@ QLineEdit QLineEdit:disabled { - background-color: #262424 + background-color: #262424; color: @groundBase; } @@ -119,7 +119,7 @@ QPushButton#updateAvailableButton QScrollBar::handle:vertical { - background-color: #d1d1d1; + background-color: #343232; min-height: 20px; border-radius: 3px; margin-left: 2px; @@ -127,12 +127,12 @@ QScrollBar::handle:vertical QScrollBar::handle:vertical:hover { - background-color: #e3e3e3; + background-color: #3e3c3c; } QScrollBar::handle:vertical:pressed { - background-color: #b1b1b1; + background-color: #474545; } QScrollBar::add-line:vertical @@ -179,19 +179,19 @@ QScrollBar:horizontal QScrollBar::handle:horizontal { - background-color: #d1d1d1; + background-color: #343232; min-width: 20px; border-radius: 2px; } QScrollBar::handle:horizontal:hover { - background-color: #e3e3e3; + background-color: #3e3c3c; } QScrollBar::handle:horizontal:pressed { - background-color: #b1b1b1; + background-color: #474545; } QScrollBar::add-line:horizontal diff --git a/themes/dark/window/general.css b/themes/dark/window/general.css index 45e9bddbd..42a214eb0 100644 --- a/themes/dark/window/general.css +++ b/themes/dark/window/general.css @@ -11,3 +11,19 @@ QWidget#contentWidget background: @groundBase; } +QTabWidget +{ + background-color: @groundBase; +} + +QTabBar::tab:selected +{ + background: #100f0f; + color: @mainText; +} + +QTabBar::tab:!selected +{ + background: #444242; + color: #8e8e8e; +} diff --git a/themes/dark/window/statusPanel.css b/themes/dark/window/statusPanel.css index 4b8ae3d88..bedab4aa2 100644 --- a/themes/dark/window/statusPanel.css +++ b/themes/dark/window/statusPanel.css @@ -79,7 +79,7 @@ QListView { background-color: @themeDark; font: @extraBig; - color: @groundBase; + color: @nameActive; } #statusPanel > #statusHead > #statusLabel diff --git a/themes/default/centralWidget/centralWidget.css b/themes/default/centralWidget/centralWidget.css index a41924745..6aefd33b3 100644 --- a/themes/default/centralWidget/centralWidget.css +++ b/themes/default/centralWidget/centralWidget.css @@ -13,7 +13,7 @@ QTextEdit color: @mainText; } -QSpinBox +QSpinBox, QDoubleSpinBox { color: @mainText; } diff --git a/themes/default/settings/mainContent.css b/themes/default/settings/mainContent.css index 9e81f3618..4541da660 100644 --- a/themes/default/settings/mainContent.css +++ b/themes/default/settings/mainContent.css @@ -27,12 +27,12 @@ QCheckBox:disabled color: grey; } -QSpinBox +QSpinBox, QDoubleSpinBox { background-color: white; } -QSpinBox:disabled +QSpinBox:disabled, QDoubleSpinBox:disabled { background-color: lightGrey; } @@ -64,23 +64,6 @@ QLineEdit:disabled background-color: lightGrey; } -QTabWidget -{ - background-color: white; -} - -QTabBar::tab:selected -{ - background: #2d3136; - color: #f1f1f1; -} - -QTabBar::tab:!selected -{ - background: #d0d1d1; - color: #5e5e5e; -} - QScrollArea { background-color: white; diff --git a/themes/default/window/general.css b/themes/default/window/general.css index 0026ff38e..aafc76c58 100644 --- a/themes/default/window/general.css +++ b/themes/default/window/general.css @@ -5,3 +5,20 @@ QToolTip color: black; background: #ffffdc; } + +QTabWidget +{ + background-color: white; +} + +QTabBar::tab:selected +{ + background: #2d3136; + color: #f1f1f1; +} + +QTabBar::tab:!selected +{ + background: #d0d1d1; + color: #5e5e5e; +} From d35dbcc870d3f35c9ba075736f85ec27d7c84b42 Mon Sep 17 00:00:00 2001 From: TriKriSta Date: Sat, 23 Feb 2019 19:40:59 +0200 Subject: [PATCH 6/8] feat: add color for links in palette --- src/widget/form/settings/aboutform.cpp | 5 +++-- src/widget/style.cpp | 6 ++++-- src/widget/style.h | 3 ++- themes/dark/chatArea/innerStyle.css | 2 +- themes/dark/palette.ini | 1 + themes/default/chatArea/innerStyle.css | 2 +- themes/default/palette.ini | 1 + 7 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/widget/form/settings/aboutform.cpp b/src/widget/form/settings/aboutform.cpp index ee705a06b..5e3fc0a15 100644 --- a/src/widget/form/settings/aboutform.cpp +++ b/src/widget/form/settings/aboutform.cpp @@ -22,6 +22,7 @@ #include "src/widget/tool/recursivesignalblocker.h" #include "src/net/updatecheck.h" +#include "src/widget/style.h" #include "src/widget/translator.h" #include "src/persistence/profile.h" #include "src/persistence/settings.h" @@ -192,8 +193,8 @@ void AboutForm::onUpdateCheckFailed() QString AboutForm::createLink(QString path, QString text) const { return QString::fromUtf8( - "%2") - .arg(path, text); + "%3") + .arg(path, Style::getColor(Style::Link).name(), text); } AboutForm::~AboutForm() diff --git a/src/widget/style.cpp b/src/widget/style.cpp index f4a454ab1..69fe0a830 100644 --- a/src/widget/style.cpp +++ b/src/widget/style.cpp @@ -136,7 +136,8 @@ QMap Style::aliasColors = {{Green, "green"}, {ThemeMediumDark, "themeMediumDark"}, {ThemeMedium, "themeMedium"}, {ThemeLight, "themeLight"}, - {Action, "action"}}; + {Action, "action"}, + {Link, "link"}}; // stylesheet filename, font -> stylesheet // QString implicit sharing deduplicates stylesheets rather than constructing a new one each time @@ -397,7 +398,8 @@ void Style::initDictColor() {"@groundExtra", Style::getColor(Style::GroundExtra).name()}, {"@groundBase", Style::getColor(Style::GroundBase).name()}, {"@orange", Style::getColor(Style::Orange).name()}, - {"@action", Style::getColor(Style::Action).name()}}; + {"@action", Style::getColor(Style::Action).name()}, + {"@link", Style::getColor(Style::Link).name()}}; } QString Style::getThemePath() diff --git a/src/widget/style.h b/src/widget/style.h index 3bb7a10f6..0c3eb50fd 100644 --- a/src/widget/style.h +++ b/src/widget/style.h @@ -44,7 +44,8 @@ public: ThemeMediumDark, ThemeMedium, ThemeLight, - Action + Action, + Link }; enum Font diff --git a/themes/dark/chatArea/innerStyle.css b/themes/dark/chatArea/innerStyle.css index 4756642fd..199500b66 100644 --- a/themes/dark/chatArea/innerStyle.css +++ b/themes/dark/chatArea/innerStyle.css @@ -32,6 +32,6 @@ p { } a { - color: #d292ff; + color: @link; font-weight: bold } diff --git a/themes/dark/palette.ini b/themes/dark/palette.ini index 968772eba..9fe77969c 100644 --- a/themes/dark/palette.ini +++ b/themes/dark/palette.ini @@ -13,3 +13,4 @@ themeMediumDark="#2a2a2a" themeMedium="#100f0f" themeLight="#201f1f" action="#546eff" +link="#d292ff" diff --git a/themes/default/chatArea/innerStyle.css b/themes/default/chatArea/innerStyle.css index 9a99959ca..1b6ebc7ae 100644 --- a/themes/default/chatArea/innerStyle.css +++ b/themes/default/chatArea/innerStyle.css @@ -31,5 +31,5 @@ p { } a { - color: blue; + color: @link; } diff --git a/themes/default/palette.ini b/themes/default/palette.ini index da5fd3d03..f7386424c 100644 --- a/themes/default/palette.ini +++ b/themes/default/palette.ini @@ -13,3 +13,4 @@ themeMediumDark="#2a2a2a" themeMedium="#414141" themeLight="#4e4e4e" action="#1818FF" +link="#0000ff" From 827e3b734cbfe30d6f9aae63d7df67a333d38a94 Mon Sep 17 00:00:00 2001 From: TriKriSta Date: Sun, 24 Feb 2019 16:22:59 +0200 Subject: [PATCH 7/8] refactor: edit variables for themes --- src/widget/style.cpp | 34 ++++++++++++++++++++++++---------- src/widget/style.h | 14 +++++++++++++- 2 files changed, 37 insertions(+), 11 deletions(-) diff --git a/src/widget/style.cpp b/src/widget/style.cpp index 69fe0a830..85c27ff0a 100644 --- a/src/widget/style.cpp +++ b/src/widget/style.cpp @@ -89,11 +89,28 @@ static QMap dictColor; static QMap dictFont; static QMap dictTheme; +QList Style::themeNameColors = { + {Style::Light, QObject::tr("Default"), QColor()}, + {Style::Light, QObject::tr("Blue"), QColor("#004aa4")}, + {Style::Light, QObject::tr("Olive"), QColor("#97ba00")}, + {Style::Light, QObject::tr("Red"), QColor("#c23716")}, + {Style::Light, QObject::tr("Violet"), QColor("#4617b5")}, + {Style::Dark, QObject::tr("Dark"), QColor()}, + {Style::Dark, QObject::tr("Dark blue"), QColor("#00336d")}, + {Style::Dark, QObject::tr("Dark olive"), QColor("#4d5f00")}, + {Style::Dark, QObject::tr("Dark red"), QColor("#7a210d")}, + {Style::Dark, QObject::tr("Dark violet"), QColor("#280d6c")} +}; + QStringList Style::getThemeColorNames() { - return {QObject::tr("Default"), QObject::tr("Blue"), QObject::tr("Olive"), QObject::tr("Red"), - QObject::tr("Violet"), QObject::tr("Dark"), QObject::tr("Dark blue"), QObject::tr("Dark olive"), - QObject::tr("Dark red"), QObject::tr("Dark violet")}; + QStringList l; + + for (auto t : themeNameColors) { + l << t.name; + } + + return l; } QString Style::getThemeName() @@ -118,10 +135,6 @@ QString Style::getThemeFolder() return fullPath % QDir::separator(); } -QList Style::themeColorColors = {QColor(), QColor("#004aa4"), QColor("#97ba00"), - QColor("#c23716"), QColor("#4617b5"), - QColor(), QColor("#00336d"), QColor("#4d5f00"), - QColor("#7a210d"), QColor("#280d6c")}; QMap Style::aliasColors = {{Green, "green"}, {Yellow, "yellow"}, @@ -318,10 +331,10 @@ void Style::setThemeColor(int color) dictColor.clear(); initPalette(); initDictColor(); - if (color < 0 || color >= themeColorColors.size()) + if (color < 0 || color >= themeNameColors.size()) setThemeColor(QColor()); else - setThemeColor(themeColorColors[color]); + setThemeColor(themeNameColors[color].color); } /** @@ -404,7 +417,8 @@ void Style::initDictColor() QString Style::getThemePath() { - if (Settings::getInstance().getThemeColor() > 4) { + const int num = Settings::getInstance().getThemeColor(); + if (themeNameColors[num].type == Dark) { return BuiltinThemeDarkPath; } diff --git a/src/widget/style.h b/src/widget/style.h index 0c3eb50fd..b41ba8cd1 100644 --- a/src/widget/style.h +++ b/src/widget/style.h @@ -59,6 +59,18 @@ public: SmallLight }; + enum MainTheme + { + Light, + Dark + }; + + struct ThemeNameColor { + MainTheme type; + QString name; + QColor color; + }; + static QStringList getThemeColorNames(); static const QString getStylesheet(const QString& filename, const QFont& baseFont = QFont()); static const QString getImagePath(const QString& filename); @@ -83,7 +95,7 @@ private: Style(); private: - static QList themeColorColors; + static QList themeNameColors; static std::map, const QString> stylesheetsCache; static QMap aliasColors; }; From d517c3a638a9355ba8a799fd00119a56a3e9c88d Mon Sep 17 00:00:00 2001 From: TriKriSta Date: Sun, 24 Feb 2019 23:26:10 +0200 Subject: [PATCH 8/8] fix: initialization theme --- src/widget/widget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/widget/widget.cpp b/src/widget/widget.cpp index dc2c68a5e..7d5a7bcdd 100644 --- a/src/widget/widget.cpp +++ b/src/widget/widget.cpp @@ -220,8 +220,6 @@ void Widget::init() ui->statusButton->setEnabled(false); Style::setThemeColor(settings.getThemeColor()); - reloadTheme(); - updateIcons(); filesForm = new FilesForm(); addFriendForm = new AddFriendForm; @@ -388,6 +386,8 @@ void Widget::init() connect(&settings, &Settings::groupchatPositionChanged, contactListWidget, &FriendListWidget::onGroupchatPositionChanged); + reloadTheme(); + updateIcons(); retranslateUi(); Translator::registerHandler(std::bind(&Widget::retranslateUi, this), this);