From 19b526d4533841ca91209929f0d6aef6042a8eeb Mon Sep 17 00:00:00 2001 From: Max Sandholm Date: Thu, 16 Nov 2017 16:33:52 +0200 Subject: Use system color scheme (using a Qt stylesheet) #104 The color scheme of nheko obeys the default color theme of Qt (i.e. the system theme). It uses a Qt stylesheet to accomplish this, which means replacing the color theme with a custom theme would only be a matter of writing a new style sheet and loading it into the app. --- resources/res.qrc | 7 +++--- resources/styles/nheko.qss | 56 +++++++++++++++++++++++++++++++++++++++++++++ resources/styles/system.qss | 39 +++++++++++++++++++++++++++++++ 3 files changed, 99 insertions(+), 3 deletions(-) create mode 100644 resources/styles/nheko.qss create mode 100644 resources/styles/system.qss (limited to 'resources') diff --git a/resources/res.qrc b/resources/res.qrc index 55962275..9bd977a2 100644 --- a/resources/res.qrc +++ b/resources/res.qrc @@ -42,7 +42,6 @@ icons/emoji-categories/flags.png icons/emoji-categories/flags@2x.png - nheko.png @@ -62,13 +61,15 @@ nheko-32.png nheko-16.png - fonts/OpenSans/OpenSans-Regular.ttf fonts/OpenSans/OpenSans-Italic.ttf fonts/OpenSans/OpenSans-Bold.ttf fonts/OpenSans/OpenSans-Semibold.ttf - fonts/EmojiOne/emojione-android.ttf + + styles/system.qss + styles/nheko.qss + diff --git a/resources/styles/nheko.qss b/resources/styles/nheko.qss new file mode 100644 index 00000000..caaac6b9 --- /dev/null +++ b/resources/styles/nheko.qss @@ -0,0 +1,56 @@ +* { + color: #333; +} + +QLabel { + color: #333; +} + +#chatPage, #chatPage > * { background-color: white; } + +TimelineView, TimelineView > * { background-color: white; } + +QMenu, QMenu > * { background-color: white; } + +FlatButton { qproperty-foregroundColor: #333; } + +RaisedButton { qproperty-foregroundColor: white; } + +RoomInfoListItem +{ + qproperty-highlightedBackgroundColor: #38A3D8; + qproperty-hoverBackgroundColor: rgba(200, 200, 200, 128); + qproperty-backgroundColor: white; + + qproperty-titleColor: #333; + qproperty-subtitleColor: #5d6565; + + qproperty-highlightedTitleColor: white; + qproperty-highlightedSubtitleColor: white; +} + +#ChatPageLoadSpinner { + qproperty-color: #acc7dc; +} + +#FileUploadSpinner { + qproperty-color: #333; +} + +UserInfoWidget, UserInfoWidget > * { + background-color: #d6dde3; + color: #ebebeb; +} + +Avatar { + qproperty-textColor: black; + qproperty-backgroundColor: #eee; +} + +#displayNameLabel { + color: #171919; +} + +#userIdLabel { + color: #555459; +} diff --git a/resources/styles/system.qss b/resources/styles/system.qss new file mode 100644 index 00000000..2f15271f --- /dev/null +++ b/resources/styles/system.qss @@ -0,0 +1,39 @@ +OverlayWidget, OverlayWidget > * { + background-color: palette(window); +} + +#mainContent, #mainContent > * { + background-color: palette(base); +} + +TimelineView, TimelineView > *, TimelineItem, TimelineItem > * { + background-color: palette(base); +} + +FlatButton { + qproperty-foregroundColor: palette(text); +} + +RoomInfoListItem { + qproperty-highlightedBackgroundColor: palette(highlight); + qproperty-hoverBackgroundColor: palette(dark); + qproperty-backgroundColor: palette(window); + + qproperty-titleColor: palette(text); + qproperty-subtitleColor: palette(text); + + qproperty-highlightedTitleColor: palette(text); + qproperty-highlightedSubtitleColor: palette(text); +} + +LoadingIndicator { + qproperty-color: palette(text); +} + +#ChatPageLoadSpinner { + qproperty-color: #acc7dc; +} + +UserInfoWidget, UserInfoWidget > * { + background-color: palette(window); +} -- cgit 1.5.1