From 75fdd5315f260b47ccd82e49087dfe70c2678180 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 28 Jun 2017 09:37:49 +0300 Subject: [PATCH] Add some more colors for theming. --- Telegram/Resources/colors.palette | 15 +++++++++++---- Telegram/SourceFiles/app.cpp | 2 -- Telegram/SourceFiles/history/history.style | 8 +++----- Telegram/SourceFiles/layout.h | 2 -- Telegram/SourceFiles/overview/overview.style | 6 ++++-- Telegram/SourceFiles/overview/overview_layout.cpp | 5 +++-- Telegram/SourceFiles/ui/widgets/widgets.style | 2 +- 7 files changed, 22 insertions(+), 18 deletions(-) diff --git a/Telegram/Resources/colors.palette b/Telegram/Resources/colors.palette index ea781eadd..bdc7fe715 100644 --- a/Telegram/Resources/colors.palette +++ b/Telegram/Resources/colors.palette @@ -93,9 +93,14 @@ placeholderFg: windowSubTextFg; // default input field placeholder when field is placeholderFgActive: #aaaaaa; // default input field placeholder when field is focused inputBorderFg: #e0e0e0; // default input field bottom border (like in code input field when you log in and field is not focused) filterInputBorderFg: #54c3f3; // default rounded input field border (like in chats list search field when field is focused) -filterInputInactiveBg: windowBgOver; // default rounded input field background (like in chats list search field when field is inactive) +filterInputActiveBg: windowBg; // default rounded input field active background (like in chats list search field when field is focused) +filterInputInactiveBg: windowBgOver; // default rounded input field inactive background (like in chats list search field when field is inactive) checkboxFg: #b3b3b3; // default unchecked checkbox rounded rectangle +botKbBg: menuBgOver; // bot keyboard button background +botKbDownBg: menuBgRipple; // bot keyboard button ripple effect +botKbColor: windowBoldFgOver; // bot keyboard button text + sliderBgInactive: #e1eaef; // default slider not active bar (like in Settings when you choose interface scale or custom notifications count) sliderBgActive: windowBgActive; // default slider active bar (like in Settings when you choose interface scale or custom notifications count) @@ -232,8 +237,8 @@ dialogsUnreadBgActive: dialogsTextFgActive; // chat list unread badge background dialogsUnreadBgMutedActive: dialogsDraftFgActive; // chat list unread badge background for muted chat for current (active) chat dialogsUnreadFgActive: dialogsBgActive; // chat list unread badge text for current (active) chat -dialogsRippleBg: windowBgRipple; -dialogsRippleBgActive: activeButtonBgRipple; +dialogsRippleBg: windowBgRipple; // chat list background ripple effect +dialogsRippleBgActive: activeButtonBgRipple; // chat list background ripple effect for current (active) chat dialogsForwardBg: dialogsBgActive; // forwarding panel background (when forwarding messages in the smallest window size) dialogsForwardFg: dialogsNameFgActive; // forwarding panel text (when forwarding messages in the smallest window size) @@ -452,7 +457,9 @@ historyComposeButtonBgOver: windowBgOver; // unblock / join channel / mute chann historyComposeButtonBgRipple: windowBgRipple; // unblock / join channel / mute channel button ripple effect // overview -overviewCheckBg: #00000040; // shared files / links checkbox background for not selected rows when some rows are selected +overviewCheckBg: #00000040; // shared media / files / links checkbox background for not selected rows when some rows are selected +overviewCheckBgActive: windowBgActive; // shared media / files / links checkbox background for selected rows +overviewCheckBorder: windowBg; // shared media round checkbox border overviewCheckFg: windowBg; // shared files / links checkbox icon for not selected rows when some rows are selected overviewCheckFgActive: windowBg; // shared files / links checkbox icon for selected rows overviewPhotoSelectOverlay: #40ace333; // shared photos / videos / links fill for selected rows diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index 1a1b0224c..4975bb951 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -2249,8 +2249,6 @@ namespace { prepareCorners(EmojiHoverCorners, st::buttonRadius, st::emojiPanHover); prepareCorners(StickerHoverCorners, st::buttonRadius, st::emojiPanHover); prepareCorners(BotKeyboardCorners, st::buttonRadius, st::botKbBg); - prepareCorners(BotKeyboardOverCorners, st::buttonRadius, st::botKbOverBg); - prepareCorners(BotKeyboardDownCorners, st::buttonRadius, st::botKbDownBg); prepareCorners(PhotoSelectOverlayCorners, st::buttonRadius, st::overviewPhotoSelectOverlay); prepareCorners(Doc1Corners, st::buttonRadius, st::msgFile1Bg); diff --git a/Telegram/SourceFiles/history/history.style b/Telegram/SourceFiles/history/history.style index 32a73ca4c..71455cc2a 100644 --- a/Telegram/SourceFiles/history/history.style +++ b/Telegram/SourceFiles/history/history.style @@ -330,10 +330,6 @@ msgBotKbButton: BotKeyboardButton { } botKbDuration: 200; -botKbBg: menuBgOver; -botKbOverBg: menuBgOver; -botKbDownBg: menuBgRipple; -botKbColor: windowBoldFgOver; botKbStyle: TextStyle(defaultTextStyle) { font: font(15px semibold); linkFont: font(15px semibold); @@ -344,7 +340,9 @@ botKbButton: BotKeyboardButton { padding: 10px; height: 38px; textTop: 9px; - ripple: defaultRippleAnimation; + ripple: RippleAnimation(defaultRippleAnimation) { + color: botKbDownBg; + } } botKbTinyButton: BotKeyboardButton { margin: 4px; diff --git a/Telegram/SourceFiles/layout.h b/Telegram/SourceFiles/layout.h index 8cd340ac2..333db4394 100644 --- a/Telegram/SourceFiles/layout.h +++ b/Telegram/SourceFiles/layout.h @@ -50,8 +50,6 @@ enum RoundCorners { EmojiHoverCorners, StickerHoverCorners, BotKeyboardCorners, - BotKeyboardOverCorners, - BotKeyboardDownCorners, PhotoSelectOverlayCorners, Doc1Corners, diff --git a/Telegram/SourceFiles/overview/overview.style b/Telegram/SourceFiles/overview/overview.style index 7af7d945c..abeed341c 100644 --- a/Telegram/SourceFiles/overview/overview.style +++ b/Telegram/SourceFiles/overview/overview.style @@ -53,6 +53,8 @@ overviewLeftMax: 42px; overviewCheckPressedSize: 0.8; overviewCheck: RoundCheckbox(defaultRoundCheckbox) { bgInactive: overviewCheckBg; + bgActive: overviewCheckBgActive; + border: overviewCheckBorder; size: 29px; sizeSmall: 0.3; check: icon {{ "overview_photo_check", overviewCheckFgActive, point(4px, 8px) }}; @@ -65,7 +67,7 @@ overviewPhotoMinSize: minPhotoSize; overviewVideoBg: imageBg; overviewFileThumbBg: imageBg; -overviewFileChecked: windowBgActive; +overviewFileChecked: overviewCheckBgActive; overviewFileCheck: overviewCheckBg; overviewFileExtPadding: 5px; overviewFileExtTop: 24px; @@ -129,7 +131,7 @@ overviewLinksCheck: icon { { "overview_links_check", overviewCheckFg, point(4px, 5px) }, }; overviewLinksChecked: icon { - { "overview_links_check_bg", windowBgActive }, + { "overview_links_check_bg", overviewCheckBgActive }, { "overview_links_check", overviewCheckFgActive, point(4px, 5px) }, }; diff --git a/Telegram/SourceFiles/overview/overview_layout.cpp b/Telegram/SourceFiles/overview/overview_layout.cpp index 04bfb019d..2bfcc8bea 100644 --- a/Telegram/SourceFiles/overview/overview_layout.cpp +++ b/Telegram/SourceFiles/overview/overview_layout.cpp @@ -742,7 +742,8 @@ void Document::paint(Painter &p, const QRect &clip, TextSelection selection, con int32 nameleft = 0, nametop = 0, nameright = 0, statustop = 0, datetop = -1; bool wthumb = withThumb(); - if (_data->song()) { + auto isSong = (_data->song() != nullptr); + if (isSong) { nameleft = _st.songPadding.left() + _st.songThumbSize + _st.songPadding.right(); nameright = _st.songPadding.left(); nametop = _st.songNameTop; @@ -873,7 +874,7 @@ void Document::paint(Painter &p, const QRect &clip, TextSelection selection, con if (clip.intersects(rtlrect(nameleft, statustop, availwidth, st::normalFont->height, _width))) { p.setFont(st::normalFont); - p.setPen(st::mediaInFg); + p.setPen((isSong && selected) ? st::mediaInFgSelected : st::mediaInFg); p.drawTextLeft(nameleft, statustop, _width, _status.text()); } if (datetop >= 0 && clip.intersects(rtlrect(nameleft, datetop, _datew, st::normalFont->height, _width))) { diff --git a/Telegram/SourceFiles/ui/widgets/widgets.style b/Telegram/SourceFiles/ui/widgets/widgets.style index b0ab85272..ef402c71b 100644 --- a/Telegram/SourceFiles/ui/widgets/widgets.style +++ b/Telegram/SourceFiles/ui/widgets/widgets.style @@ -564,7 +564,7 @@ defaultInputFont: font(17px); defaultFlatInput: FlatInput { textColor: windowFg; bgColor: filterInputInactiveBg; - bgActive: windowBg; + bgActive: filterInputActiveBg; width: 210px; height: 40px; align: align(left);