diff --git a/Telegram/Resources/basic.style b/Telegram/Resources/basic.style index 48d2ec1ad..48417db17 100644 --- a/Telegram/Resources/basic.style +++ b/Telegram/Resources/basic.style @@ -37,10 +37,10 @@ emojiPadding: 1px; lineWidth: 1px; defaultTooltip: Tooltip { - textBg: #eef2f5; - textFg: #5d6c80; + textBg: tooltipBg; + textFg: tooltipFg; textFont: normalFont; - textBorder: #c9d1db; + textBorder: tooltipBorderFg; textPadding: margins(5px, 2px, 5px, 2px); shift: point(-20px, 20px); @@ -50,20 +50,11 @@ defaultTooltip: Tooltip { linesMax: 12; } -statusFont: font(fsize); -statusFg: #999999; -statusFgActive: #0080c0; -statusFgTyping: statusFgActive; - -versionColor: #777777; - -shadowColor: #00000018; shadowToggleDuration: 200; slideDuration: 240; slideShift: 100px; -slideFadeOutBg: #0000003c; -slideShadow: icon {{ "slide_shadow", windowShadowFg }}; +slideShadow: icon {{ "slide_shadow", slideFadeOutShadowFg }}; linkCropLimit: 360px; linkFont: normalFont; @@ -76,7 +67,7 @@ setLittleSkip: 9px; noContactsHeight: 100px; noContactsFont: font(fsize); -noContactsColor: #777777; +noContactsColor: windowSubTextFg; activeFadeInDuration: 500; activeFadeOutDuration: 3000; @@ -95,54 +86,19 @@ msgPadding: margins(13px, 7px, 13px, 8px); msgMargin: margins(16px, 6px, 56px, 2px); msgMarginTopAttached: 1px; msgLnkPadding: 2px; // for media open / save links -msgBorder: #f0f0f0; -msgInBg: #ffffff; -msgInBgSelected: #c2dcf2; // #358cd4 with 30% opacity -msgOutBg: #effdde; -msgOutBgSelected: #b7dbdb; -msgSelectOverlay: #358cd44c; -msgStickerOverlay: #358cd47f; -msgInServiceFg: windowActiveTextFg; -msgInServiceFgSelected: windowActiveTextFg; -msgOutServiceFg: #3a8e26; -msgOutServiceFgSelected: #367570; msgShadow: 2px; -msgInShadow: #748ea229; -msgInShadowSelected: #548dbb29; -msgOutShadow: #3ac34740; -msgOutShadowSelected: #37a78e40; -msgInDateFg: #a0acb6; -msgInDateFgSelected: #6a9cc5; -msgOutDateFg: #6cc264; -msgOutDateFgSelected: #50a79c; msgReplyPadding: margins(6px, 6px, 11px, 6px); msgReplyBarPos: point(1px, 0px); msgReplyBarSize: size(2px, 36px); msgReplyBarSkip: 10px; -msgInReplyBarColor: activeLineFg; -msgInReplyBarSelColor: activeLineFg; -msgOutReplyBarColor: historyOutIconFg; -msgOutReplyBarSelColor: historyOutIconFgSelected; -msgImgReplyBarColor: #ffffff; - -msgServiceBg: #89a0b47f; -msgServiceSelectBg: #bbc8d4a2; -msgServiceColor: #ffffff; msgServicePadding: margins(12px, 3px, 12px, 4px); msgServiceMargin: margins(10px, 10px, 80px, 2px); -msgColor: #000000; -msgDateColor: #000000; - msgDateSpace: 12px; msgDateDelta: point(2px, 5px); msgDateImgDelta: 4px; -msgDateImgColor: #ffffff; -msgDateImgBg: #00000054; -msgDateImgBgOver: #00000074; -msgDateImgBgSelected: #1c4a7187; msgDateImgPadding: point(8px, 2px); msgDateImgCheckSpace: 4px; @@ -151,7 +107,7 @@ defaultTextStyle: TextStyle { linkFlagsOver: font(fsize underline); linkFg: windowActiveTextFg; linkFgDown: windowActiveTextFg; - monoFg: #777777; + monoFg: windowSubTextFg; selectBg: msgInBgSelected; selectOverlay: msgSelectOverlay; lineHeight: 0px; @@ -159,19 +115,19 @@ defaultTextStyle: TextStyle { serviceTextStyle: TextStyle(defaultTextStyle) { linkFlags: msgServiceFont; linkFlagsOver: font(fsize semibold underline); - linkFg: msgServiceColor; - linkFgDown: msgServiceColor; - monoFg: msgServiceColor; - selectBg: msgServiceSelectBg; - selectOverlay: msgServiceSelectBg; + linkFg: msgServiceFg; + linkFgDown: msgServiceFg; + monoFg: msgServiceFg; + selectBg: msgServiceBgSelected; + selectOverlay: msgServiceBgSelected; } inTextStyle: TextStyle(defaultTextStyle) { - monoFg: #4e7391; + monoFg: msgInMonoFg; selectBg: msgInBgSelected; selectOverlay: msgSelectOverlay; } outTextStyle: TextStyle(defaultTextStyle) { - monoFg: #469165; + monoFg: msgOutMonoFg; selectBg: msgOutBgSelected; selectOverlay: msgSelectOverlay; } @@ -193,9 +149,9 @@ outFwdTextStyleSelected: TextStyle(inFwdTextStyle) { linkFg: msgOutServiceFgSelected; linkFgDown: msgOutServiceFgSelected; } -medviewSaveAsTextStyle: TextStyle(defaultTextStyle) { - linkFg: #91d9ff; - linkFgDown: #91d9ff; +mediaviewTextStyle: TextStyle(defaultTextStyle) { + linkFg: mediaviewTextLinkFg; + linkFgDown: mediaviewTextLinkFg; } mediaPadding: margins(0px, 0px, 0px, 0px); @@ -204,14 +160,6 @@ mediaInBubbleSkip: 5px; mediaThumbSize: 48px; mediaNameTop: 3px; mediaDetailsShift: 3px; -mediaInFg: msgInDateFg; -mediaInFgSelected: msgInDateFgSelected; -mediaOutFg: msgOutDateFg; -mediaOutFgSelected: msgOutDateFgSelected; -mediaInUnreadFg: #999999; -mediaInUnreadFgSelected: #7b95aa; -mediaOutUnreadFg: #6aad60; -mediaOutUnreadFgSelected: #5aa382; mediaUnreadSize: 7px; mediaUnreadSkip: 5px; mediaUnreadTop: 6px; @@ -225,23 +173,6 @@ mediaInStyleSelected: TextStyle(defaultTextStyle) { linkFgDown: mediaInFgSelected; } -msgFileRedColor: #e47272; -msgFileYellowColor: #efc274; -msgFileGreenColor: #61b96e; -msgFileBlueColor: #72b1df; -msgFileRedDark: #cd5b5e; -msgFileYellowDark: #e6a561; -msgFileGreenDark: #4da859; -msgFileBlueDark: #5c9ece; -msgFileRedOver: #c35154; -msgFileYellowOver: #dc9c5a; -msgFileGreenOver: #44a050; -msgFileBlueOver: #5294c4; -msgFileRedSelected: #9f6a82; -msgFileYellowSelected: #b19d84; -msgFileGreenSelected: #46a07e; -msgFileBlueSelected: #5099d0; - msgFileMenuSize: size(36px, 36px); msgFileSize: 44px; msgFilePadding: margins(14px, 12px, 11px, 12px); @@ -250,19 +181,9 @@ msgFileThumbPadding: margins(10px, 10px, 14px, 10px); msgFileThumbNameTop: 12px; msgFileThumbStatusTop: 32px; msgFileThumbLinkTop: 60px; -msgFileThumbLinkInFg: lightButtonFg; -msgFileThumbLinkInFgSelected: lightButtonFgOver; -msgFileThumbLinkOutFg: #5eba5b; -msgFileThumbLinkOutFgSelected: #31a298; msgFileNameTop: 16px; msgFileStatusTop: 37px; msgFileMinWidth: 294px; -msgFileInBg: windowBgActive; -msgFileInBgOver: #4eade3; -msgFileInBgSelected: #51a3d3; -msgFileOutBg: #78c67f; -msgFileOutBgOver: #6bc272; -msgFileOutBgSelected: #5fb389; msgFileOverDuration: 200; msgFileRadialLine: 3px; @@ -273,56 +194,28 @@ msgWaveformBar: 2px; msgWaveformSkip: 1px; msgWaveformMin: 2px; msgWaveformMax: 20px; -msgWaveformInActive: windowBgActive; -msgWaveformInActiveSelected: #51a3d3; -msgWaveformInInactive: #d4dee6; -msgWaveformInInactiveSelected: #9cc1e1; -msgWaveformOutActive: #78c67f; -msgWaveformOutActiveSelected: #6badad; -msgWaveformOutInactive: #b3e2b4; -msgWaveformOutInactiveSelected: #91c3c3; textRectMargins: margins(-2px, -1px, -2px, -1px); -newMsgSound: ":/gui/art/newmsg.wav"; - -unreadBarHeight: 32px; -unreadBarMargin: 8px; -unreadBarFont: semiboldFont; -unreadBarBG: #fcfbfa; -unreadBarBorder: shadowColor; -unreadBarColor: #538bb4; - -searchedBarHeight: unreadBarHeight; +searchedBarHeight: 32px; searchedBarFont: normalFont; -searchedBarBg: windowBgOver; -searchedBarBorder: unreadBarBorder; -searchedBarFg: windowSubTextFgOver; searchedBarPosition: point(17px, 7px); -simpleCloseIcon: icon {{ "simple_close", #c7c7c7 }}; -simpleCloseIconOver: icon {{ "simple_close", #a3a3a3 }}; +smallCloseIcon: icon {{ "simple_close", smallCloseIconFg }}; +smallCloseIconOver: icon {{ "simple_close", smallCloseIconFgOver }}; dialogsForwardCancelIcon: icon {{ "simple_close", dialogsForwardFg }}; -forwardMargins: margins(30px, 10px, 30px, 10px); -forwardFont: font(16px); -forwardBg: #0000004c; -forwardFg: #ffffff; - emojiTextFont: font(15px); emojiReplaceWidth: 52px; emojiReplaceHeight: 56px; emojiReplaceInnerHeight: 42px; emojiReplacePadding: 14px; -connectingBG: #ffffffee; -connectingColor: #777777; connectingPadding: margins(5px, 5px, 5px, 5px); -dragBg: #ffffff; dragFont: font(28px semibold); dragSubfont: font(20px semibold); -dragColor: #777777; +dragColor: windowSubTextFg; dragDropColor: windowActiveTextFg; dragMargin: margins(0px, 10px, 0px, 10px); @@ -337,19 +230,17 @@ maxGifSize: 320px; maxSignatureSize: 144px; mvThickFont: semiboldFont; -mvFont: font(fsize); +mvFont: normalFont; mvTextLeft: 16px; mvTextSkip: 10px; mvHeaderTop: 48px; mvTextTop: 24px; -mvTextColor: #ffffff; mvTextOpacity: 0.5; mvTextOverOpacity: 1; mvIconOpacity: 0.45; mvIconOverOpacity: 1; -mvControlFg: #ffffff; mvControlBgOpacity: 0.3; mvControlMargin: 0px; mvControlSize: 90px; @@ -366,34 +257,28 @@ mvSwipeDistance: 80px; mvCaptionPadding: margins(18px, 10px, 18px, 10px); mvCaptionMargin: size(11px, 11px); mvCaptionRadius: 2px; -mvCaptionFg: #ffffff; -mvCaptionBg: #11111180; mvCaptionFont: font(fsize); -medviewSaveMsgCheck: icon {{ "mediaview_save_check", #ffffff }}; +medviewSaveMsgCheck: icon {{ "mediaview_save_check", mediaviewSaveMsgFg }}; medviewSaveMsgFont: font(16px); medviewSaveMsgPadding: margins(55px, 19px, 29px, 20px); medviewSaveMsgCheckPos: point(23px, 21px); medviewSaveMsgShowing: 200; medviewSaveMsgShown: 2000; medviewSaveMsgHiding: 2500; -medviewSaveMsgFg: #ffffff; -medviewSaveMsg: #000000b2; radialSize: size(50px, 50px); radialLine: 3px; radialDuration: 350; radialPeriod: 3000; -radialFg: #ffffff; -radialBg: #00000056; youtubeIcon: icon { - { "media_youtube_play_bg", #e83131c8 }, - { "media_youtube_play", #ffffff, point(24px, 12px) }, + { "media_youtube_play_bg", youtubePlayIconBg }, + { "media_youtube_play", youtubePlayIconFg, point(24px, 12px) }, }; videoIcon: icon { - { "media_video_play_bg", #0000007f }, - { "media_video_play", #ffffff, point(12px, 12px) }, + { "media_video_play_bg", videoPlayIconBg }, + { "media_video_play", videoPlayIconFg, point(12px, 12px) }, }; locationSize: size(320px, 240px); @@ -424,7 +309,7 @@ inlineTitleFg: windowFg; inlineDescriptionFg: windowSubTextFg; inlineRowMargin: 6px; inlineRowBorder: 1px; -inlineRowBorderFg: #eaeaea; +inlineRowBorderFg: shadowFg; inlineRowFileNameTop: 2px; inlineRowFileDescriptionTop: 23px; inlineResultsMinWidth: 64px; @@ -433,8 +318,6 @@ inlineDurationMargin: 3px; toastFont: normalFont; toastMaxWidth: 480px; toastMinMargin: 13px; -toastBg: medviewSaveMsg; -toastFg: #ffffff; toastPadding: margins(19px, 13px, 19px, 12px); toastFadeInDuration: 200; toastFadeOutDuration: 1000; diff --git a/Telegram/Resources/colors.palette b/Telegram/Resources/colors.palette index cb6817f4c..581147caf 100644 --- a/Telegram/Resources/colors.palette +++ b/Telegram/Resources/colors.palette @@ -33,7 +33,11 @@ windowBgActive: #40a7e3; // bright blue: fallback for blue filled active areas windowFgActive: #ffffff; // text on bright blue: fallback for text on active areas windowActiveTextFg: #168acd; // online blue: fallback for active color windowShadowFg: #000000; // black: fallback for shadow color -windowShadowFgFallback: #cdcdcd; // gray: fallback for shadow without opacity +windowShadowFgFallback: #f1f1f1; // gray: fallback for shadow without opacity + +shadowFg: #00000018; +slideFadeOutBg: #0000003c; +slideFadeOutShadowFg: windowShadowFg; imageBg: #000000; imageBgTransparent: #ffffff; @@ -47,6 +51,7 @@ activeButtonFgOver: activeButtonFg; activeButtonSecondaryFg: #cceeff; activeButtonSecondaryFgOver: activeButtonSecondaryFg; activeLineFg: #37a1de; +activeLineFgError: #e48383; lightButtonBg: windowBg; lightButtonBgOver: #e3f1fa; @@ -59,11 +64,43 @@ attentionButtonFgOver: #d14e4e; attentionButtonBgOver: #fcdfde; attentionButtonBgRipple: #f4c3c2; +outlineButtonBg: windowBg; +outlineButtonBgOver: lightButtonBgOver; +outlineButtonOutlineFg: windowBgActive; +outlineButtonBgRipple: lightButtonBgRipple; + menuBg: windowBg; menuBgOver: windowBgOver; menuBgRipple: windowBgRipple; menuIconFg: #a8a8a8; menuIconFgOver: #999999; +menuSubmenuArrowFg: #373737; +menuFgDisabled: #cccccc; +menuSeparatorFg: #f1f1f1; + +scrollBarBg: #00000053; +scrollBarBgOver: #0000007a; +scrollBg: #0000001a; +scrollBgOver: #0000002c; + +smallCloseIconFg: #c7c7c7; +smallCloseIconFgOver: #a3a3a3; + +radialFg: windowFgActive; +radialBg: #00000056; + +placeholderFg: windowSubTextFg; +placeholderFgActive: #aaaaaa; +inputBorderFg: #e0e0e0; +filterInputBorderFg: #54c3f3; +checkboxFg: #b3b3b3; + +sliderBgInactive: #e1eaef; +sliderBgActive: windowBgActive; + +tooltipBg: #eef2f5; +tooltipFg: #5d6c80; +tooltipBorderFg: #c9d1db; // custom title bar for Windows and macOS titleBg: windowBgOver; @@ -72,7 +109,7 @@ titleButtonFg: #ababab; titleButtonBgOver: #e5e5e5; titleButtonFgOver: #9a9a9a; titleButtonCloseBgOver: #e81123; -titleButtonCloseFgOver: #ffffff; +titleButtonCloseFgOver: windowFgActive; titleFgActive: #3e3c3e; titleFg: #acacac; @@ -112,23 +149,23 @@ contactsStatusFg: windowSubTextFg; contactsStatusFgOver: windowSubTextFgOver; contactsStatusFgOnline: windowActiveTextFg; -photoCropFadeBg: #0000007f; +photoCropFadeBg: layerBg; photoCropPointFg: #ffffff7f; -// settings -notificationsBoxMonitorFg: windowFg; - -notificationSampleUserpicFg: windowBgActive; -notificationSampleCloseFg: #d7d7d7 | windowSubTextFg; -notificationSampleTextFg: #d7d7d7 | windowSubTextFg; -notificationSampleNameFg: #939393 | windowSubTextFg; - // intro introBg: windowBg; introTitleFg: windowBoldFg; introDescriptionFg: windowSubTextFg; introErrorFg: windowSubTextFg; +introCoverTopBg: #0f89d0; +introCoverBottomBg: #39b0f0; +introCoverIconsFg: #5ec6ff; +introCoverPlaneTrace: #5ec6ff69; +introCoverPlaneInner: #c6d8e8; +introCoverPlaneOuter: #a1bed4; +introCoverPlaneTop: #ffffff; + // dialogs dialogsMenuIconFg: menuIconFg; dialogsMenuIconFgOver: menuIconFgOver; @@ -181,6 +218,10 @@ dialogsUnreadFgActive: dialogsBgActive; dialogsForwardBg: dialogsBgActive; dialogsForwardFg: dialogsNameFgActive; +searchedBarBg: windowBgOver; +searchedBarBorder: shadowFg; +searchedBarFg: windowSubTextFgOver; + // history topBarBg: windowBg; @@ -188,8 +229,157 @@ emojiPanBg: windowBg; emojiPanCategories: #f7f7f7 | windowBg; emojiPanHeaderFg: windowSubTextFg; emojiPanHeaderBg: #fffffff2 | emojiPanBg; +stickerPanDeleteBg: #000000cc; +stickerPanDeleteFg: windowFgActive; +stickerPreviewBg: #ffffffb0; -historyComposeAreaBg: windowBg; +historyTextInFg: windowFg; +historyTextOutFg: windowFg; +historyCaptionInFg: historyTextInFg; +historyCaptionOutFg: historyTextOutFg; +historyFileNameInFg: historyTextInFg; +historyFileNameOutFg: historyTextOutFg; +historyOutIconFg: dialogsSentIconFg; +historyOutIconFgSelected: #4da79f; +historyIconFgInverted: windowFgActive; +historySendingOutIconFg: #98d292; +historySendingInIconFg: #a0adb5; +historySendingInvertedIconFg: #ffffffc8; + +historySystemBg: #89a0b47f; +historySystemBgSelected: #bbc8d4a2; +historySystemFg: windowFgActive; + +historyUnreadBarBg: #fcfbfa; +historyUnreadBarBorder: shadowFg; +historyUnreadBarFg: #538bb4; + +historyForwardChooseBg: #0000004c; +historyForwardChooseFg: windowFgActive; + +historyPeer1NameFg: #c03d33; // red +historyPeer1UserpicBg: #ed9482; +historyPeer1UserpicFg: #d3644b; +historyPeer2NameFg: #4fad2d; // green +historyPeer2UserpicBg: #a8db92; +historyPeer2UserpicFg: #75c057; +historyPeer3NameFg: #d09306; // yellow +historyPeer3UserpicBg: #efd289; +historyPeer3UserpicFg: #e4a861; +historyPeer4NameFg: windowActiveTextFg; // blue +historyPeer4UserpicBg: #8fbfe9; +historyPeer4UserpicFg: #649fd3; +historyPeer5NameFg: #8544d6; // purple +historyPeer5UserpicBg: #9992e4; +historyPeer5UserpicFg: #7b72cf; +historyPeer6NameFg: #cd4073; // pink +historyPeer6UserpicBg: #ffa9c3; +historyPeer6UserpicFg: #e87497; +historyPeer7NameFg: #2996ad; // sea +historyPeer7UserpicBg: #8eccdb; +historyPeer7UserpicFg: #5eb2c7; +historyPeer8NameFg: #ce671b; // orange +historyPeer8UserpicBg: #f7b37c; +historyPeer8UserpicFg: #de8d62; + +historyScrollBarBg: #556e837a; +historyScrollBarBgOver: #556e83bc; +historyScrollBg: #556e834c; +historyScrollBgOver: #556e836b; + +msgInBg: windowBg; +msgInBgSelected: #c2dcf2; // #358cd4 with 30% opacity +msgOutBg: #effdde; +msgOutBgSelected: #b7dbdb; +msgSelectOverlay: #358cd44c; +msgStickerOverlay: #358cd47f; +msgInServiceFg: windowActiveTextFg; +msgInServiceFgSelected: windowActiveTextFg; +msgOutServiceFg: #3a8e26; +msgOutServiceFgSelected: #367570; +msgInShadow: #748ea229; +msgInShadowSelected: #548dbb29; +msgOutShadow: #3ac34740; +msgOutShadowSelected: #37a78e40; +msgInDateFg: #a0acb6; +msgInDateFgSelected: #6a9cc5; +msgOutDateFg: #6cc264; +msgOutDateFgSelected: #50a79c; +msgServiceFg: windowFgActive; +msgServiceBg: #556e837f; +msgServiceBgSelected: #8ca0b3a2; +msgInReplyBarColor: activeLineFg; +msgInReplyBarSelColor: activeLineFg; +msgOutReplyBarColor: historyOutIconFg; +msgOutReplyBarSelColor: historyOutIconFgSelected; +msgImgReplyBarColor: msgServiceFg; +msgInMonoFg: #4e7391; +msgOutMonoFg: #469165; +msgDateImgFg: msgServiceFg; +msgDateImgBg: #00000054; +msgDateImgBgOver: #00000074; +msgDateImgBgSelected: #1c4a7187; + +msgFileThumbLinkInFg: lightButtonFg; +msgFileThumbLinkInFgSelected: lightButtonFgOver; +msgFileThumbLinkOutFg: #5eba5b; +msgFileThumbLinkOutFgSelected: #31a298; +msgFileInBg: windowBgActive; +msgFileInBgOver: #4eade3; +msgFileInBgSelected: #51a3d3; +msgFileOutBg: #78c67f; +msgFileOutBgOver: #6bc272; +msgFileOutBgSelected: #5fb389; + +msgFile1Bg: #72b1df; // blue +msgFile1BgDark: #5c9ece; +msgFile1BgOver: #5294c4; +msgFile1BgSelected: #5099d0; +msgFile2Bg: #61b96e; // green +msgFile2BgDark: #4da859; +msgFile2BgOver: #44a050; +msgFile2BgSelected: #46a07e; +msgFile3Bg: #e47272; // red +msgFile3BgDark: #cd5b5e; +msgFile3BgOver: #c35154; +msgFile3BgSelected: #9f6a82; +msgFile4Bg: #efc274; // yellow +msgFile4BgDark: #e6a561; +msgFile4BgOver: #dc9c5a; +msgFile4BgSelected: #b19d84; + +msgWaveformInActive: windowBgActive; +msgWaveformInActiveSelected: #51a3d3; +msgWaveformInInactive: #d4dee6; +msgWaveformInInactiveSelected: #9cc1e1; +msgWaveformOutActive: #78c67f; +msgWaveformOutActiveSelected: #6badad; +msgWaveformOutInactive: #b3e2b4; +msgWaveformOutInactiveSelected: #91c3c3; + +msgBotKbOverBgAdd: #ffffff20; +msgBotKbIconFg: msgServiceFg; +msgBotKbRippleBg: #00000020; + +mediaInFg: msgInDateFg; +mediaInFgSelected: msgInDateFgSelected; +mediaOutFg: msgOutDateFg; +mediaOutFgSelected: msgOutDateFgSelected; + +youtubePlayIconBg: #e83131c8; +youtubePlayIconFg: windowFgActive; +videoPlayIconBg: #0000007f; +videoPlayIconFg: #ffffff; +toastBg: #000000b2; +toastFg: windowFgActive; + +reportSpamBg: emojiPanHeaderBg; +reportSpamFg: windowFg; + +historyToDownShadow: #00000040; +historyComposeAreaBg: msgInBg; +historyComposeAreaFg: historyTextInFg; +historyComposeAreaFgService: msgInDateFg; historyComposeIconFg: menuIconFg; historyComposeIconFgOver: menuIconFgOver; historySendIconFg: windowBgActive; @@ -203,19 +393,32 @@ historyComposeButtonBg: historyComposeAreaBg; historyComposeButtonBgOver: windowBgOver; historyComposeButtonBgRipple: windowBgRipple; -historyTextInFg: windowFg; -historyTextOutFg: windowFg; -historyCaptionInFg: historyTextInFg; -historyCaptionOutFg: historyTextOutFg; -historyFileNameInFg: historyTextInFg; -historyFileNameOutFg: historyTextOutFg; -historyOutIconFg: dialogsSentIconFg; -historyOutIconFgSelected: #4da79f; -historyIconFgInverted: #ffffff; +// overview +overviewCheckBg: #00000040; +overviewCheckFg: windowBg; +overviewCheckFgActive: windowBg; +overviewPhotoSelectOverlay: #40ace333; -historySystemBg: #89a0b47f; -historySystemBgSelected: #bbc8d4a2; -historySystemFg: #ffffff; +// profile +profileStatusFgOver: #7c99b2; + +// settings +notificationsBoxMonitorFg: windowFg; +notificationsBoxScreenBg: dialogsBgActive; // #6389a8; + +notificationSampleUserpicFg: windowBgActive; +notificationSampleCloseFg: #d7d7d7 | windowSubTextFg; +notificationSampleTextFg: #d7d7d7 | windowSubTextFg; +notificationSampleNameFg: #939393 | windowSubTextFg; + +mainMenuBg: windowBg; +mainMenuCoverBg: dialogsBgActive; +mainMenuCoverFg: windowFgActive; + +mediaPlayerBg: windowBg; +mediaPlayerActiveFg: windowBgActive; +mediaPlayerInactiveFg: sliderBgInactive; +mediaPlayerDisabledFg: #9dd1ef; // mediaview mediaviewFileBg: windowBg; @@ -230,11 +433,27 @@ mediaviewFileExtFg: activeButtonFg; mediaviewMenuBg: #383838; mediaviewMenuBgOver: #505050; mediaviewMenuBgRipple: #676767; -mediaviewMenuFg: #ffffff; +mediaviewMenuFg: windowFgActive; mediaviewBg: #222222eb; -mediaviewVideoBg: #000000; +mediaviewVideoBg: imageBg; mediaviewControlBg: #0000003c; +mediaviewControlFg: windowFgActive; +mediaviewCaptionBg: #11111180; +mediaviewCaptionFg: mediaviewControlFg; +mediaviewTextLinkFg: #91d9ff; +mediaviewSaveMsgBg: toastBg; +mediaviewSaveMsgFg: toastFg; + +mediaviewPlaybackActive: #c7c7c7; +mediaviewPlaybackInactive: #252525; +mediaviewPlaybackActiveOver: #ffffff; +mediaviewPlaybackInactiveOver: #474747; +mediaviewPlaybackProgressFg: #ffffffc7; +mediaviewPlaybackIconFg: mediaviewPlaybackActive; +mediaviewPlaybackIconFgOver: mediaviewPlaybackActiveOver; +mediaviewTransparentBg: #ffffff; +mediaviewTransparentFg: #cccccc; // notification notificationBg: windowBg; diff --git a/Telegram/Resources/sample.tdesktop-theme b/Telegram/Resources/sample.tdesktop-theme index a0c0a3342..de0283463 100644 --- a/Telegram/Resources/sample.tdesktop-theme +++ b/Telegram/Resources/sample.tdesktop-theme @@ -34,7 +34,10 @@ windowBgActive: #40a7e3; windowFgActive: #ffffff; windowActiveTextFg: #168acd; windowShadowFg: #000000; -windowShadowFgFallback: #cdcdcd; +windowShadowFgFallback: #f1f1f1; +shadowFg: #00000018; +slideFadeOutBg: #0000003c; +slideFadeOutShadowFg: windowShadowFg; imageBg: #000000; imageBgTransparent: #ffffff; activeButtonBg: windowBgActive; @@ -45,6 +48,7 @@ activeButtonFgOver: activeButtonFg; activeButtonSecondaryFg: #cceeff; activeButtonSecondaryFgOver: activeButtonSecondaryFg; activeLineFg: #37a1de; +activeLineFgError: #e48383; lightButtonBg: windowBg; lightButtonBgOver: #e3f1fa; lightButtonBgRipple: #c9e4f6; @@ -54,18 +58,43 @@ attentionButtonFg: #d14e4e; attentionButtonFgOver: #d14e4e; attentionButtonBgOver: #fcdfde; attentionButtonBgRipple: #f4c3c2; +outlineButtonBg: windowBg; +outlineButtonBgOver: lightButtonBgOver; +outlineButtonOutlineFg: windowBgActive; +outlineButtonBgRipple: lightButtonBgRipple; menuBg: windowBg; menuBgOver: windowBgOver; menuBgRipple: windowBgRipple; menuIconFg: #a8a8a8; menuIconFgOver: #999999; +menuSubmenuArrowFg: #373737; +menuFgDisabled: #cccccc; +menuSeparatorFg: #f1f1f1; +scrollBarBg: #00000053; +scrollBarBgOver: #0000007a; +scrollBg: #0000001a; +scrollBgOver: #0000002c; +smallCloseIconFg: #c7c7c7; +smallCloseIconFgOver: #a3a3a3; +radialFg: windowFgActive; +radialBg: #00000056; +placeholderFg: windowSubTextFg; +placeholderFgActive: #aaaaaa; +inputBorderFg: #e0e0e0; +filterInputBorderFg: #54c3f3; +checkboxFg: #b3b3b3; +sliderBgInactive: #e1eaef; +sliderBgActive: windowBgActive; +tooltipBg: #eef2f5; +tooltipFg: #5d6c80; +tooltipBorderFg: #c9d1db; titleBg: windowBgOver; titleShadow: #00000003; titleButtonFg: #ababab; titleButtonBgOver: #e5e5e5; titleButtonFgOver: #9a9a9a; titleButtonCloseBgOver: #e81123; -titleButtonCloseFgOver: #ffffff; +titleButtonCloseFgOver: windowFgActive; titleFgActive: #3e3c3e; titleFg: #acacac; trayCounterBg: #f23c34; @@ -94,17 +123,19 @@ contactsNameFg: boxTextFg; contactsStatusFg: windowSubTextFg; contactsStatusFgOver: windowSubTextFgOver; contactsStatusFgOnline: windowActiveTextFg; -photoCropFadeBg: #0000007f; +photoCropFadeBg: layerBg; photoCropPointFg: #ffffff7f; -notificationsBoxMonitorFg: windowFg; -notificationSampleUserpicFg: windowBgActive; -notificationSampleCloseFg: #d7d7d7; // windowSubTextFg; -notificationSampleTextFg: #d7d7d7; // windowSubTextFg; -notificationSampleNameFg: #939393; // windowSubTextFg; introBg: windowBg; introTitleFg: windowBoldFg; introDescriptionFg: windowSubTextFg; introErrorFg: windowSubTextFg; +introCoverTopBg: #0f89d0; +introCoverBottomBg: #39b0f0; +introCoverIconsFg: #5ec6ff; +introCoverPlaneTrace: #5ec6ff69; +introCoverPlaneInner: #c6d8e8; +introCoverPlaneOuter: #a1bed4; +introCoverPlaneTop: #ffffff; dialogsMenuIconFg: menuIconFg; dialogsMenuIconFgOver: menuIconFgOver; dialogsBg: windowBg; @@ -151,12 +182,150 @@ dialogsUnreadBgMutedActive: dialogsDraftFgActive; dialogsUnreadFgActive: dialogsBgActive; dialogsForwardBg: dialogsBgActive; dialogsForwardFg: dialogsNameFgActive; +searchedBarBg: windowBgOver; +searchedBarBorder: shadowFg; +searchedBarFg: windowSubTextFgOver; topBarBg: windowBg; emojiPanBg: windowBg; emojiPanCategories: #f7f7f7; // windowBg; emojiPanHeaderFg: windowSubTextFg; emojiPanHeaderBg: #fffffff2; // emojiPanBg; -historyComposeAreaBg: windowBg; +stickerPanDeleteBg: #000000cc; +stickerPanDeleteFg: windowFgActive; +stickerPreviewBg: #ffffffb0; +historyTextInFg: windowFg; +historyTextOutFg: windowFg; +historyCaptionInFg: historyTextInFg; +historyCaptionOutFg: historyTextOutFg; +historyFileNameInFg: historyTextInFg; +historyFileNameOutFg: historyTextOutFg; +historyOutIconFg: dialogsSentIconFg; +historyOutIconFgSelected: #4da79f; +historyIconFgInverted: windowFgActive; +historySendingOutIconFg: #98d292; +historySendingInIconFg: #a0adb5; +historySendingInvertedIconFg: #ffffffc8; +historySystemBg: #89a0b47f; +historySystemBgSelected: #bbc8d4a2; +historySystemFg: windowFgActive; +historyUnreadBarBg: #fcfbfa; +historyUnreadBarBorder: shadowFg; +historyUnreadBarFg: #538bb4; +historyForwardChooseBg: #0000004c; +historyForwardChooseFg: windowFgActive; +historyPeer1NameFg: #c03d33; +historyPeer1UserpicBg: #ed9482; +historyPeer1UserpicFg: #d3644b; +historyPeer2NameFg: #4fad2d; +historyPeer2UserpicBg: #a8db92; +historyPeer2UserpicFg: #75c057; +historyPeer3NameFg: #d09306; +historyPeer3UserpicBg: #efd289; +historyPeer3UserpicFg: #e4a861; +historyPeer4NameFg: windowActiveTextFg; +historyPeer4UserpicBg: #8fbfe9; +historyPeer4UserpicFg: #649fd3; +historyPeer5NameFg: #8544d6; +historyPeer5UserpicBg: #9992e4; +historyPeer5UserpicFg: #7b72cf; +historyPeer6NameFg: #cd4073; +historyPeer6UserpicBg: #ffa9c3; +historyPeer6UserpicFg: #e87497; +historyPeer7NameFg: #2996ad; +historyPeer7UserpicBg: #8eccdb; +historyPeer7UserpicFg: #5eb2c7; +historyPeer8NameFg: #ce671b; +historyPeer8UserpicBg: #f7b37c; +historyPeer8UserpicFg: #de8d62; +historyScrollBarBg: #556e837a; +historyScrollBarBgOver: #556e83bc; +historyScrollBg: #556e834c; +historyScrollBgOver: #556e836b; +msgInBg: windowBg; +msgInBgSelected: #c2dcf2; +msgOutBg: #effdde; +msgOutBgSelected: #b7dbdb; +msgSelectOverlay: #358cd44c; +msgStickerOverlay: #358cd47f; +msgInServiceFg: windowActiveTextFg; +msgInServiceFgSelected: windowActiveTextFg; +msgOutServiceFg: #3a8e26; +msgOutServiceFgSelected: #367570; +msgInShadow: #748ea229; +msgInShadowSelected: #548dbb29; +msgOutShadow: #3ac34740; +msgOutShadowSelected: #37a78e40; +msgInDateFg: #a0acb6; +msgInDateFgSelected: #6a9cc5; +msgOutDateFg: #6cc264; +msgOutDateFgSelected: #50a79c; +msgServiceFg: windowFgActive; +msgServiceBg: #556e837f; +msgServiceBgSelected: #8ca0b3a2; +msgInReplyBarColor: activeLineFg; +msgInReplyBarSelColor: activeLineFg; +msgOutReplyBarColor: historyOutIconFg; +msgOutReplyBarSelColor: historyOutIconFgSelected; +msgImgReplyBarColor: msgServiceFg; +msgInMonoFg: #4e7391; +msgOutMonoFg: #469165; +msgDateImgFg: msgServiceFg; +msgDateImgBg: #00000054; +msgDateImgBgOver: #00000074; +msgDateImgBgSelected: #1c4a7187; +msgFileThumbLinkInFg: lightButtonFg; +msgFileThumbLinkInFgSelected: lightButtonFgOver; +msgFileThumbLinkOutFg: #5eba5b; +msgFileThumbLinkOutFgSelected: #31a298; +msgFileInBg: windowBgActive; +msgFileInBgOver: #4eade3; +msgFileInBgSelected: #51a3d3; +msgFileOutBg: #78c67f; +msgFileOutBgOver: #6bc272; +msgFileOutBgSelected: #5fb389; +msgFile1Bg: #72b1df; +msgFile1BgDark: #5c9ece; +msgFile1BgOver: #5294c4; +msgFile1BgSelected: #5099d0; +msgFile2Bg: #61b96e; +msgFile2BgDark: #4da859; +msgFile2BgOver: #44a050; +msgFile2BgSelected: #46a07e; +msgFile3Bg: #e47272; +msgFile3BgDark: #cd5b5e; +msgFile3BgOver: #c35154; +msgFile3BgSelected: #9f6a82; +msgFile4Bg: #efc274; +msgFile4BgDark: #e6a561; +msgFile4BgOver: #dc9c5a; +msgFile4BgSelected: #b19d84; +msgWaveformInActive: windowBgActive; +msgWaveformInActiveSelected: #51a3d3; +msgWaveformInInactive: #d4dee6; +msgWaveformInInactiveSelected: #9cc1e1; +msgWaveformOutActive: #78c67f; +msgWaveformOutActiveSelected: #6badad; +msgWaveformOutInactive: #b3e2b4; +msgWaveformOutInactiveSelected: #91c3c3; +msgBotKbOverBgAdd: #ffffff20; +msgBotKbIconFg: msgServiceFg; +msgBotKbRippleBg: #00000020; +mediaInFg: msgInDateFg; +mediaInFgSelected: msgInDateFgSelected; +mediaOutFg: msgOutDateFg; +mediaOutFgSelected: msgOutDateFgSelected; +youtubePlayIconBg: #e83131c8; +youtubePlayIconFg: windowFgActive; +videoPlayIconBg: #0000007f; +videoPlayIconFg: #ffffff; +toastBg: #000000b2; +toastFg: windowFgActive; +reportSpamBg: emojiPanHeaderBg; +reportSpamFg: windowFg; +historyToDownShadow: #00000040; +historyComposeAreaBg: msgInBg; +historyComposeAreaFg: historyTextInFg; +historyComposeAreaFgService: msgInDateFg; historyComposeIconFg: menuIconFg; historyComposeIconFgOver: menuIconFgOver; historySendIconFg: windowBgActive; @@ -168,18 +337,24 @@ historyReplyCancelFgOver: cancelIconFgOver; historyComposeButtonBg: historyComposeAreaBg; historyComposeButtonBgOver: windowBgOver; historyComposeButtonBgRipple: windowBgRipple; -historyTextInFg: windowFg; -historyTextOutFg: windowFg; -historyCaptionInFg: historyTextInFg; -historyCaptionOutFg: historyTextOutFg; -historyFileNameInFg: historyTextInFg; -historyFileNameOutFg: historyTextOutFg; -historyOutIconFg: dialogsSentIconFg; -historyOutIconFgSelected: #4da79f; -historyIconFgInverted: #ffffff; -historySystemBg: #89a0b47f; -historySystemBgSelected: #bbc8d4a2; -historySystemFg: #ffffff; +overviewCheckBg: #00000040; +overviewCheckFg: windowBg; +overviewCheckFgActive: windowBg; +overviewPhotoSelectOverlay: #40ace333; +profileStatusFgOver: #7c99b2; +notificationsBoxMonitorFg: windowFg; +notificationsBoxScreenBg: dialogsBgActive; +notificationSampleUserpicFg: windowBgActive; +notificationSampleCloseFg: #d7d7d7; // windowSubTextFg; +notificationSampleTextFg: #d7d7d7; // windowSubTextFg; +notificationSampleNameFg: #939393; // windowSubTextFg; +mainMenuBg: windowBg; +mainMenuCoverBg: dialogsBgActive; +mainMenuCoverFg: windowFgActive; +mediaPlayerBg: windowBg; +mediaPlayerActiveFg: windowBgActive; +mediaPlayerInactiveFg: sliderBgInactive; +mediaPlayerDisabledFg: #9dd1ef; mediaviewFileBg: windowBg; mediaviewFileNameFg: windowFg; mediaviewFileSizeFg: windowSubTextFg; @@ -191,8 +366,23 @@ mediaviewFileExtFg: activeButtonFg; mediaviewMenuBg: #383838; mediaviewMenuBgOver: #505050; mediaviewMenuBgRipple: #676767; -mediaviewMenuFg: #ffffff; +mediaviewMenuFg: windowFgActive; mediaviewBg: #222222eb; -mediaviewVideoBg: #000000; +mediaviewVideoBg: imageBg; mediaviewControlBg: #0000003c; +mediaviewControlFg: windowFgActive; +mediaviewCaptionBg: #11111180; +mediaviewCaptionFg: mediaviewControlFg; +mediaviewTextLinkFg: #91d9ff; +mediaviewSaveMsgBg: toastBg; +mediaviewSaveMsgFg: toastFg; +mediaviewPlaybackActive: #c7c7c7; +mediaviewPlaybackInactive: #252525; +mediaviewPlaybackActiveOver: #ffffff; +mediaviewPlaybackInactiveOver: #474747; +mediaviewPlaybackProgressFg: #ffffffc7; +mediaviewPlaybackIconFg: mediaviewPlaybackActive; +mediaviewPlaybackIconFgOver: mediaviewPlaybackActiveOver; +mediaviewTransparentBg: #ffffff; +mediaviewTransparentFg: #cccccc; notificationBg: windowBg; diff --git a/Telegram/Resources/winrc/Telegram.rc b/Telegram/Resources/winrc/Telegram.rc index 140880783..2c1f11d24 100644 --- a/Telegram/Resources/winrc/Telegram.rc +++ b/Telegram/Resources/winrc/Telegram.rc @@ -34,8 +34,8 @@ IDI_ICON1 ICON "..\\art\\icon256.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,10,20,2 - PRODUCTVERSION 0,10,20,2 + FILEVERSION 0,10,20,3 + PRODUCTVERSION 0,10,20,3 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -51,10 +51,10 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "CompanyName", "Telegram Messenger LLP" - VALUE "FileVersion", "0.10.20.2" + VALUE "FileVersion", "0.10.20.3" VALUE "LegalCopyright", "Copyright (C) 2014-2016" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "0.10.20.2" + VALUE "ProductVersion", "0.10.20.3" END END BLOCK "VarFileInfo" diff --git a/Telegram/Resources/winrc/Updater.rc b/Telegram/Resources/winrc/Updater.rc index 99f3e1769..addf208f0 100644 --- a/Telegram/Resources/winrc/Updater.rc +++ b/Telegram/Resources/winrc/Updater.rc @@ -25,8 +25,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,10,20,2 - PRODUCTVERSION 0,10,20,2 + FILEVERSION 0,10,20,3 + PRODUCTVERSION 0,10,20,3 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -43,10 +43,10 @@ BEGIN BEGIN VALUE "CompanyName", "Telegram Messenger LLP" VALUE "FileDescription", "Telegram Updater" - VALUE "FileVersion", "0.10.20.2" + VALUE "FileVersion", "0.10.20.3" VALUE "LegalCopyright", "Copyright (C) 2014-2016" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "0.10.20.2" + VALUE "ProductVersion", "0.10.20.3" END END BLOCK "VarFileInfo" diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index 31e395ef0..5c1db03dc 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -2226,17 +2226,17 @@ namespace { } prepareCorners(MenuCorners, st::buttonRadius, st::menuBg); prepareCorners(BoxCorners, st::boxRadius, st::boxBg); - prepareCorners(BotKbOverCorners, st::dateRadius, st::msgBotKbOverBg); + prepareCorners(BotKbOverCorners, st::dateRadius, st::msgBotKbOverBgAdd); prepareCorners(StickerCorners, st::dateRadius, st::msgServiceBg); - prepareCorners(StickerSelectedCorners, st::dateRadius, st::msgServiceSelectBg); + prepareCorners(StickerSelectedCorners, st::dateRadius, st::msgServiceBgSelected); prepareCorners(SelectedOverlaySmallCorners, st::buttonRadius, st::msgSelectOverlay); prepareCorners(SelectedOverlayLargeCorners, msgRadius(), st::msgSelectOverlay); prepareCorners(DateCorners, st::dateRadius, st::msgDateImgBg); prepareCorners(DateSelectedCorners, st::dateRadius, st::msgDateImgBgSelected); prepareCorners(InShadowCorners, msgRadius(), st::msgInShadow); prepareCorners(InSelectedShadowCorners, msgRadius(), st::msgInShadowSelected); - prepareCorners(ForwardCorners, msgRadius(), st::forwardBg); - prepareCorners(MediaviewSaveCorners, st::mediaviewControllerRadius, st::medviewSaveMsg); + prepareCorners(ForwardCorners, msgRadius(), st::historyForwardChooseBg); + prepareCorners(MediaviewSaveCorners, st::mediaviewControllerRadius, st::mediaviewSaveMsgBg); prepareCorners(EmojiHoverCorners, st::buttonRadius, st::emojiPanHover); prepareCorners(StickerHoverCorners, st::buttonRadius, st::emojiPanHover); prepareCorners(BotKeyboardCorners, st::buttonRadius, st::botKbBg); @@ -2244,10 +2244,10 @@ namespace { prepareCorners(BotKeyboardDownCorners, st::buttonRadius, st::botKbDownBg); prepareCorners(PhotoSelectOverlayCorners, st::buttonRadius, st::overviewPhotoSelectOverlay); - prepareCorners(DocBlueCorners, st::buttonRadius, st::msgFileBlueColor); - prepareCorners(DocGreenCorners, st::buttonRadius, st::msgFileGreenColor); - prepareCorners(DocRedCorners, st::buttonRadius, st::msgFileRedColor); - prepareCorners(DocYellowCorners, st::buttonRadius, st::msgFileYellowColor); + prepareCorners(Doc1Corners, st::buttonRadius, st::msgFile1Bg); + prepareCorners(Doc2Corners, st::buttonRadius, st::msgFile2Bg); + prepareCorners(Doc3Corners, st::buttonRadius, st::msgFile3Bg); + prepareCorners(Doc4Corners, st::buttonRadius, st::msgFile4Bg); prepareCorners(MessageInCorners, msgRadius(), st::msgInBg, &st::msgInShadow); prepareCorners(MessageInSelectedCorners, msgRadius(), st::msgInBgSelected, &st::msgInShadowSelected); @@ -2309,7 +2309,7 @@ namespace { delete ::corners[StickerSelectedCorners].p[i]; ::corners[StickerSelectedCorners].p[i] = nullptr; } prepareCorners(StickerCorners, st::dateRadius, st::msgServiceBg); - prepareCorners(StickerSelectedCorners, st::dateRadius, st::msgServiceSelectBg); + prepareCorners(StickerSelectedCorners, st::dateRadius, st::msgServiceBgSelected); if (App::main()) { App::main()->updateScrollColors(); diff --git a/Telegram/SourceFiles/boxes/abstractbox.cpp b/Telegram/SourceFiles/boxes/abstractbox.cpp index 8afbc33f9..90b3d3855 100644 --- a/Telegram/SourceFiles/boxes/abstractbox.cpp +++ b/Telegram/SourceFiles/boxes/abstractbox.cpp @@ -51,6 +51,7 @@ void BoxContent::setInner(object_ptr inner, const style::ScrollArea &st if (!_scroll) { _scroll.create(this, st); connect(_scroll, SIGNAL(scrolled()), this, SLOT(onScroll())); + connect(_scroll, SIGNAL(innerResized()), this, SLOT(onInnerResize())); _topShadow.create(this, object_ptr(this)); _bottomShadow.create(this, object_ptr(this)); @@ -92,28 +93,36 @@ void BoxContent::onDraggingScrollTimer() { } void BoxContent::updateInnerVisibleTopBottom() { - if (auto widget = static_cast(_scroll->widget())) { + if (auto widget = static_cast(_scroll ? _scroll->widget() : nullptr)) { auto top = _scroll->scrollTop(); widget->setVisibleTopBottom(top, top + _scroll->height()); } } -void BoxContent::onScroll() { - if (_scroll) { - updateInnerVisibleTopBottom(); +void BoxContent::updateShadowsVisibility() { + if (!_scroll) return; - auto top = _scroll->scrollTop(); - if (top > 0 || _innerTopSkip > 0) { - _topShadow->showAnimated(); - } else { - _topShadow->hideAnimated(); - } - if (top < _scroll->scrollTopMax()) { - _bottomShadow->showAnimated(); - } else { - _bottomShadow->hideAnimated(); - } + auto top = _scroll->scrollTop(); + if (top > 0 || _innerTopSkip > 0) { + _topShadow->showAnimated(); + } else { + _topShadow->hideAnimated(); } + if (top < _scroll->scrollTopMax()) { + _bottomShadow->showAnimated(); + } else { + _bottomShadow->hideAnimated(); + } +} + +void BoxContent::onScroll() { + updateInnerVisibleTopBottom(); + updateShadowsVisibility(); +} + +void BoxContent::onInnerResize() { + updateInnerVisibleTopBottom(); + updateShadowsVisibility(); } void BoxContent::setInnerTopSkip(int innerTopSkip, bool scrollBottomFixed) { diff --git a/Telegram/SourceFiles/boxes/abstractbox.h b/Telegram/SourceFiles/boxes/abstractbox.h index 834f0337f..89fa7641b 100644 --- a/Telegram/SourceFiles/boxes/abstractbox.h +++ b/Telegram/SourceFiles/boxes/abstractbox.h @@ -148,6 +148,7 @@ protected: private slots: void onScroll(); + void onInnerResize(); void onDraggingScrollTimer(); @@ -156,6 +157,7 @@ private: void setInner(object_ptr inner, const style::ScrollArea &st); void updateScrollAreaGeometry(); void updateInnerVisibleTopBottom(); + void updateShadowsVisibility(); object_ptr doTakeInnerWidget(); BoxContentDelegate *getDelegate() const { diff --git a/Telegram/SourceFiles/boxes/boxes.style b/Telegram/SourceFiles/boxes/boxes.style index 0c57435ff..18ccce2e8 100644 --- a/Telegram/SourceFiles/boxes/boxes.style +++ b/Telegram/SourceFiles/boxes/boxes.style @@ -79,7 +79,7 @@ boxLayerTitlePosition: point(23px, 16px); boxLayerTitleHeight: 56px; boxLayerTitleAdditionalSkip: 9px; boxLayerTitleAdditionalFont: normalFont; -boxLayerTitleShadow: #0000001a; +boxLayerTitleShadow: shadowFg; boxLayerScroll: defaultSolidScroll; boxTopMargin: 6px; @@ -146,7 +146,7 @@ boxPhotoTitlePosition: point(28px, 20px); boxPhotoPadding: margins(28px, 28px, 28px, 18px); boxPhotoCompressedSkip: 20px; boxPhotoCaptionSkip: 8px; -boxPhotoTextFg: #808080; +boxPhotoTextFg: windowSubTextFg; cropPointSize: 10px; cropSkip: 13px; @@ -157,7 +157,7 @@ confirmInviteTitle: FlatLabel(defaultFlatLabel) { align: align(center); width: 320px; maxHeight: 24px; - textFg: #333333; + textFg: windowBoldFg; } confirmInviteStatus: FlatLabel(defaultFlatLabel) { font: font(boxFontSize); @@ -199,8 +199,8 @@ aboutRevokePublicLabel: FlatLabel(defaultFlatLabel) { textFg: windowFg; } -contactUserIcon: icon {{ "add_contact_user", #999999 }}; -contactPhoneIcon: icon {{ "add_contact_phone", #999999 }}; +contactUserIcon: icon {{ "add_contact_user", menuIconFg }}; +contactPhoneIcon: icon {{ "add_contact_phone", menuIconFg }}; contactIconTop: 28px; contactsAddIconAbove: icon {{ "contacts_add", activeButtonFg, point(18px, 18px) }}; @@ -235,7 +235,6 @@ contactsCheckPosition: point(8px, 16px); contactsAllAdminsTop: 15px; contactsAboutBg: windowBgOver; contactsAboutFg: windowSubTextFgOver; -contactsAboutShadow: #0000001F; contactsAboutTop: 60px; contactsAboutBottom: 19px; @@ -277,16 +276,15 @@ contactsMultiSelect: MultiSelect { textBg: transparent; textMargins: margins(2px, 7px, 2px, 0px); - placeholderFg: #999999; - placeholderFgActive: #aaaaaa; - placeholderFgError: #aaaaaa; + placeholderFg: placeholderFg; + placeholderFgActive: placeholderFgActive; + placeholderFgError: placeholderFgActive; placeholderMargins: margins(2px, 0px, 2px, 0px); placeholderScale: 0.; placeholderFont: normalFont; border: 0px; borderActive: 0px; - borderError: 0px; heightMin: 32px; @@ -329,8 +327,8 @@ contactsPhotoCheckbox: RoundImageCheckbox { check: icon {{ "default_checkbox_check", windowFgActive, point(3px, 6px) }}; } } -contactsPhotoDisabledCheckFg: #bbbbbb; -contactsNameCheckedFg: #2b88b8; +contactsPhotoDisabledCheckFg: menuIconFg; +contactsNameCheckedFg: windowActiveTextFg; contactsRipple: defaultRippleAnimation; contactsMarginTop: 4px; @@ -360,7 +358,6 @@ notificationsBoxMonitorTop: 63px; notificationsBoxMonitor: icon {{ "monitor", notificationsBoxMonitorFg }}; notificationsBoxScreenTop: 10px; notificationsBoxScreenSize: size(280px, 160px); -notificationsBoxScreenBg: #6389a8; notificationsBoxCountLabelTop: 80px; notificationsBoxCountTop: 30px; @@ -383,17 +380,17 @@ sessionPadding: margins(21px, 10px, 21px, 0px); sessionNameFont: msgNameFont; sessionNameFg: boxTextFg; sessionWhenFont: msgDateFont; -sessionWhenFg: #aaaaaa; +sessionWhenFg: windowSubTextFg; sessionInfoFont: msgFont; -sessionInfoFg: #888888; +sessionInfoFg: windowSubTextFg; sessionTerminateTop: 28px; sessionTerminateSkip: 22px; sessionTerminate: IconButton { width: 20px; height: 20px; - icon: simpleCloseIcon; - iconOver: simpleCloseIconOver; + icon: smallCloseIcon; + iconOver: smallCloseIconOver; iconPosition: point(5px, 5px); rippleAreaPosition: point(0px, 0px); @@ -421,7 +418,7 @@ passcodeTextLine: 28px; passcodeLittleSkip: 5px; passcodeSkip: 20px; -newGroupAboutFg: #808080; +newGroupAboutFg: windowSubTextFg; newGroupPadding: margins(4px, 6px, 4px, 3px); newGroupSkip: 27px; newGroupInfoPadding: margins(0px, -4px, 0px, 1px); @@ -431,7 +428,7 @@ newGroupLinkTop: 3px; newGroupLinkFont: font(16px); newGroupPhotoSize: 76px; -newGroupPhotoIcon: icon {{ "new_chat_photo", #ffffff }}; +newGroupPhotoIcon: icon {{ "new_chat_photo", activeButtonFg }}; newGroupPhotoIconPosition: point(23px, 25px); newGroupPhotoDuration: 150; @@ -521,6 +518,6 @@ usernameSkip: 49px; usernameTextStyle: TextStyle(defaultTextStyle) { lineHeight: 20px; } -usernameDefaultFg: #777777; +usernameDefaultFg: windowSubTextFg; downloadPathSkip: 10px; diff --git a/Telegram/SourceFiles/boxes/contactsbox.cpp b/Telegram/SourceFiles/boxes/contactsbox.cpp index a8f1f3803..ce20acadb 100644 --- a/Telegram/SourceFiles/boxes/contactsbox.cpp +++ b/Telegram/SourceFiles/boxes/contactsbox.cpp @@ -1103,7 +1103,7 @@ void ContactsBox::Inner::paintEvent(QPaintEvent *e) { } else if (_chat && _membersFilter == MembersFilter::Admins) { text = lang(lng_contacts_loading); p.fillRect(0, 0, width(), _aboutHeight - st::contactsPadding.bottom() - st::lineWidth, st::contactsAboutBg); - p.fillRect(0, _aboutHeight - st::contactsPadding.bottom() - st::lineWidth, width(), st::lineWidth, st::shadowColor); + p.fillRect(0, _aboutHeight - st::contactsPadding.bottom() - st::lineWidth, width(), st::lineWidth, st::shadowFg); int aboutw = width() - st::contactsPadding.left() - st::contactsPadding.right(); (_allAdmins->checked() ? _aboutAllAdmins : _aboutAdmins).draw(p, st::contactsPadding.left(), st::contactsAboutTop, aboutw); diff --git a/Telegram/SourceFiles/boxes/stickers_box.cpp b/Telegram/SourceFiles/boxes/stickers_box.cpp index ac5ffaf9d..ee28607f6 100644 --- a/Telegram/SourceFiles/boxes/stickers_box.cpp +++ b/Telegram/SourceFiles/boxes/stickers_box.cpp @@ -210,8 +210,8 @@ void StickersBox::getArchivedDone(uint64 offsetId, const MTPmessages_ArchivedSti if (addedSet) { _archived.widget()->updateSize(); } else { - _allArchivedLoaded = v.isEmpty() || (offsetId != 0); - if (changedSets && !_allArchivedLoaded) { + _allArchivedLoaded = v.isEmpty() || (!changedSets && offsetId != 0); + if (changedSets) { loadMoreArchived(); } } diff --git a/Telegram/SourceFiles/boxes/stickersetbox.cpp b/Telegram/SourceFiles/boxes/stickersetbox.cpp index 7f1571b75..12e7e40e7 100644 --- a/Telegram/SourceFiles/boxes/stickersetbox.cpp +++ b/Telegram/SourceFiles/boxes/stickersetbox.cpp @@ -277,6 +277,10 @@ void StickerSetBox::Inner::mouseMoveEvent(QMouseEvent *e) { } } +void StickerSetBox::Inner::leaveEvent(QEvent *e) { + setSelected(-1); +} + void StickerSetBox::Inner::mouseReleaseEvent(QMouseEvent *e) { if (_previewShown >= 0) { _previewShown = -1; @@ -296,13 +300,14 @@ void StickerSetBox::Inner::mouseReleaseEvent(QMouseEvent *e) { } void StickerSetBox::Inner::updateSelected() { - auto index = stickerFromGlobalPos(QCursor::pos()); - if (isMasksSet()) { - index = -1; - } - if (index != _selected) { + auto selected = stickerFromGlobalPos(QCursor::pos()); + setSelected(isMasksSet() ? -1 : selected); +} + +void StickerSetBox::Inner::setSelected(int selected) { + if (_selected != selected) { startOverAnimation(_selected, 1., 0.); - _selected = index; + _selected = selected; startOverAnimation(_selected, 0., 1.); setCursor(_selected >= 0 ? style::cur_pointer : style::cur_default); } diff --git a/Telegram/SourceFiles/boxes/stickersetbox.h b/Telegram/SourceFiles/boxes/stickersetbox.h index 0e92a20ad..dd11173ff 100644 --- a/Telegram/SourceFiles/boxes/stickersetbox.h +++ b/Telegram/SourceFiles/boxes/stickersetbox.h @@ -86,6 +86,7 @@ protected: void mouseMoveEvent(QMouseEvent *e) override; void mouseReleaseEvent(QMouseEvent *e) override; void paintEvent(QPaintEvent *e) override; + void leaveEvent(QEvent *e) override; private slots: void onPreview(); @@ -96,6 +97,7 @@ signals: private: void updateSelected(); + void setSelected(int selected); void startOverAnimation(int index, float64 from, float64 to); int stickerFromGlobalPos(const QPoint &p) const; diff --git a/Telegram/SourceFiles/codegen/style/parsed_file.cpp b/Telegram/SourceFiles/codegen/style/parsed_file.cpp index 2652104d0..beaf36b9d 100644 --- a/Telegram/SourceFiles/codegen/style/parsed_file.cpp +++ b/Telegram/SourceFiles/codegen/style/parsed_file.cpp @@ -510,7 +510,7 @@ structure::Value ParsedFile::readStringValue() { structure::Value ParsedFile::readColorValue() { if (auto numberSign = file_.getToken(BasicType::Number)) { - if (options_.isPalette || true) { // enable for now + if (options_.isPalette) { auto color = file_.getAnyToken(); if (color.type == BasicType::Int || color.type == BasicType::Name) { auto chars = tokenValue(color).toLower(); diff --git a/Telegram/SourceFiles/core/version.h b/Telegram/SourceFiles/core/version.h index 414a4859c..7cd9723c4 100644 --- a/Telegram/SourceFiles/core/version.h +++ b/Telegram/SourceFiles/core/version.h @@ -22,7 +22,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include "core/utils.h" -#define BETA_VERSION_MACRO (10020002ULL) +#define BETA_VERSION_MACRO (10020003ULL) constexpr int AppVersion = 10020; constexpr str_const AppVersionStr = "0.10.20"; diff --git a/Telegram/SourceFiles/dialogs/dialogs.style b/Telegram/SourceFiles/dialogs/dialogs.style index 5b0c06a3b..e4582101c 100644 --- a/Telegram/SourceFiles/dialogs/dialogs.style +++ b/Telegram/SourceFiles/dialogs/dialogs.style @@ -104,8 +104,8 @@ dialogsUnlockIconOver: icon {{ "dialogs_unlock", dialogsMenuIconFgOver }}; dialogsFilter: FlatInput(defaultFlatInput) { font: font(fsize); - phColor: #949494; - phFocusColor: #a4a4a4; + phColor: placeholderFg; + phFocusColor: placeholderFgActive; width: 240px; height: 32px; @@ -169,10 +169,10 @@ dialogsVerifiedIconActive: icon { { "dialogs_verified_check", dialogsVerifiedIconFgActive, point(7px, 7px) }, }; -historySendingIcon: icon {{ "dialogs_sending", #98d292, point(5px, 5px) }}; -historySendingInvertedIcon: icon {{ "dialogs_sending", #ffffffc8, point(5px, 5px) }}; -historyViewsSendingIcon: icon {{ "dialogs_sending", #a0adb5, point(3px, 0px) }}; -historyViewsSendingInvertedIcon: icon {{ "dialogs_sending", #ffffffc8, point(3px, 0px) }}; +historySendingIcon: icon {{ "dialogs_sending", historySendingOutIconFg, point(5px, 5px) }}; +historySendingInvertedIcon: icon {{ "dialogs_sending", historySendingInvertedIconFg, point(5px, 5px) }}; +historyViewsSendingIcon: icon {{ "dialogs_sending", historySendingInIconFg, point(3px, 0px) }}; +historyViewsSendingInvertedIcon: icon {{ "dialogs_sending", historySendingInvertedIconFg, point(3px, 0px) }}; dialogsUpdateButton: FlatButton { color: activeButtonFg; diff --git a/Telegram/SourceFiles/dialogswidget.cpp b/Telegram/SourceFiles/dialogswidget.cpp index e224fec04..01e73622d 100644 --- a/Telegram/SourceFiles/dialogswidget.cpp +++ b/Telegram/SourceFiles/dialogswidget.cpp @@ -166,8 +166,8 @@ void DialogsInner::paintRegion(Painter &p, const QRegion ®ion, bool paintingO if (!paintingOther) { auto &tag = result->tag; if (selected) { - int skip = (st::mentionHeight - st::simpleCloseIconOver.height()) / 2; - st::simpleCloseIconOver.paint(p, QPoint(fullWidth - st::simpleCloseIconOver.width() - skip, skip), width()); + int skip = (st::mentionHeight - st::smallCloseIconOver.height()) / 2; + st::smallCloseIconOver.paint(p, QPoint(fullWidth - st::smallCloseIconOver.width() - skip, skip), width()); } auto first = (_hashtagFilter.size() < 2) ? QString() : ('#' + tag.mid(0, _hashtagFilter.size() - 1)); auto second = (_hashtagFilter.size() < 2) ? ('#' + tag) : tag.mid(_hashtagFilter.size() - 1); diff --git a/Telegram/SourceFiles/history/field_autocomplete.cpp b/Telegram/SourceFiles/history/field_autocomplete.cpp index 4f9699b76..b78c84945 100644 --- a/Telegram/SourceFiles/history/field_autocomplete.cpp +++ b/Telegram/SourceFiles/history/field_autocomplete.cpp @@ -593,9 +593,9 @@ void FieldAutocompleteInner::paintEvent(QPaintEvent *e) { bool selected = (i == _sel); if (selected) { p.fillRect(0, i * st::mentionHeight, width(), st::mentionHeight, st::mentionBgOver); - int skip = (st::mentionHeight - st::simpleCloseIconOver.height()) / 2; + int skip = (st::mentionHeight - st::smallCloseIconOver.height()) / 2; if (!_hrows->isEmpty() || (!_mrows->isEmpty() && i < _recentInlineBotsInRows)) { - st::simpleCloseIconOver.paint(p, QPoint(width() - st::simpleCloseIconOver.width() - skip, i * st::mentionHeight + skip), width()); + st::smallCloseIconOver.paint(p, QPoint(width() - st::smallCloseIconOver.width() - skip, i * st::mentionHeight + skip), width()); } } if (!_mrows->isEmpty()) { @@ -681,9 +681,9 @@ void FieldAutocompleteInner::paintEvent(QPaintEvent *e) { } } } - p.fillRect(Adaptive::OneColumn() ? 0 : st::lineWidth, _parent->innerBottom() - st::lineWidth, width() - (Adaptive::OneColumn() ? 0 : st::lineWidth), st::lineWidth, st::shadowColor->b); + p.fillRect(Adaptive::OneColumn() ? 0 : st::lineWidth, _parent->innerBottom() - st::lineWidth, width() - (Adaptive::OneColumn() ? 0 : st::lineWidth), st::lineWidth, st::shadowFg); } - p.fillRect(Adaptive::OneColumn() ? 0 : st::lineWidth, _parent->innerTop(), width() - (Adaptive::OneColumn() ? 0 : st::lineWidth), st::lineWidth, st::shadowColor->b); + p.fillRect(Adaptive::OneColumn() ? 0 : st::lineWidth, _parent->innerTop(), width() - (Adaptive::OneColumn() ? 0 : st::lineWidth), st::lineWidth, st::shadowFg); } void FieldAutocompleteInner::resizeEvent(QResizeEvent *e) { diff --git a/Telegram/SourceFiles/history/history.style b/Telegram/SourceFiles/history/history.style index 15fce02f1..0a701e40e 100644 --- a/Telegram/SourceFiles/history/history.style +++ b/Telegram/SourceFiles/history/history.style @@ -23,10 +23,10 @@ using "dialogs/dialogs.style"; using "ui/widgets/widgets.style"; historyScroll: ScrollArea(defaultScrollArea) { - barColor: #89a0b47a; - bgColor: #89a0b44c; - barOverColor: #89a0b4bc; - bgOverColor: #89a0b46b; + bg: historyScrollBg; + bgOver: historyScrollBgOver; + barBg: historyScrollBarBg; + barBgOver: historyScrollBarBgOver; round: 3px; @@ -42,8 +42,8 @@ historyScroll: ScrollArea(defaultScrollArea) { historyPaddingBottom: 8px; historyToDownPosition: point(12px, 10px); -historyToDownAbove: icon {{ "history_down_arrow", #b9b9b9, point(17px, 23px) }}; -historyToDownAboveOver: icon {{ "history_down_arrow", #a3a3a3, point(17px, 23px) }}; +historyToDownAbove: icon {{ "history_down_arrow", menuIconFg, point(17px, 23px) }}; +historyToDownAboveOver: icon {{ "history_down_arrow", menuIconFgOver, point(17px, 23px) }}; historyToDownPaddingTop: 10px; historyToDown: TwoIconButton { width: 52px; @@ -139,62 +139,38 @@ historyReceivedInvertedIcon: icon {{ "history_received", historyIconFgInverted, historyViewsSpace: 11px; historyViewsWidth: 20px; historyViewsTop: -15px; -historyViewsInIcon: icon {{ "history_views", #a0acb6 }}; -historyViewsInSelectedIcon: icon {{ "history_views", #6a9bc5 }}; +historyViewsInIcon: icon {{ "history_views", msgInDateFg }}; +historyViewsInSelectedIcon: icon {{ "history_views", msgInDateFgSelected }}; historyViewsOutIcon: icon {{ "history_views", historyOutIconFg }}; historyViewsOutSelectedIcon: icon {{ "history_views", historyOutIconFgSelected }}; -historyViewsInvertedIcon: icon {{ "history_views", #ffffffe6 }}; +historyViewsInvertedIcon: icon {{ "history_views", historySendingInvertedIconFg }}; -historyPeer1NameFg: #c03d33; // red -historyPeer1UserpicBg: #ed9482; -historyPeer1UserpicFg: #d3644b; historyPeer1UserpicPerson: icon {{ size(120px, 120px), historyPeer1UserpicBg }, { "userpic_person", historyPeer1UserpicFg }}; historyPeer1UserpicChat: icon {{ size(120px, 120px), historyPeer1UserpicBg }, { "userpic_chat", historyPeer1UserpicFg }}; historyPeer1UserpicChannel: icon {{ size(120px, 120px), historyPeer1UserpicBg }, { "userpic_channel", historyPeer1UserpicFg }}; -historyPeer2NameFg: #4fad2d; // green -historyPeer2UserpicBg: #a8db92; -historyPeer2UserpicFg: #75c057; historyPeer2UserpicPerson: icon {{ size(120px, 120px), historyPeer2UserpicBg }, { "userpic_person", historyPeer2UserpicFg }}; historyPeer2UserpicChat: icon {{ size(120px, 120px), historyPeer2UserpicBg }, { "userpic_chat", historyPeer2UserpicFg }}; historyPeer2UserpicChannel: icon {{ size(120px, 120px), historyPeer2UserpicBg }, { "userpic_channel", historyPeer2UserpicFg }}; -historyPeer3NameFg: #d09306; // yellow -historyPeer3UserpicBg: #efd289; -historyPeer3UserpicFg: #e4a861; historyPeer3UserpicPerson: icon {{ size(120px, 120px), historyPeer3UserpicBg }, { "userpic_person", historyPeer3UserpicFg }}; historyPeer3UserpicChat: icon {{ size(120px, 120px), historyPeer3UserpicBg }, { "userpic_chat", historyPeer3UserpicFg }}; historyPeer3UserpicChannel: icon {{ size(120px, 120px), historyPeer3UserpicBg }, { "userpic_channel", historyPeer3UserpicFg }}; -historyPeer4NameFg: windowActiveTextFg; // blue -historyPeer4UserpicBg: #8fbfe9; -historyPeer4UserpicFg: #649fd3; historyPeer4UserpicPerson: icon {{ size(120px, 120px), historyPeer4UserpicBg }, { "userpic_person", historyPeer4UserpicFg }}; historyPeer4UserpicChat: icon {{ size(120px, 120px), historyPeer4UserpicBg }, { "userpic_chat", historyPeer4UserpicFg }}; historyPeer4UserpicChannel: icon {{ size(120px, 120px), historyPeer4UserpicBg }, { "userpic_channel", historyPeer4UserpicFg }}; -historyPeer5NameFg: #8544d6; // purple -historyPeer5UserpicBg: #9992e4; -historyPeer5UserpicFg: #7b72cf; historyPeer5UserpicPerson: icon {{ size(120px, 120px), historyPeer5UserpicBg }, { "userpic_person", historyPeer5UserpicFg }}; -historyPeer6NameFg: #cd4073; // pink -historyPeer6UserpicBg: #ffa9c3; -historyPeer6UserpicFg: #e87497; historyPeer6UserpicPerson: icon {{ size(120px, 120px), historyPeer6UserpicBg }, { "userpic_person", historyPeer6UserpicFg }}; -historyPeer7NameFg: #2996ad; // sea -historyPeer7UserpicBg: #8eccdb; -historyPeer7UserpicFg: #5eb2c7; historyPeer7UserpicPerson: icon {{ size(120px, 120px), historyPeer7UserpicBg }, { "userpic_person", historyPeer7UserpicFg }}; -historyPeer8NameFg: #ce671b; // orange -historyPeer8UserpicBg: #f7b37c; -historyPeer8UserpicFg: #de8d62; historyPeer8UserpicPerson: icon {{ size(120px, 120px), historyPeer8UserpicBg }, { "userpic_person", historyPeer8UserpicFg }}; historyComposeField: FlatTextarea { - textColor: #000000; + textColor: historyComposeAreaFg; bgColor: historyComposeAreaBg; align: align(left); textMrg: margins(5px, 5px, 5px, 5px); font: msgFont; - phColor: #999999; - phFocusColor: #aaaaaa; + phColor: placeholderFg; + phFocusColor: placeholderFgActive; phAlign: align(topleft); phPos: point(2px, 0px); phShift: 50px; @@ -226,8 +202,8 @@ historyComposeButton: FlatButton { } } historyUnblock: FlatButton(historyComposeButton) { - color: #d15948; - overColor: #d15948; + color: attentionButtonFg; + overColor: attentionButtonFgOver; } historySendIcon: icon {{ "send_control_send", historySendIconFg }}; @@ -288,13 +264,13 @@ historyRecordVoice: icon {{ "send_control_record", historyRecordVoiceFg }}; historyRecordVoiceOver: icon {{ "send_control_record", historyRecordVoiceFgOver }}; historyRecordVoiceActive: icon {{ "send_control_record", historyRecordVoiceFgActive }}; historyRecordVoiceRippleBgActive: lightButtonBgOver; -historyRecordSignalColor: #f17077; +historyRecordSignalColor: attentionButtonFg; historyRecordSignalMin: 5px; historyRecordSignalMax: 12px; -historyRecordCancel: #aaaaaa; -historyRecordCancelActive: #ec6466; +historyRecordCancel: windowSubTextFg; +historyRecordCancelActive: windowActiveTextFg; historyRecordFont: font(13px); -historyRecordDurationFg: #000000; +historyRecordDurationFg: historyComposeAreaFg; historyRecordTextTop: 14px; historySilentToggle: IconButton(historyBotKeyboardShow) { @@ -349,22 +325,19 @@ reportSpamHide: FlatButton { overFont: font(fsize underline); } reportSpamSeparator: 30px; -reportSpamBg: #fffffff0; -reportSpamFg: #000000; msgBotKbDuration: 200; msgBotKbFont: semiboldFont; -msgBotKbOverBg: #ffffff20; msgBotKbIconPadding: 2px; -msgBotKbUrlIcon: icon {{ "inline_button_url", #ffffff }}; -msgBotKbSwitchPmIcon: icon {{ "inline_button_switch", #ffffff }}; +msgBotKbUrlIcon: icon {{ "inline_button_url", msgBotKbIconFg }}; +msgBotKbSwitchPmIcon: icon {{ "inline_button_switch", msgBotKbIconFg }}; msgBotKbButton: BotKeyboardButton { margin: 5px; padding: 10px; height: 36px; textTop: 8px; ripple: RippleAnimation(defaultRippleAnimation) { - color: #00000020; + color: msgBotKbRippleBg; } } @@ -401,12 +374,12 @@ mentionFont: linkFont; mentionNameFg: windowFg; mentionNameFgOver: windowFgOver; mentionPhotoSize: msgPhotoSize; -mentionBg: #ffffff; -mentionBgOver: #f5f5f5; -mentionFg: #777777; -mentionFgOver: #707070; -mentionFgActive: #0080c0; -mentionFgOverActive: #0077b3; +mentionBg: windowBg; +mentionBgOver: windowBgOver; +mentionFg: windowSubTextFg; +mentionFgOver: windowSubTextFgOver; +mentionFgActive: windowActiveTextFg; +mentionFgOverActive: windowActiveTextFg; historyDateFadeDuration: 200; @@ -420,3 +393,14 @@ historyBubbleTailInRight: icon {{ "bubble_tail-flip_horizontal", msgInBg }}; historyBubbleTailInRightSelected: icon {{ "bubble_tail-flip_horizontal", msgInBgSelected }}; historyBubbleTailOutRight: icon {{ "bubble_tail-flip_horizontal", msgOutBg }}; historyBubbleTailOutRightSelected: icon {{ "bubble_tail-flip_horizontal", msgOutBgSelected }}; + +historyStatusFg: windowSubTextFg; +historyStatusFgActive: windowActiveTextFg; +historyStatusFgTyping: historyStatusFgActive; + +historyUnreadBarHeight: 32px; +historyUnreadBarMargin: 8px; +historyUnreadBarFont: semiboldFont; + +historyForwardChooseMargins: margins(30px, 10px, 30px, 10px); +historyForwardChooseFont: font(16px); diff --git a/Telegram/SourceFiles/history/history_item.cpp b/Telegram/SourceFiles/history/history_item.cpp index f85ee2cea..54c53e996 100644 --- a/Telegram/SourceFiles/history/history_item.cpp +++ b/Telegram/SourceFiles/history/history_item.cpp @@ -502,18 +502,18 @@ void HistoryMessageUnreadBar::init(int count) { } int HistoryMessageUnreadBar::height() { - return st::unreadBarHeight + st::unreadBarMargin; + return st::historyUnreadBarHeight + st::historyUnreadBarMargin; } int HistoryMessageUnreadBar::marginTop() { - return st::lineWidth + st::unreadBarMargin; + return st::lineWidth + st::historyUnreadBarMargin; } void HistoryMessageUnreadBar::paint(Painter &p, int y, int w) const { - p.fillRect(0, y + marginTop(), w, height() - marginTop() - st::lineWidth, st::unreadBarBG); - p.fillRect(0, y + height() - st::lineWidth, w, st::lineWidth, st::unreadBarBorder); - p.setFont(st::unreadBarFont); - p.setPen(st::unreadBarColor); + p.fillRect(0, y + marginTop(), w, height() - marginTop() - st::lineWidth, st::historyUnreadBarBg); + p.fillRect(0, y + height() - st::lineWidth, w, st::lineWidth, st::historyUnreadBarBorder); + p.setFont(st::historyUnreadBarFont); + p.setPen(st::historyUnreadBarFg); int left = st::msgServiceMargin.left(); int maxwidth = w; @@ -522,7 +522,7 @@ void HistoryMessageUnreadBar::paint(Painter &p, int y, int w) const { } w = maxwidth; - p.drawText((w - _width) / 2, y + marginTop() + (st::unreadBarHeight - 2 * st::lineWidth - st::unreadBarFont->height) / 2 + st::unreadBarFont->ascent, _text); + p.drawText((w - _width) / 2, y + marginTop() + (st::historyUnreadBarHeight - 2 * st::lineWidth - st::historyUnreadBarFont->height) / 2 + st::historyUnreadBarFont->ascent, _text); } void HistoryMessageDate::init(const QDateTime &date) { diff --git a/Telegram/SourceFiles/history/history_media_types.cpp b/Telegram/SourceFiles/history/history_media_types.cpp index 089925b3e..db8445fa3 100644 --- a/Telegram/SourceFiles/history/history_media_types.cpp +++ b/Telegram/SourceFiles/history/history_media_types.cpp @@ -783,7 +783,7 @@ void HistoryVideo::draw(Painter &p, const QRect &r, TextSelection selection, Tim int32 statusH = st::normalFont->height + 2 * st::msgDateImgPadding.y(); App::roundRect(p, rtlrect(statusX - st::msgDateImgPadding.x(), statusY - st::msgDateImgPadding.y(), statusW, statusH, _width), selected ? st::msgDateImgBgSelected : st::msgDateImgBg, selected ? DateSelectedCorners : DateCorners); p.setFont(st::normalFont); - p.setPen(st::msgDateImgColor); + p.setPen(st::msgDateImgFg); p.drawTextLeft(statusX, statusY, _width, _statusText, statusW - 2 * st::msgDateImgPadding.x()); // date @@ -1775,7 +1775,7 @@ void HistoryGif::draw(Painter &p, const QRect &r, TextSelection selection, TimeM int32 statusH = st::normalFont->height + 2 * st::msgDateImgPadding.y(); App::roundRect(p, rtlrect(statusX - st::msgDateImgPadding.x(), statusY - st::msgDateImgPadding.y(), statusW, statusH, _width), selected ? st::msgDateImgBgSelected : st::msgDateImgBg, selected ? DateSelectedCorners : DateCorners); p.setFont(st::normalFont); - p.setPen(st::msgDateImgColor); + p.setPen(st::msgDateImgFg); p.drawTextLeft(statusX, statusY, _width, _statusText, statusW - 2 * st::msgDateImgPadding.x()); } } @@ -2055,7 +2055,7 @@ void HistorySticker::draw(Painter &p, const QRect &r, TextSelection selection, T // Make the bottom of the rect at the same level as the bottom of the info rect. recty -= st::msgDateImgDelta; - App::roundRect(p, rectx, recty, rectw, recth, selected ? st::msgServiceSelectBg : st::msgServiceBg, selected ? StickerSelectedCorners : StickerCorners); + App::roundRect(p, rectx, recty, rectw, recth, selected ? st::msgServiceBgSelected : st::msgServiceBg, selected ? StickerSelectedCorners : StickerCorners); rectx += st::msgReplyPadding.left(); rectw -= st::msgReplyPadding.left() + st::msgReplyPadding.right(); if (via) { @@ -2741,7 +2741,7 @@ void HistoryWebPage::draw(Painter &p, const QRect &r, TextSelection selection, T App::roundRect(p, dateX, dateY, dateW, dateH, selected ? st::msgDateImgBgSelected : st::msgDateImgBg, selected ? DateSelectedCorners : DateCorners); p.setFont(st::msgDateFont); - p.setPen(st::msgDateImgColor); + p.setPen(st::msgDateImgFg); p.drawTextLeft(dateX + st::msgDateImgPadding.x(), dateY + st::msgDateImgPadding.y(), pixwidth, _duration); } } @@ -3103,7 +3103,7 @@ void HistoryGame::draw(Painter &p, const QRect &r, TextSelection selection, Time App::roundRect(p, rtlrect(gameX, gameY, gameW, gameH, pixwidth), selected ? st::msgDateImgBgSelected : st::msgDateImgBg, selected ? DateSelectedCorners : DateCorners); p.setFont(st::msgDateFont); - p.setPen(st::msgDateImgColor); + p.setPen(st::msgDateImgFg); p.drawTextLeft(gameX + st::msgDateImgPadding.x(), gameY + st::msgDateImgPadding.y(), pixwidth, lang(lng_game_tag).toUpper()); p.translate(-attachLeft, -attachTop); diff --git a/Telegram/SourceFiles/history/history_message.cpp b/Telegram/SourceFiles/history/history_message.cpp index 4f7233b7d..cd13a87a9 100644 --- a/Telegram/SourceFiles/history/history_message.cpp +++ b/Telegram/SourceFiles/history/history_message.cpp @@ -282,27 +282,27 @@ void HistoryMessageReply::paint(Painter &p, const HistoryItem *holder, int x, in p.drawText(x + st::msgReplyBarSkip + previewSkip + replyToName.maxWidth() + st::msgServiceFont->spacew, y + st::msgReplyPadding.top() + st::msgServiceFont->ascent, _replyToVia->_text); } - HistoryMessage *replyToAsMsg = replyToMsg->toHistoryMessage(); + auto replyToAsMsg = replyToMsg->toHistoryMessage(); if (!(flags & PaintInBubble)) { } else if ((replyToAsMsg && replyToAsMsg->emptyText()) || replyToMsg->serviceMsg()) { auto &date = outbg ? (selected ? st::msgOutDateFgSelected : st::msgOutDateFg) : (selected ? st::msgInDateFgSelected : st::msgInDateFg); p.setPen(date); } else { - p.setPen(st::msgColor); + p.setPen(outbg ? st::historyTextOutFg : st::historyTextInFg); } replyToText.drawLeftElided(p, x + st::msgReplyBarSkip + previewSkip, y + st::msgReplyPadding.top() + st::msgServiceNameFont->height, w - st::msgReplyBarSkip - previewSkip, w + 2 * x); } } else { p.setFont(st::msgDateFont); auto &date = outbg ? (selected ? st::msgOutDateFgSelected : st::msgOutDateFg) : (selected ? st::msgInDateFgSelected : st::msgInDateFg); - p.setPen((flags & PaintInBubble) ? date : st::msgDateImgColor); + p.setPen((flags & PaintInBubble) ? date : st::msgDateImgFg); p.drawTextLeft(x + st::msgReplyBarSkip, y + st::msgReplyPadding.top() + (st::msgReplyBarSize.height() - st::msgDateFont->height) / 2, w + 2 * x, st::msgDateFont->elided(lang(replyToMsgId ? lng_profile_loading : lng_deleted_message), w - st::msgReplyBarSkip)); } } } void HistoryMessage::KeyboardStyle::startPaint(Painter &p) const { - p.setPen(st::msgServiceColor); + p.setPen(st::msgServiceFg); } style::font HistoryMessage::KeyboardStyle::textFont() const { @@ -322,7 +322,7 @@ void HistoryMessage::KeyboardStyle::paintButtonBg(Painter &p, const QRect &rect, if (howMuchOver > 0) { auto o = p.opacity(); p.setOpacity(o * howMuchOver); - App::roundRect(p, rect, st::msgBotKbOverBg, BotKbOverCorners); + App::roundRect(p, rect, st::msgBotKbOverBgAdd, BotKbOverCorners); p.setOpacity(o); } } @@ -1139,12 +1139,12 @@ void HistoryMessage::drawInfo(Painter &p, int32 right, int32 bottom, int32 width case InfoDisplayOverImage: infoRight -= st::msgDateImgDelta + st::msgDateImgPadding.x(); infoBottom -= st::msgDateImgDelta + st::msgDateImgPadding.y(); - p.setPen(st::msgDateImgColor); + p.setPen(st::msgDateImgFg); break; case InfoDisplayOverBackground: infoRight -= st::msgDateImgDelta + st::msgDateImgPadding.x(); infoBottom -= st::msgDateImgDelta + st::msgDateImgPadding.y(); - p.setPen(st::msgServiceColor); + p.setPen(st::msgServiceFg); break; } @@ -1158,7 +1158,7 @@ void HistoryMessage::drawInfo(Painter &p, int32 right, int32 bottom, int32 width App::roundRect(p, dateX - st::msgDateImgPadding.x(), dateY - st::msgDateImgPadding.y(), dateW, dateH, selected ? st::msgDateImgBgSelected : st::msgDateImgBg, selected ? DateSelectedCorners : DateCorners); } else if (type == InfoDisplayOverBackground) { int32 dateW = infoW + 2 * st::msgDateImgPadding.x(), dateH = st::msgDateFont->height + 2 * st::msgDateImgPadding.y(); - App::roundRect(p, dateX - st::msgDateImgPadding.x(), dateY - st::msgDateImgPadding.y(), dateW, dateH, selected ? st::msgServiceSelectBg : st::msgServiceBg, selected ? StickerSelectedCorners : StickerCorners); + App::roundRect(p, dateX - st::msgDateImgPadding.x(), dateY - st::msgDateImgPadding.y(), dateW, dateH, selected ? st::msgServiceBgSelected : st::msgServiceBg, selected ? StickerSelectedCorners : StickerCorners); } dateX += HistoryMessage::timeLeft(); diff --git a/Telegram/SourceFiles/history/history_service_layout.cpp b/Telegram/SourceFiles/history/history_service_layout.cpp index 4560e266f..828df5c06 100644 --- a/Telegram/SourceFiles/history/history_service_layout.cpp +++ b/Telegram/SourceFiles/history/history_service_layout.cpp @@ -177,7 +177,7 @@ void paintPreparedDate(Painter &p, const QString &dateText, int dateTextWidth, i ServiceMessagePainter::paintBubble(p, left, y + st::msgServiceMargin.top(), dateTextWidth + st::msgServicePadding.left() + st::msgServicePadding.left(), height); p.setFont(st::msgServiceFont); - p.setPen(st::msgServiceColor); + p.setPen(st::msgServiceFg); p.drawText(left + st::msgServicePadding.left(), y + st::msgServiceMargin.top() + st::msgServicePadding.top() + st::msgServiceFont->ascent, dateText); } @@ -225,7 +225,7 @@ void ServiceMessagePainter::paint(Painter &p, const HistoryService *message, con } p.setBrush(Qt::NoBrush); - p.setPen(st::msgServiceColor); + p.setPen(st::msgServiceFg); p.setFont(st::msgServiceFont); message->_text.draw(p, trect.x(), trect.y(), trect.width(), Qt::AlignCenter, 0, -1, context.selection, false); diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index de9b4ac77..ba6fd5788 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -2430,7 +2430,7 @@ void ReportSpamPanel::resizeEvent(QResizeEvent *e) { void ReportSpamPanel::paintEvent(QPaintEvent *e) { Painter p(this); p.fillRect(QRect(0, 0, width(), height() - st::lineWidth), st::reportSpamBg); - p.fillRect(Adaptive::OneColumn() ? 0 : st::lineWidth, height() - st::lineWidth, width() - (Adaptive::OneColumn() ? 0 : st::lineWidth), st::lineWidth, st::shadowColor->b); + p.fillRect(Adaptive::OneColumn() ? 0 : st::lineWidth, height() - st::lineWidth, width() - (Adaptive::OneColumn() ? 0 : st::lineWidth), st::lineWidth, st::shadowFg); if (!_clear->isHidden()) { p.setPen(st::reportSpamFg); p.setFont(st::msgFont); @@ -2715,7 +2715,7 @@ void HistoryHider::init() { connect(_cancel, SIGNAL(clicked()), this, SLOT(startHide())); subscribe(Global::RefPeerChooseCancel(), [this] { startHide(); }); - _chooseWidth = st::forwardFont->width(lang(_botAndQuery.isEmpty() ? lng_forward_choose : lng_inline_switch_choose)); + _chooseWidth = st::historyForwardChooseFont->width(lang(_botAndQuery.isEmpty() ? lng_forward_choose : lng_inline_switch_choose)); resizeEvent(0); _a_opacity.start([this] { update(); }, 0., 1., st::boxDuration); @@ -2740,7 +2740,7 @@ void HistoryHider::paintEvent(QPaintEvent *e) { p.fillRect(rect(), st::layerBg); } if (_cacheForAnim.isNull() || !_offered) { - p.setFont(st::forwardFont); + p.setFont(st::historyForwardChooseFont); if (_offered) { Ui::Shadow::paint(p, _box, width(), st::boxRoundShadow); App::roundRect(p, _box, st::boxBg, BoxCorners); @@ -2750,11 +2750,11 @@ void HistoryHider::paintEvent(QPaintEvent *e) { _toText.drawLeftElided(p, _box.left() + st::boxPadding.left(), _box.y() + st::boxTopMargin + st::boxPadding.top(), _toTextWidth + 2, width(), 1, style::al_left); textstyleRestore(); } else { - auto w = st::forwardMargins.left() + _chooseWidth + st::forwardMargins.right(); - auto h = st::forwardMargins.top() + st::forwardFont->height + st::forwardMargins.bottom(); - App::roundRect(p, (width() - w) / 2, (height() - h) / 2, w, h, st::forwardBg, ForwardCorners); + auto w = st::historyForwardChooseMargins.left() + _chooseWidth + st::historyForwardChooseMargins.right(); + auto h = st::historyForwardChooseMargins.top() + st::historyForwardChooseFont->height + st::historyForwardChooseMargins.bottom(); + App::roundRect(p, (width() - w) / 2, (height() - h) / 2, w, h, st::historyForwardChooseBg, ForwardCorners); - p.setPen(st::forwardFg); + p.setPen(st::historyForwardChooseFg); p.drawText(_box, lang(_botAndQuery.isEmpty() ? lng_forward_choose : lng_inline_switch_choose), QTextOption(style::al_center)); } } else { @@ -2844,7 +2844,7 @@ void HistoryHider::resizeEvent(QResizeEvent *e) { } h += st::boxTopMargin + qMax(st::boxTextFont->height, st::boxTextStyle.lineHeight) + st::boxButtonPadding.top() + _send->height() + st::boxButtonPadding.bottom(); } else { - h += st::forwardFont->height; + h += st::historyForwardChooseFont->height; _send->hide(); _cancel->hide(); } @@ -3050,7 +3050,7 @@ HistoryWidget::HistoryWidget(QWidget *parent) : TWidget(parent) , _attachDragDocument(this) , _attachDragPhoto(this) , _fileLoader(this, FileLoaderQueueStopTimeout) -, _topShadow(this, st::shadowColor) { +, _topShadow(this, st::shadowFg) { setAcceptDrops(true); subscribe(FileDownload::ImageLoaded(), [this] { update(); }); @@ -6186,8 +6186,8 @@ bool HistoryWidget::paintTopBar(Painter &p, int decreaseWidth, TimeMs ms) { auto statustop = st::topBarHeight - st::topBarArrowPadding.bottom() - st::dialogsTextFont->height; auto namewidth = width() - decreaseWidth - st::topBarArrowPadding.left() - st::topBarArrowPadding.right(); p.setFont(st::dialogsTextFont); - if (!_history->paintSendAction(p, nameleft, statustop, namewidth, width(), st::statusFgActive, ms)) { - p.setPen(_titlePeerTextOnline ? st::statusFgActive : st::statusFg); + if (!_history->paintSendAction(p, nameleft, statustop, namewidth, width(), st::historyStatusFgTyping, ms)) { + p.setPen(_titlePeerTextOnline ? st::historyStatusFgActive : st::historyStatusFg); p.drawText(nameleft, st::topBarHeight - st::topBarArrowPadding.bottom() - st::dialogsTextFont->height + st::dialogsTextFont->ascent, _titlePeerText); } @@ -7266,7 +7266,7 @@ void HistoryWidget::updateListSize(bool initial, bool loadedDown, const ScrollCh } } else if (_history->showFrom) { toY = _list->itemTop(_history->showFrom); - if (toY < _scroll->scrollTopMax() + st::unreadBarHeight) { + if (toY < _scroll->scrollTopMax() + st::historyUnreadBarHeight) { _history->addUnreadBar(); if (_history->unreadBar) { setMsgId(ShowAtUnreadMsgId); @@ -7614,7 +7614,7 @@ void HistoryWidget::onInlineResultSend(InlineBots::Result *result, UserData *bot HistoryWidget::PinnedBar::PinnedBar(MsgId msgId, HistoryWidget *parent) : msgId(msgId) , cancel(parent, st::historyReplyCancel) -, shadow(parent, st::shadowColor) { +, shadow(parent, st::shadowFg) { } HistoryWidget::PinnedBar::~PinnedBar() { @@ -8589,11 +8589,11 @@ void HistoryWidget::drawField(Painter &p, const QRect &rect) { } else { _replyToName.drawElided(p, replyLeft, backy + st::msgReplyPadding.top(), width() - replyLeft - _fieldBarCancel->width() - st::msgReplyPadding.right()); } - p.setPen(((drawMsgText->toHistoryMessage() && drawMsgText->toHistoryMessage()->emptyText()) || drawMsgText->serviceMsg()) ? st::msgInDateFg : st::msgColor); + p.setPen(((drawMsgText->toHistoryMessage() && drawMsgText->toHistoryMessage()->emptyText()) || drawMsgText->serviceMsg()) ? st::historyComposeAreaFgService : st::historyComposeAreaFg); _replyEditMsgText.drawElided(p, replyLeft, backy + st::msgReplyPadding.top() + st::msgServiceNameFont->height, width() - replyLeft - _fieldBarCancel->width() - st::msgReplyPadding.right()); } else { p.setFont(st::msgDateFont); - p.setPen(st::msgInDateFg); + p.setPen(st::historyComposeAreaFgService); p.drawText(replyLeft, backy + st::msgReplyPadding.top() + (st::msgReplyBarSize.height() - st::msgDateFont->height) / 2 + st::msgDateFont->ascent, st::msgDateFont->elided(lang(lng_profile_loading), width() - replyLeft - _fieldBarCancel->width() - st::msgReplyPadding.right())); } } @@ -8613,13 +8613,13 @@ void HistoryWidget::drawField(Painter &p, const QRect &rect) { } p.setPen(st::historyReplyNameFg); from->drawElided(p, forwardLeft, backy + st::msgReplyPadding.top(), width() - forwardLeft - _fieldBarCancel->width() - st::msgReplyPadding.right()); - p.setPen(serviceColor ? st::msgInDateFg : st::msgColor); + p.setPen(serviceColor ? st::historyComposeAreaFgService : st::historyComposeAreaFg); text->drawElided(p, forwardLeft, backy + st::msgReplyPadding.top() + st::msgServiceNameFont->height, width() - forwardLeft - _fieldBarCancel->width() - st::msgReplyPadding.right()); } } if (drawPreview) { int32 previewLeft = st::historyReplySkip + st::webPageLeft; - p.fillRect(st::historyReplySkip, backy + st::msgReplyPadding.top(), st::webPageBar, st::msgReplyBarSize.height(), st::msgInReplyBarColor->b); + p.fillRect(st::historyReplySkip, backy + st::msgReplyPadding.top(), st::webPageBar, st::msgReplyBarSize.height(), st::msgInReplyBarColor); if ((_previewData->photo && !_previewData->photo->thumb->isNull()) || (_previewData->document && !_previewData->document->thumb->isNull())) { ImagePtr replyPreview = _previewData->photo ? _previewData->photo->makeReplyPreview() : _previewData->document->makeReplyPreview(); if (!replyPreview->isNull()) { @@ -8635,7 +8635,7 @@ void HistoryWidget::drawField(Painter &p, const QRect &rect) { } p.setPen(st::historyReplyNameFg); _previewTitle.drawElided(p, previewLeft, backy + st::msgReplyPadding.top(), width() - previewLeft - _fieldBarCancel->width() - st::msgReplyPadding.right()); - p.setPen(st::msgColor); + p.setPen(st::historyComposeAreaFg); _previewDescription.drawElided(p, previewLeft, backy + st::msgReplyPadding.top() + st::msgServiceNameFont->height, width() - previewLeft - _fieldBarCancel->width() - st::msgReplyPadding.right()); } } @@ -8684,7 +8684,7 @@ void HistoryWidget::paintEditHeader(Painter &p, const QRect &rect, int left, int if (!editTimeLeftText.isEmpty()) { p.setFont(st::normalFont); - p.setPen(st::msgInDateFg); + p.setPen(st::historyComposeAreaFgService); p.drawText(left + st::msgServiceNameFont->width(lang(lng_edit_message)) + st::normalFont->spacew, top + st::msgReplyPadding.top() + st::msgServiceNameFont->ascent, editTimeLeftText); } } @@ -8762,11 +8762,11 @@ void HistoryWidget::drawPinnedBar(Painter &p) { p.setFont(st::msgServiceNameFont); p.drawText(left, st::msgReplyPadding.top() + st::msgServiceNameFont->ascent, lang(lng_pinned_message)); - p.setPen((((_pinnedBar->msg->toHistoryMessage() && _pinnedBar->msg->toHistoryMessage()->emptyText()) || _pinnedBar->msg->serviceMsg()) ? st::msgInDateFg : st::msgColor)->p); + p.setPen(((_pinnedBar->msg->toHistoryMessage() && _pinnedBar->msg->toHistoryMessage()->emptyText()) || _pinnedBar->msg->serviceMsg()) ? st::historyComposeAreaFgService : st::historyComposeAreaFg); _pinnedBar->text.drawElided(p, left, st::msgReplyPadding.top() + st::msgServiceNameFont->height, width() - left - _pinnedBar->cancel->width() - st::msgReplyPadding.right()); } else { p.setFont(st::msgDateFont); - p.setPen(st::msgInDateFg); + p.setPen(st::historyComposeAreaFgService); p.drawText(left, st::msgReplyPadding.top() + (st::msgReplyBarSize.height() - st::msgDateFont->height) / 2 + st::msgDateFont->ascent, st::msgDateFont->elided(lang(lng_profile_loading), width() - left - _pinnedBar->cancel->width() - st::msgReplyPadding.right())); } } @@ -8856,7 +8856,7 @@ void HistoryWidget::paintEvent(QPaintEvent *e) { QRect tr((width() - w) / 2, (height() - _field->height() - 2 * st::historySendPadding - h) / 2, w, h); HistoryLayout::ServiceMessagePainter::paintBubble(p, tr.x(), tr.y(), tr.width(), tr.height()); - p.setPen(st::msgServiceColor->p); + p.setPen(st::msgServiceFg); p.setFont(font->f); p.drawText(tr.left() + st::msgPadding.left(), tr.top() + st::msgServicePadding.top() + 1 + font->ascent, lang(lng_willbe_history)); } diff --git a/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.cpp b/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.cpp index 6427b31be..1139bc23f 100644 --- a/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.cpp +++ b/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.cpp @@ -609,7 +609,7 @@ void Video::paint(Painter &p, const QRect &clip, const PaintContext *context) co int durationW = _durationWidth + 2 * st::msgDateImgPadding.x(), durationH = st::normalFont->height + 2 * st::msgDateImgPadding.y(); int durationX = (st::inlineThumbSize - durationW) / 2, durationY = st::inlineRowMargin + st::inlineThumbSize - durationH; App::roundRect(p, durationX, durationY - st::msgDateImgPadding.y(), durationW, durationH, st::msgDateImgBg, DateCorners); - p.setPen(st::msgDateImgColor); + p.setPen(st::msgDateImgFg); p.setFont(st::normalFont); p.drawText(durationX + st::msgDateImgPadding.x(), durationTop + st::normalFont->ascent, _duration); } @@ -1029,10 +1029,10 @@ void Article::paint(Painter &p, const QRect &clip, const PaintContext *context) if (thumb->isNull() && !_thumbLetter.isEmpty()) { int32 index = (_thumbLetter.at(0).unicode() % 4); const style::color *colors[] = { - &st::msgFileRedColor, - &st::msgFileYellowColor, - &st::msgFileGreenColor, - &st::msgFileBlueColor + &st::msgFile3Bg, + &st::msgFile4Bg, + &st::msgFile2Bg, + &st::msgFile1Bg }; p.fillRect(rthumb, *colors[index]); diff --git a/Telegram/SourceFiles/intro/intro.style b/Telegram/SourceFiles/intro/intro.style index f2310e251..e0b8bfdee 100644 --- a/Telegram/SourceFiles/intro/intro.style +++ b/Telegram/SourceFiles/intro/intro.style @@ -24,18 +24,15 @@ using "ui/widgets/widgets.style"; countryRipple: defaultRippleAnimation; introCoverHeight: 208px; -introCoverTopBg: #0f89d0; -introCoverBottomBg: #39b0f0; -introCoverIconsFg: #5ec6ff; introCoverMaxWidth: 880px; introCoverIconsMinSkip: 120px; introCoverLeft: icon {{ "intro_left", introCoverIconsFg }}; introCoverRight: icon {{ "intro_right", introCoverIconsFg }}; introCoverIcon: icon { - { "intro_plane_trace", #5ec6ff69 }, - { "intro_plane_inner", #c6d8e8 }, - { "intro_plane_outer", #a1bed4 }, - { "intro_plane_top", #ffffff }, + { "intro_plane_trace", introCoverPlaneTrace }, + { "intro_plane_inner", introCoverPlaneInner }, + { "intro_plane_outer", introCoverPlaneOuter }, + { "intro_plane_top", introCoverPlaneTop }, }; introCoverIconLeft: 50px; introCoverIconTop: 46px; diff --git a/Telegram/SourceFiles/layout.cpp b/Telegram/SourceFiles/layout.cpp index 90f3ce4eb..c30aa186a 100644 --- a/Telegram/SourceFiles/layout.cpp +++ b/Telegram/SourceFiles/layout.cpp @@ -212,46 +212,46 @@ int32 documentColorIndex(DocumentData *document, QString &ext) { const style::color &documentColor(int32 colorIndex) { static const style::color *colors[] = { - &st::msgFileBlueColor, - &st::msgFileGreenColor, - &st::msgFileRedColor, - &st::msgFileYellowColor + &st::msgFile1Bg, + &st::msgFile2Bg, + &st::msgFile3Bg, + &st::msgFile4Bg }; return *colors[colorIndex & 3]; } const style::color &documentDarkColor(int32 colorIndex) { static const style::color *colors[] = { - &st::msgFileBlueDark, - &st::msgFileGreenDark, - &st::msgFileRedDark, - &st::msgFileYellowDark + &st::msgFile1BgDark, + &st::msgFile2BgDark, + &st::msgFile3BgDark, + &st::msgFile4BgDark }; return *colors[colorIndex & 3]; } const style::color &documentOverColor(int32 colorIndex) { static const style::color *colors[] = { - &st::msgFileBlueOver, - &st::msgFileGreenOver, - &st::msgFileRedOver, - &st::msgFileYellowOver + &st::msgFile1BgOver, + &st::msgFile2BgOver, + &st::msgFile3BgOver, + &st::msgFile4BgOver }; return *colors[colorIndex & 3]; } const style::color &documentSelectedColor(int32 colorIndex) { static const style::color *colors[] = { - &st::msgFileBlueSelected, - &st::msgFileGreenSelected, - &st::msgFileRedSelected, - &st::msgFileYellowSelected + &st::msgFile1BgSelected, + &st::msgFile2BgSelected, + &st::msgFile3BgSelected, + &st::msgFile4BgSelected }; return *colors[colorIndex & 3]; } RoundCorners documentCorners(int32 colorIndex) { - return RoundCorners(DocBlueCorners + (colorIndex & 3)); + return RoundCorners(Doc1Corners + (colorIndex & 3)); } bool documentIsValidMediaFile(const QString &filepath) { diff --git a/Telegram/SourceFiles/layout.h b/Telegram/SourceFiles/layout.h index d828a80e9..458cfe54c 100644 --- a/Telegram/SourceFiles/layout.h +++ b/Telegram/SourceFiles/layout.h @@ -54,10 +54,10 @@ enum RoundCorners { BotKeyboardDownCorners, PhotoSelectOverlayCorners, - DocBlueCorners, - DocGreenCorners, - DocRedCorners, - DocYellowCorners, + Doc1Corners, + Doc2Corners, + Doc3Corners, + Doc4Corners, InShadowCorners, // for photos without bg InSelectedShadowCorners, diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index eb844def3..6b27f0a37 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -70,7 +70,7 @@ StackItemSection::~StackItemSection() { MainWidget::MainWidget(QWidget *parent) : TWidget(parent) , _dialogsWidth(st::dialogsWidthMin) -, _sideShadow(this, st::shadowColor) +, _sideShadow(this, st::shadowFg) , _dialogs(this) , _history(this) , _topBar(this) diff --git a/Telegram/SourceFiles/media/media_audio.cpp b/Telegram/SourceFiles/media/media_audio.cpp index 2de874a60..cca44a6b0 100644 --- a/Telegram/SourceFiles/media/media_audio.cpp +++ b/Telegram/SourceFiles/media/media_audio.cpp @@ -135,7 +135,7 @@ void audioInit() { alGenBuffers(1, ¬ifyBuffer); if (!_checkALError()) return audioFinish(); - QFile notify(st::newMsgSound); + QFile notify(":/gui/art/newmsg.wav"); if (!notify.open(QIODevice::ReadOnly)) return audioFinish(); QByteArray blob = notify.readAll(); diff --git a/Telegram/SourceFiles/media/player/media_player.style b/Telegram/SourceFiles/media/player/media_player.style index cfa2a6459..067147e94 100644 --- a/Telegram/SourceFiles/media/player/media_player.style +++ b/Telegram/SourceFiles/media/player/media_player.style @@ -23,10 +23,6 @@ using "basic.style"; using "ui/widgets/widgets.style"; using "overview/overview.style"; -mediaPlayerBg: windowBg; -mediaPlayerActiveFg: windowBgActive; -mediaPlayerInactiveFg: #dfebf2; - mediaPlayerButton: MediaPlayerButton { playPosition: point(2px, 0px); playOuter: size(17px, 15px); @@ -159,7 +155,7 @@ mediaPlayerPlayback: FilledSlider { lineWidth: 2px; activeFg: mediaPlayerActiveFg; inactiveFg: mediaPlayerInactiveFg; - disabledFg: #9dd1ef; + disabledFg: mediaPlayerDisabledFg; duration: 150; } diff --git a/Telegram/SourceFiles/media/player/media_player_widget.cpp b/Telegram/SourceFiles/media/player/media_player_widget.cpp index d0ac697dc..dabfd554d 100644 --- a/Telegram/SourceFiles/media/player/media_player_widget.cpp +++ b/Telegram/SourceFiles/media/player/media_player_widget.cpp @@ -91,7 +91,7 @@ Widget::Widget(QWidget *parent) : TWidget(parent) , _volumeToggle(this, st::mediaPlayerVolumeToggle) , _repeatTrack(this, st::mediaPlayerRepeatButton) , _close(this, st::mediaPlayerClose) -, _shadow(this, st::shadowColor) +, _shadow(this, st::shadowFg) , _playback(std_::make_unique(new Ui::FilledSlider(this, st::mediaPlayerPlayback))) { setAttribute(Qt::WA_OpaquePaintEvent); setMouseTracking(true); diff --git a/Telegram/SourceFiles/media/view/media_clip_controller.cpp b/Telegram/SourceFiles/media/view/media_clip_controller.cpp index 67c716c5e..ddad573d3 100644 --- a/Telegram/SourceFiles/media/view/media_clip_controller.cpp +++ b/Telegram/SourceFiles/media/view/media_clip_controller.cpp @@ -211,7 +211,7 @@ void Controller::paintEvent(QPaintEvent *e) { return; } - App::roundRect(p, rect(), st::medviewSaveMsg, MediaviewSaveCorners); + App::roundRect(p, rect(), st::mediaviewSaveMsgBg, MediaviewSaveCorners); } void Controller::mousePressEvent(QMouseEvent *e) { diff --git a/Telegram/SourceFiles/media/view/mediaview.style b/Telegram/SourceFiles/media/view/mediaview.style index e26a2e2a0..a18ee47de 100644 --- a/Telegram/SourceFiles/media/view/mediaview.style +++ b/Telegram/SourceFiles/media/view/mediaview.style @@ -23,10 +23,7 @@ using "basic.style"; using "ui/widgets/widgets.style"; mediaviewOverDuration: 150; -mediaviewPlaybackActive: #c7c7c7; -mediaviewPlaybackInactive: #252525; -mediaviewPlaybackActiveOver: #ffffff; -mediaviewPlaybackInactiveOver: #474747; + mediaviewPlayback: MediaSlider { width: 3px; activeFg: mediaviewPlaybackActive; @@ -42,32 +39,32 @@ mediaviewPlayback: MediaSlider { mediaviewControllerSize: size(600px, 50px); mediaviewPlayProgressLabel: LabelSimple(defaultLabelSimple) { font: semiboldFont; - textFg: #ffffffc7; + textFg: mediaviewPlaybackProgressFg; } mediaviewPlayProgressTop: 11px; mediaviewPlayButton: IconButton { width: 25px; height: 24px; - icon: icon {{ "media_play", #c7c7c7, point(3px, 0px) }}; - iconOver: icon {{ "media_play", #ffffff, point(3px, 0px) }}; + icon: icon {{ "media_play", mediaviewPlaybackIconFg, point(3px, 0px) }}; + iconOver: icon {{ "media_play", mediaviewPlaybackIconFgOver, point(3px, 0px) }}; iconPosition: point(3px, 1px); duration: mediaviewOverDuration; } -mediaviewPauseIcon: icon {{ "media_pause", #c7c7c7, point(1px, 1px) }}; -mediaviewPauseIconOver: icon {{ "media_pause", #ffffff, point(1px, 1px) }}; +mediaviewPauseIcon: icon {{ "media_pause", mediaviewPlaybackIconFg, point(1px, 1px) }}; +mediaviewPauseIconOver: icon {{ "media_pause", mediaviewPlaybackIconFgOver, point(1px, 1px) }}; mediaviewPlayPauseLeft: 17px; mediaviewFullScreenLeft: 17px; mediaviewVolumeLeft: 15px; mediaviewFullScreenButton: IconButton(mediaviewPlayButton) { - icon: icon {{ "media_fullscreen_to", #c7c7c7, point(0px, 0px) }}; - iconOver: icon {{ "media_fullscreen_to", #ffffff, point(0px, 0px) }}; + icon: icon {{ "media_fullscreen_to", mediaviewPlaybackIconFg, point(0px, 0px) }}; + iconOver: icon {{ "media_fullscreen_to", mediaviewPlaybackIconFgOver, point(0px, 0px) }}; iconPosition: point(0px, 1px); } -mediaviewFullScreenOutIcon: icon {{ "media_fullscreen_from", #c7c7c7, point(0px, 0px) }}; -mediaviewFullScreenOutIconOver: icon {{ "media_fullscreen_from", #ffffff, point(0px, 0px) }}; +mediaviewFullScreenOutIcon: icon {{ "media_fullscreen_from", mediaviewPlaybackIconFg, point(0px, 0px) }}; +mediaviewFullScreenOutIconOver: icon {{ "media_fullscreen_from", mediaviewPlaybackIconFgOver, point(0px, 0px) }}; mediaviewPlaybackTop: 28px; @@ -78,11 +75,11 @@ mediaviewVolumeOnIconOver: icon {{ "media_volume", mediaviewPlaybackActiveOver, mediaviewVolumeIconTop: 8px; mediaviewControllerRadius: 25px; -mediaviewLeft: icon {{ "mediaview_next-flip_horizontal", #ffffff }}; -mediaviewRight: icon {{ "mediaview_next", #ffffff }}; -mediaviewClose: icon {{ "mediaview_close", #ffffff }}; -mediaviewSave: icon {{ "mediaview_download", #ffffff }}; -mediaviewMore: icon {{ "mediaview_more", #ffffff }}; +mediaviewLeft: icon {{ "mediaview_next-flip_horizontal", mediaviewControlFg }}; +mediaviewRight: icon {{ "mediaview_next", mediaviewControlFg }}; +mediaviewClose: icon {{ "mediaview_close", mediaviewControlFg }}; +mediaviewSave: icon {{ "mediaview_download", mediaviewControlFg }}; +mediaviewMore: icon {{ "mediaview_more", mediaviewControlFg }}; mediaviewFileRed: icon { { size(25px, 25px), mediaviewFileBg }, @@ -112,13 +109,8 @@ mediaviewFileExtPadding: 10px; mediaviewFileLinksTop: 57px; mediaviewFileIconSize: 80px; -mediaviewFileLink: LinkButton(defaultLinkButton) { - color: #4595d3; - overColor: #4595d3; -} +mediaviewFileLink: defaultLinkButton; -mediaviewTransparentBg: #ffffff; -mediaviewTransparentFg: #cccccc; mediaviewTransparentSize: 4px; mediaviewMenu: Menu(defaultMenu) { diff --git a/Telegram/SourceFiles/mediaview.cpp b/Telegram/SourceFiles/mediaview.cpp index 4762b68a3..8e5446ae5 100644 --- a/Telegram/SourceFiles/mediaview.cpp +++ b/Telegram/SourceFiles/mediaview.cpp @@ -1612,11 +1612,11 @@ void MediaView::paintEvent(QPaintEvent *e) { _saveMsgOpacity.update(qMin(progress, 1.), anim::linear); if (_saveMsgOpacity.current() > 0) { p.setOpacity(_saveMsgOpacity.current()); - App::roundRect(p, _saveMsg, st::medviewSaveMsg, MediaviewSaveCorners); + App::roundRect(p, _saveMsg, st::mediaviewSaveMsgBg, MediaviewSaveCorners); st::medviewSaveMsgCheck.paint(p, _saveMsg.topLeft() + st::medviewSaveMsgCheckPos, width()); - p.setPen(st::medviewSaveMsgFg); - textstyleSet(&st::medviewSaveAsTextStyle); + p.setPen(st::mediaviewSaveMsgFg); + textstyleSet(&st::mediaviewTextStyle); _saveMsgText.draw(p, _saveMsg.x() + st::medviewSaveMsgPadding.left(), _saveMsg.y() + st::medviewSaveMsgPadding.top(), _saveMsg.width() - st::medviewSaveMsgPadding.left() - st::medviewSaveMsgPadding.right()); textstyleRestore(); p.setOpacity(1); @@ -1736,7 +1736,7 @@ void MediaView::paintEvent(QPaintEvent *e) { st::mediaviewMore.paintInCenter(p, _moreNavIcon); } - p.setPen(st::mvControlFg); + p.setPen(st::mediaviewControlFg); p.setFont(st::mvThickFont); // header @@ -1782,12 +1782,12 @@ void MediaView::paintEvent(QPaintEvent *e) { QRect outer(_captionRect.marginsAdded(st::mvCaptionPadding)); if (outer.intersects(r)) { p.setOpacity(co); - p.setBrush(st::mvCaptionBg); + p.setBrush(st::mediaviewCaptionBg); p.setPen(Qt::NoPen); p.drawRoundedRect(outer, st::mvCaptionRadius, st::mvCaptionRadius); if (_captionRect.intersects(r)) { - textstyleSet(&st::medviewSaveAsTextStyle); - p.setPen(st::mvCaptionFg); + textstyleSet(&st::mediaviewTextStyle); + p.setPen(st::mediaviewCaptionFg); _caption.drawElided(p, _captionRect.x(), _captionRect.y(), _captionRect.width(), _captionRect.height() / st::mvCaptionFont->height); textstyleRestore(); } diff --git a/Telegram/SourceFiles/overview/overview.style b/Telegram/SourceFiles/overview/overview.style index 8a4a5ed01..d90d231cc 100644 --- a/Telegram/SourceFiles/overview/overview.style +++ b/Telegram/SourceFiles/overview/overview.style @@ -50,9 +50,6 @@ OverviewFileLayout { overviewLeftMin: 28px; overviewLeftMax: 42px; -overviewCheckBg: #00000040; -overviewCheckFg: windowBg; -overviewCheckFgActive: windowBg; overviewCheckPressedSize: 0.8; overviewCheck: RoundCheckbox(defaultRoundCheckbox) { bgInactive: overviewCheckBg; @@ -63,18 +60,16 @@ overviewCheck: RoundCheckbox(defaultRoundCheckbox) { overviewCheckSkip: 5px; overviewPhotoSkip: 10px; -overviewPhotoBg: #F1F1F1; +overviewPhotoBg: windowBgOver; overviewPhotoMinSize: minPhotoSize; -overviewPhotoSelectOverlay: #40ace333; +overviewVideoBg: imageBg; -overviewVideoBg: #000000; - -overviewFileThumbBg: #000000; +overviewFileThumbBg: imageBg; overviewFileChecked: windowBgActive; -overviewFileCheck: #00000066; +overviewFileCheck: overviewCheckBg; overviewFileExtPadding: 5px; overviewFileExtTop: 24px; -overviewFileExtFg: #ffffff; +overviewFileExtFg: windowFgActive; overviewFileExtFont: font(18px semibold); overviewSongPause: icon {{ "playlist_pause", msgInBg }}; @@ -118,14 +113,14 @@ playlistPadding: 10px; linksSearchTop: 30px; linksMaxWidth: 520px; -linksLetterFg: #ffffff; +linksLetterFg: windowFgActive; linksLetterFont: font(24px); linksMargin: margins(0px, 7px, 0px, 5px); -linksTextFg: #000000; +linksTextFg: windowFg; linksTextTop: 6px; linksBorder: 1px; -linksBorderFg: #eaeaea; -linksDateColor: #808080; +linksBorderFg: shadowFg; +linksDateColor: windowSubTextFg; linksDateMargin: margins(0px, 15px, 0px, 2px); linksPhotoSize: 46px; linksPhotoPadding: 12px; @@ -140,8 +135,8 @@ overviewLinksChecked: icon { overviewFilter: FlatInput(defaultFlatInput) { font: font(fsize); - phColor: #949494; - phFocusColor: #a4a4a4; + phColor: placeholderFg; + phFocusColor: placeholderFgActive; icon: fieldSearchIcon; width: 240px; diff --git a/Telegram/SourceFiles/overview/overview_layout.cpp b/Telegram/SourceFiles/overview/overview_layout.cpp index 824cce92e..1169d85f3 100644 --- a/Telegram/SourceFiles/overview/overview_layout.cpp +++ b/Telegram/SourceFiles/overview/overview_layout.cpp @@ -367,7 +367,7 @@ void Video::paint(Painter &p, const QRect &clip, TextSelection selection, const statusX = _width - statusW + statusX; p.fillRect(rtlrect(statusX - st::msgDateImgPadding.x(), statusY - st::msgDateImgPadding.y(), statusW, statusH, _width), selected ? st::msgDateImgBgSelected : st::msgDateImgBg); p.setFont(st::normalFont); - p.setPen(st::msgDateImgColor); + p.setPen(st::msgDateImgFg); p.drawTextLeft(statusX, statusY, _width, _status.text(), statusW - 2 * st::msgDateImgPadding.x()); } } @@ -377,7 +377,7 @@ void Video::paint(Painter &p, const QRect &clip, TextSelection selection, const int32 statusH = st::normalFont->height + 2 * st::msgDateImgPadding.y(); p.fillRect(rtlrect(statusX - st::msgDateImgPadding.x(), statusY - st::msgDateImgPadding.y(), statusW, statusH, _width), selected ? st::msgDateImgBgSelected : st::msgDateImgBg); p.setFont(st::normalFont); - p.setPen(st::msgDateImgColor); + p.setPen(st::msgDateImgFg); p.drawTextLeft(statusX, statusY, _width, _duration, statusW - 2 * st::msgDateImgPadding.x()); } @@ -1132,10 +1132,10 @@ void Link::paint(Painter &p, const QRect &clip, TextSelection selection, const P } else { int32 index = _letter.isEmpty() ? 0 : (_letter.at(0).unicode() % 4); switch (index) { - case 0: App::roundRect(p, rtlrect(0, top, st::linksPhotoSize, st::linksPhotoSize, _width), st::msgFileRedColor, DocRedCorners); break; - case 1: App::roundRect(p, rtlrect(0, top, st::linksPhotoSize, st::linksPhotoSize, _width), st::msgFileYellowColor, DocYellowCorners); break; - case 2: App::roundRect(p, rtlrect(0, top, st::linksPhotoSize, st::linksPhotoSize, _width), st::msgFileGreenColor, DocGreenCorners); break; - case 3: App::roundRect(p, rtlrect(0, top, st::linksPhotoSize, st::linksPhotoSize, _width), st::msgFileBlueColor, DocBlueCorners); break; + case 0: App::roundRect(p, rtlrect(0, top, st::linksPhotoSize, st::linksPhotoSize, _width), st::msgFile1Bg, Doc1Corners); break; + case 1: App::roundRect(p, rtlrect(0, top, st::linksPhotoSize, st::linksPhotoSize, _width), st::msgFile2Bg, Doc2Corners); break; + case 2: App::roundRect(p, rtlrect(0, top, st::linksPhotoSize, st::linksPhotoSize, _width), st::msgFile3Bg, Doc3Corners); break; + case 3: App::roundRect(p, rtlrect(0, top, st::linksPhotoSize, st::linksPhotoSize, _width), st::msgFile4Bg, Doc4Corners); break; } if (!_letter.isEmpty()) { diff --git a/Telegram/SourceFiles/overviewwidget.cpp b/Telegram/SourceFiles/overviewwidget.cpp index c5c5a86ff..dd904f3b5 100644 --- a/Telegram/SourceFiles/overviewwidget.cpp +++ b/Telegram/SourceFiles/overviewwidget.cpp @@ -1902,7 +1902,7 @@ OverviewInner::~OverviewInner() { OverviewWidget::OverviewWidget(QWidget *parent, PeerData *peer, MediaOverviewType type) : TWidget(parent) , _scroll(this, st::settingsScroll, false) -, _topShadow(this, st::shadowColor) { +, _topShadow(this, st::shadowFg) { _inner = _scroll->setOwnedWidget(object_ptr(this, _scroll, peer, type)); _scroll->move(0, 0); _inner->move(0, 0); diff --git a/Telegram/SourceFiles/passcodewidget.cpp b/Telegram/SourceFiles/passcodewidget.cpp index ff9010cd3..42290deb9 100644 --- a/Telegram/SourceFiles/passcodewidget.cpp +++ b/Telegram/SourceFiles/passcodewidget.cpp @@ -109,7 +109,7 @@ void PasscodeWidget::showAnimated(const QPixmap &bgAnimCache, bool back) { _a_show.finish(); showAll(); - setFocus(); + setInnerFocus(); _passcode->finishAnimations(); (_showBack ? _cacheUnder : _cacheOver) = myGrab(this); hideAll(); @@ -187,5 +187,5 @@ void PasscodeWidget::resizeEvent(QResizeEvent *e) { } void PasscodeWidget::setInnerFocus() { - _passcode->setFocus(); + _passcode->setFocusFast(); } diff --git a/Telegram/SourceFiles/profile/profile.style b/Telegram/SourceFiles/profile/profile.style index 6128a6cde..b0e323d90 100644 --- a/Telegram/SourceFiles/profile/profile.style +++ b/Telegram/SourceFiles/profile/profile.style @@ -41,7 +41,7 @@ profileNameLabel: FlatLabel(defaultFlatLabel) { font: font(16px semibold); width: 160px; maxHeight: 24px; - textFg: #333333; + textFg: windowBoldFg; } profileNameTextStyle: TextStyle(defaultTextStyle) { } @@ -91,7 +91,7 @@ profileBlockMarginRight: 10px; profileBlockMarginBottom: 7px; profileBlockTitleHeight: 24px; profileBlockTitleFont: font(14px semibold); -profileBlockTitleFg: #333333; +profileBlockTitleFg: windowBoldFg; profileBlockTitlePosition: point(24px, 0px); profileBlockLabel: FlatLabel(defaultFlatLabel) { textFg: windowSubTextFg; @@ -121,7 +121,7 @@ profileMemberItem: ProfilePeerListItem { bottom: profileBlockMarginBottom; button: defaultLeftOutlineButton; statusFg: windowSubTextFg; - statusFgOver: #7c99b2; + statusFgOver: profileStatusFgOver; statusFgActive: windowActiveTextFg; } profileMemberHeight: 58px; @@ -129,7 +129,7 @@ profileMemberPaddingLeft: 16px; profileMemberPhotoSize: 46px; profileMemberPhotoPosition: point(12px, 6px); profileMemberNamePosition: point(68px, 11px); -profileMemberNameFg: #222222; +profileMemberNameFg: windowBoldFg; profileMemberStatusPosition: point(68px, 31px); profileMemberAdminIcon: icon {{ "profile_admin_star", windowBgActive, point(4px, 3px) }}; profileLimitReachedLabel: FlatLabel(defaultFlatLabel) { diff --git a/Telegram/SourceFiles/profile/profile_common_groups_section.cpp b/Telegram/SourceFiles/profile/profile_common_groups_section.cpp index f7a6a6050..25be4db04 100644 --- a/Telegram/SourceFiles/profile/profile_common_groups_section.cpp +++ b/Telegram/SourceFiles/profile/profile_common_groups_section.cpp @@ -334,7 +334,7 @@ InnerWidget::~InnerWidget() { Widget::Widget(QWidget *parent, PeerData *peer) : Window::SectionWidget(parent) , _scroll(this, st::settingsScroll) , _fixedBar(this) -, _fixedBarShadow(this, st::shadowColor) { +, _fixedBarShadow(this, st::shadowFg) { _fixedBar->move(0, 0); _fixedBar->resizeToWidth(width()); _fixedBar->show(); diff --git a/Telegram/SourceFiles/profile/profile_inner_widget.cpp b/Telegram/SourceFiles/profile/profile_inner_widget.cpp index c44dadd20..b03a16b14 100644 --- a/Telegram/SourceFiles/profile/profile_inner_widget.cpp +++ b/Telegram/SourceFiles/profile/profile_inner_widget.cpp @@ -125,7 +125,7 @@ void InnerWidget::paintEvent(QPaintEvent *e) { int shadowLeft = _blocksLeft + _leftColumnWidth + _columnDivider; int shadowTop = _blocksTop + st::profileBlockMarginTop; - p.fillRect(rtlrect(shadowLeft, shadowTop, st::lineWidth, shadowHeight - st::profileBlockMarginTop, width()), st::shadowColor); + p.fillRect(rtlrect(shadowLeft, shadowTop, st::lineWidth, shadowHeight - st::profileBlockMarginTop, width()), st::shadowFg); } } diff --git a/Telegram/SourceFiles/profile/profile_widget.cpp b/Telegram/SourceFiles/profile/profile_widget.cpp index 6c712f003..00c54c916 100644 --- a/Telegram/SourceFiles/profile/profile_widget.cpp +++ b/Telegram/SourceFiles/profile/profile_widget.cpp @@ -36,7 +36,7 @@ namespace Profile { Widget::Widget(QWidget *parent, PeerData *peer) : Window::SectionWidget(parent) , _scroll(this, st::settingsScroll) , _fixedBar(this, peer) -, _fixedBarShadow(this, object_ptr(this, st::shadowColor)) { +, _fixedBarShadow(this, object_ptr(this, st::shadowFg)) { _fixedBar->move(0, 0); _fixedBar->resizeToWidth(width()); _fixedBar->show(); diff --git a/Telegram/SourceFiles/settings/settings.style b/Telegram/SourceFiles/settings/settings.style index 11d31930f..3012bbe32 100644 --- a/Telegram/SourceFiles/settings/settings.style +++ b/Telegram/SourceFiles/settings/settings.style @@ -53,7 +53,7 @@ settingsNameLabel: FlatLabel(defaultFlatLabel) { font: font(16px semibold); width: 160px; maxHeight: 24px; - textFg: #333333; + textFg: windowBoldFg; } settingsNameTextStyle: TextStyle(defaultTextStyle) { } @@ -73,7 +73,7 @@ settingsEditButton: IconButton { width: 24px; height: 34px; - icon: icon {{ "settings_edit_name", #b7b7b7 }}; + icon: icon {{ "settings_edit_name", menuIconFg }}; iconPosition: point(3px, 9px); } @@ -84,7 +84,7 @@ settingsBlockMarginRight: 10px; settingsBlockMarginBottom: 10px; settingsBlockTitleHeight: 31px; settingsBlockTitleFont: font(15px semibold); -settingsBlockTitleFg: #333333; +settingsBlockTitleFg: windowBoldFg; settingsBlockTitleTop: 0px; settingsPrimaryLabel: FlatLabel(defaultFlatLabel) { font: boxTextFont; @@ -106,4 +106,4 @@ settingsActionPadding: margins(0px, 4px, 0px, 5px); settingsBackgroundSize: 120px; -settingsUpdateFg: #999999; +settingsUpdateFg: windowSubTextFg; diff --git a/Telegram/SourceFiles/stickers/stickers.style b/Telegram/SourceFiles/stickers/stickers.style index 591d2d5bc..7a9308c47 100644 --- a/Telegram/SourceFiles/stickers/stickers.style +++ b/Telegram/SourceFiles/stickers/stickers.style @@ -36,7 +36,7 @@ stickersTrendingHeaderFont: semiboldFont; stickersTrendingHeaderFg: windowFg; stickersTrendingHeaderTop: 0px; stickersTrendingSubheaderFont: normalFont; -stickersTrendingSubheaderFg: #777777; +stickersTrendingSubheaderFg: windowSubTextFg; stickersTrendingSubheaderTop: 20px; stickersTrendingAddTop: 3px; @@ -94,11 +94,11 @@ stickersScroll: ScrollArea(boxLayerScroll) { deltab: 9px; } stickersReorderPadding: margins(0px, 12px, 0px, 12px); -stickersReorderFg: #777777; +stickersReorderFg: windowSubTextFg; stickersRowDisabledOpacity: 0.4; stickersRowDuration: 200; -emojiIconFg: #b3b3b3; +emojiIconFg: checkboxFg; emojiIconFgActive: windowBgActive; stickersSettings: icon {{ "emoji_settings", emojiIconFg }}; stickersTrending: icon {{ "emoji_trending", emojiIconFg }}; @@ -165,7 +165,7 @@ emojiPanHeaderTop: 12px; emojiColorsPadding: 5px; emojiColorsSep: 1px; -emojiColorsSepColor: #d5d5d5; +emojiColorsSepColor: shadowFg; emojiSwitchSkip: 27px; emojiSwitchImgSkip: 21px; @@ -176,8 +176,8 @@ emojiSwitchEmoji: icon {{ "emoji_switch-flip_horizontal", emojiSwitchColor }}; stickerPanSize: size(64px, 64px); stickerPanPadding: 11px; stickerPanDelete: icon { - { "emoji_delete_bg", #000000cc }, - { "emoji_delete", #ffffff }, + { "emoji_delete_bg", stickerPanDeleteBg }, + { "emoji_delete", stickerPanDeleteFg }, }; stickerPanDeleteOpacity: 0.5; stickerIconPadding: 5px; @@ -186,15 +186,14 @@ stickerIconSel: 2px; stickerIconSelColor: emojiIconFgActive; stickerIconMove: 400; stickerPreviewDuration: 150; -stickerPreviewBg: #FFFFFFB0; stickerPreviewMin: 0.1; hashtagClose: IconButton { width: 30px; height: 30px; - icon: simpleCloseIcon; - iconOver: simpleCloseIconOver; + icon: smallCloseIcon; + iconOver: smallCloseIconOver; iconPosition: point(10px, 10px); rippleAreaPosition: point(5px, 5px); diff --git a/Telegram/SourceFiles/ui/widgets/scroll_area.cpp b/Telegram/SourceFiles/ui/widgets/scroll_area.cpp index 99e55ae96..c14da7696 100644 --- a/Telegram/SourceFiles/ui/widgets/scroll_area.cpp +++ b/Telegram/SourceFiles/ui/widgets/scroll_area.cpp @@ -50,7 +50,7 @@ ScrollBar::ScrollBar(ScrollArea *parent, bool vert, const style::ScrollArea *st) connect(&_hideTimer, SIGNAL(timeout()), this, SLOT(onHideTimer())); connect(_connected, SIGNAL(valueChanged(int)), this, SLOT(onValueChanged())); - connect(_connected, SIGNAL(rangeChanged(int, int)), this, SLOT(updateBar())); + connect(_connected, SIGNAL(rangeChanged(int, int)), this, SLOT(onRangeChanged())); updateBar(); } @@ -64,6 +64,11 @@ void ScrollBar::onValueChanged() { updateBar(); } +void ScrollBar::onRangeChanged() { + area()->onInnerResized(); + updateBar(); +} + void ScrollBar::updateBar(bool force) { QRect newBar; if (_connected->maximum() != _scrollMax) { @@ -180,9 +185,9 @@ void ScrollBar::paintEvent(QPaintEvent *e) { auto deltal = _vertical ? _st->deltax : 0, deltar = _vertical ? _st->deltax : 0; auto deltat = _vertical ? 0 : _st->deltax, deltab = _vertical ? 0 : _st->deltax; p.setPen(Qt::NoPen); - auto bg = anim::color(_st->bgColor, _st->bgOverColor, _a_over.current(ms, (_over || _moving) ? 1. : 0.)); + auto bg = anim::color(_st->bg, _st->bgOver, _a_over.current(ms, (_over || _moving) ? 1. : 0.)); bg.setAlpha(anim::interpolate(0, bg.alpha(), opacity)); - auto bar = anim::color(_st->barColor, _st->barOverColor, _a_barOver.current(ms, (_overbar || _moving) ? 1. : 0.)); + auto bar = anim::color(_st->barBg, _st->barBgOver, _a_barOver.current(ms, (_overbar || _moving) ? 1. : 0.)); bar.setAlpha(anim::interpolate(0, bar.alpha(), opacity)); if (_st->round) { PainterHighQualityEnabler hq(p); @@ -387,6 +392,10 @@ void ScrollArea::onScrolled() { } } +void ScrollArea::onInnerResized() { + emit innerResized(); +} + int ScrollArea::scrollWidth() const { QWidget *w(widget()); return w ? qMax(w->width(), width()) : width(); diff --git a/Telegram/SourceFiles/ui/widgets/scroll_area.h b/Telegram/SourceFiles/ui/widgets/scroll_area.h index 002daf6a6..e52a91aaf 100644 --- a/Telegram/SourceFiles/ui/widgets/scroll_area.h +++ b/Telegram/SourceFiles/ui/widgets/scroll_area.h @@ -58,12 +58,13 @@ public: ScrollBar(ScrollArea *parent, bool vertical, const style::ScrollArea *st); void recountSize(); + void updateBar(bool force = false); void hideTimeout(TimeMs dt); -public slots: +private slots: void onValueChanged(); - void updateBar(bool force = false); + void onRangeChanged(); void onHideTimer(); signals: @@ -222,6 +223,7 @@ public slots: void scrollToY(int toTop, int toBottom = -1); void disableScroll(bool dis); void onScrolled(); + void onInnerResized(); void onTouchTimer(); void onTouchScrollTimer(); @@ -233,6 +235,7 @@ public slots: signals: void scrolled(); + void innerResized(); void scrollStarted(); void scrollFinished(); void geometryChanged(); diff --git a/Telegram/SourceFiles/ui/widgets/widgets.style b/Telegram/SourceFiles/ui/widgets/widgets.style index 841e4bc92..59e743ce9 100644 --- a/Telegram/SourceFiles/ui/widgets/widgets.style +++ b/Telegram/SourceFiles/ui/widgets/widgets.style @@ -118,10 +118,10 @@ Checkbox { } ScrollArea { - barColor: color; - bgColor: color; - barOverColor: color; - bgOverColor: color; + bg: color; + bgOver: color; + barBg: color; + barBgOver: color; round: pixels; @@ -170,7 +170,6 @@ FlatInput { borderWidth: pixels; borderColor: color; borderActive: color; - borderError: color; phColor: color; phFocusColor: color; @@ -203,7 +202,6 @@ InputField { border: pixels; borderActive: pixels; - borderError: pixels; font: font; @@ -490,10 +488,10 @@ defaultLightButton: RoundButton(defaultActiveButton) { } defaultScrollArea: ScrollArea { - barColor: #00000053; - bgColor: #0000001a; - barOverColor: #0000007a; - bgOverColor: #0000002c; + bg: scrollBg; + bgOver: scrollBgOver; + barBg: scrollBarBg; + barBgOver: scrollBarBgOver; round: 2px; @@ -505,7 +503,7 @@ defaultScrollArea: ScrollArea { topsh: 2px; bottomsh: 2px; - shColor: #00000012; + shColor: shadowFg; duration: 150; hiding: 1000; @@ -525,9 +523,9 @@ defaultSolidScroll: ScrollArea(defaultScrollArea) { defaultInputFont: font(17px); defaultFlatInput: FlatInput { - textColor: #000000; + textColor: windowFg; bgColor: windowBgOver; - bgActive: #ffffff; + bgActive: windowBg; width: 210px; height: 40px; align: align(left); @@ -536,11 +534,10 @@ defaultFlatInput: FlatInput { borderWidth: 2px; borderColor: windowBgOver; - borderActive: #54c3f3; - borderError: #ed8080; + borderActive: filterInputBorderFg; - phColor: #808080; - phFocusColor: #aaaaaa; + phColor: placeholderFg; + phFocusColor: placeholderFgActive; phAlign: align(left); phPos: point(2px, 0px); phShift: 50px; @@ -549,11 +546,11 @@ defaultFlatInput: FlatInput { defaultLeftOutlineButton: OutlineButton { outlineWidth: 3px; - outlineFg: windowBg; - outlineFgOver: windowBgActive; + outlineFg: outlineButtonBg; + outlineFgOver: outlineButtonOutlineFg; - textBg: windowBg; - textBgOver: #f2f7fa; + textBg: outlineButtonBg; + textBgOver: outlineButtonBgOver; textFg: windowActiveTextFg; textFgOver: windowActiveTextFg; @@ -562,7 +559,7 @@ defaultLeftOutlineButton: OutlineButton { padding: margins(11px, 5px, 11px, 5px); ripple: RippleAnimation(defaultRippleAnimation) { - color: lightButtonBgRipple; + color: outlineButtonBgRipple; } } attentionLeftOutlineButton: OutlineButton(defaultLeftOutlineButton) { @@ -594,13 +591,12 @@ defaultInputField: InputField { placeholderFont: font(semibold 14px); duration: 150; - borderFg: #e0e0e0; + borderFg: inputBorderFg; borderFgActive: activeLineFg; - borderFgError: #e48383; + borderFgError: activeLineFgError; border: 1px; borderActive: 2px; - borderError: 2px; font: boxTextFont; @@ -614,7 +610,7 @@ defaultCheckbox: Checkbox { textFg: windowFg; checkBg: transparent; - checkFg: #b3b3b3; + checkFg: checkboxFg; checkFgActive: windowBgActive; width: -44px; @@ -633,7 +629,7 @@ defaultCheckbox: Checkbox { rippleAreaSize: 38px; rippleAreaPosition: point(0px, 0px); rippleBg: windowBgOver; - rippleBgActive: #e0f2fa; + rippleBgActive: lightButtonBgOver; ripple: defaultRippleAnimation; } @@ -644,8 +640,8 @@ defaultIconButton: IconButton { widgetSlideDuration: 200; widgetFadeDuration: 200; -fieldSearchIcon: icon {{ "box_search", #aaaaaa, point(9px, 8px) }}; -boxFieldSearchIcon: icon {{ "box_search", #aaaaaa, point(10px, 9px) }}; +fieldSearchIcon: icon {{ "box_search", menuIconFg, point(9px, 8px) }}; +boxFieldSearchIcon: icon {{ "box_search", menuIconFg, point(10px, 9px) }}; SettingsSlider { height: pixels; @@ -671,8 +667,8 @@ defaultSettingsSlider: SettingsSlider { barTop: 5px; barSkip: 3px; barStroke: 3px; - barFg: #e1eaef; - barFgActive: windowBgActive; + barFg: sliderBgInactive; + barFgActive: sliderBgActive; labelTop: 17px; labelFont: normalFont; labelFg: windowActiveTextFg; @@ -687,11 +683,11 @@ defaultTabsSlider: SettingsSlider(defaultSettingsSlider) { barFg: transparent; labelTop: 16px; labelFont: semiboldFont; - labelFg: #999999; + labelFg: windowSubTextFg; labelFgActive: lightButtonFg; rippleBottomSkip: 1px; rippleBg: windowBgOver; - rippleBgActive: #e0f2fa; + rippleBgActive: lightButtonBgOver; ripple: defaultRippleAnimation; } @@ -732,7 +728,7 @@ defaultRoundCheckbox: RoundCheckbox { duration: 150; } -defaultMenuArrow: icon {{ "dropdown_submenu_arrow", #373737 }}; +defaultMenuArrow: icon {{ "dropdown_submenu_arrow", menuSubmenuArrowFg }}; defaultMenu: Menu { skip: 0px; @@ -740,17 +736,17 @@ defaultMenu: Menu { itemBgOver: windowBgOver; itemFg: windowFg; itemFgOver: windowFgOver; - itemFgDisabled: #cccccc; + itemFgDisabled: menuFgDisabled; itemFgShortcut: windowSubTextFg; itemFgShortcutOver: windowSubTextFgOver; - itemFgShortcutDisabled: #cccccc; + itemFgShortcutDisabled: menuFgDisabled; itemIconPosition: point(0px, 0px); itemPadding: margins(17px, 8px, 17px, 7px); itemFont: normalFont; separatorPadding: margins(0px, 5px, 0px, 5px); separatorWidth: 1px; - separatorFg: #f1f1f1; + separatorFg: menuSeparatorFg; arrow: defaultMenuArrow; @@ -789,19 +785,19 @@ defaultDropdownMenu: DropdownMenu { } historyToDownBelow: icon { - { "history_down_shadow", #00000040 }, + { "history_down_shadow", historyToDownShadow }, { "history_down_circle", windowBg, point(4px, 4px) }, }; historyToDownBelowOver: icon { - { "history_down_shadow", #00000040 }, + { "history_down_shadow", historyToDownShadow }, { "history_down_circle", windowBgOver, point(4px, 4px) }, }; contactsAddIconBelow: icon { - { "history_down_shadow", #00000040 }, + { "history_down_shadow", historyToDownShadow }, { "history_down_circle", activeButtonBg, point(4px, 4px) }, }; contactsAddIconBelowOver: icon { - { "history_down_shadow", #00000040 }, + { "history_down_shadow", historyToDownShadow }, { "history_down_circle", activeButtonBgOver, point(4px, 4px) }, }; diff --git a/Telegram/SourceFiles/window/window.style b/Telegram/SourceFiles/window/window.style index 2020a877f..5ecc22dea 100644 --- a/Telegram/SourceFiles/window/window.style +++ b/Telegram/SourceFiles/window/window.style @@ -33,7 +33,7 @@ windowShadowShift: 1px; adaptiveNormalWidth: 640px; adaptiveWideWidth: 1366px; -notifyBorder: #f1f1f1; +notifyBorder: windowShadowFgFallback; notifyBorderWidth: 1px; notifySlowHide: 4000; notifyPhotoSize: 62px; @@ -44,8 +44,8 @@ notifyClose: IconButton { width: 30px; height: 30px; - icon: simpleCloseIcon; - iconOver: simpleCloseIconOver; + icon: smallCloseIcon; + iconOver: smallCloseIconOver; iconPosition: point(10px, 10px); @@ -73,14 +73,14 @@ notifyReplyArea: InputField(defaultInputField) { textMargins: margins(8px, 8px, 8px, 6px); heightMin: 36px; heightMax: 72px; - placeholderFgActive: #aaaaaa; - placeholderFgError: #aaaaaa; + placeholderFg: placeholderFg; + placeholderFgActive: placeholderFgActive; + placeholderFgError: placeholderFgActive; placeholderMargins: margins(2px, 0px, 2px, 0px); placeholderScale: 0.; placeholderFont: normalFont; border: 0px; borderActive: 0px; - borderError: 0px; } notifySendReply: IconButton(historySend) { width: 36px; @@ -91,10 +91,7 @@ notifySendReply: IconButton(historySend) { titleUnreadCounterTop: 5px; titleUnreadCounterRight: 35px; -mainMenuBg: #ffffff; mainMenuWidth: 274px; -mainMenuCoverBg: #419fd9; -mainMenuCoverFg: windowFgActive; mainMenuCoverHeight: 140px; mainMenuUserpicLeft: 24px; mainMenuUserpicTop: 22px; @@ -182,7 +179,7 @@ titleButtonClose: IconButton(titleButtonMinimize) { topBarHeight: 54px; topBarMenuPosition: point(-2px, 35px); topBarDuration: 200; -topBarBackward: icon {{ "title_back", #a3a3a3 }}; +topBarBackward: icon {{ "title_back", menuIconFg }}; topBarForwardAlpha: 0.6; topBarBack: icon {{ "title_back", lightButtonFg }}; topBarArrowPadding: margins(39px, 8px, 17px, 8px); diff --git a/Telegram/SourceFiles/window/window_slide_animation.cpp b/Telegram/SourceFiles/window/window_slide_animation.cpp index 6e4323c01..ba6657e54 100644 --- a/Telegram/SourceFiles/window/window_slide_animation.cpp +++ b/Telegram/SourceFiles/window/window_slide_animation.cpp @@ -44,7 +44,7 @@ void SlideAnimation::paintContents(Painter &p, const QRect &update) const { if (_topBarShadowEnabled) { p.setOpacity(1); - p.fillRect(0, st::topBarHeight, _cacheOver.width() / retina, st::lineWidth, st::shadowColor); + p.fillRect(0, st::topBarHeight, _cacheOver.width() / retina, st::lineWidth, st::shadowFg); } } diff --git a/Telegram/SourceFiles/window/window_theme.cpp b/Telegram/SourceFiles/window/window_theme.cpp index a63dfca3c..dfa65f878 100644 --- a/Telegram/SourceFiles/window/window_theme.cpp +++ b/Telegram/SourceFiles/window/window_theme.cpp @@ -328,13 +328,20 @@ QImage prepareBackgroundImage(QImage &&image) { return std_::move(image); } +void initColor(const style::color &color, float64 hue, float64 saturation) { + auto original = color->c; + original.setHslF(hue, saturation, original.lightnessF(), original.alphaF()); + color.set(original.red(), original.green(), original.blue(), original.alpha()); +} + void initColorsFromBackground(const QImage &img) { - uint64 components[3] = { 0 }, componentsScroll[3] = { 0 }; + uint64 components[3] = { 0 }; + uint64 componentsScroll[3] = { 0 }; auto w = img.width(); auto h = img.height(); auto size = w * h; if (auto pix = img.constBits()) { - for (int i = 0, l = size * 4; i != l; i += 4) { + for (auto i = 0, l = size * 4; i != l; i += 4) { components[2] += pix[i + 0]; components[1] += pix[i + 1]; components[0] += pix[i + 2]; @@ -342,74 +349,20 @@ void initColorsFromBackground(const QImage &img) { } if (size) { - for (int i = 0; i != 3; ++i) { + for (auto i = 0; i != 3; ++i) { components[i] /= size; } } - int maxtomin[3] = { 0, 1, 2 }; - if (components[maxtomin[0]] < components[maxtomin[1]]) { - qSwap(maxtomin[0], maxtomin[1]); - } - if (components[maxtomin[1]] < components[maxtomin[2]]) { - qSwap(maxtomin[1], maxtomin[2]); - if (components[maxtomin[0]] < components[maxtomin[1]]) { - qSwap(maxtomin[0], maxtomin[1]); - } - } - uint64 max = qMax(1ULL, components[maxtomin[0]]), mid = qMax(1ULL, components[maxtomin[1]]), min = qMax(1ULL, components[maxtomin[2]]); - - memcpy(componentsScroll, components, sizeof(components)); - - if (max != min) { - if (min > uint64(qRound(0.77 * max))) { - uint64 newmin = qRound(0.77 * max); // min saturation 23% - uint64 newmid = max - ((max - mid) * (max - newmin)) / (max - min); - components[maxtomin[1]] = newmid; - components[maxtomin[2]] = newmin; - } - uint64 newmin = qRound(0.77 * max); // saturation 23% for scroll - uint64 newmid = max - ((max - mid) * (max - newmin)) / (max - min); - componentsScroll[maxtomin[1]] = newmid; - componentsScroll[maxtomin[2]] = newmin; - } - - float64 luminance = 0.299 * componentsScroll[0] + 0.587 * componentsScroll[1] + 0.114 * componentsScroll[2]; - uint64 maxScroll = max; - if (luminance < 0.5 * 0xFF) { - maxScroll += qRound(0.2 * 0xFF); - } else { - maxScroll -= qRound(0.2 * 0xFF); - } - componentsScroll[maxtomin[2]] = qMin(uint64(float64(componentsScroll[maxtomin[2]]) * maxScroll / float64(componentsScroll[maxtomin[0]])), 0xFFULL); - componentsScroll[maxtomin[1]] = qMin(uint64(float64(componentsScroll[maxtomin[1]]) * maxScroll / float64(componentsScroll[maxtomin[0]])), 0xFFULL); - componentsScroll[maxtomin[0]] = qMin(maxScroll, 0xFFULL); - - if (max > uint64(qRound(0.2 * 0xFF))) { // brightness greater than 20% - max -= qRound(0.2 * 0xFF); - } else { - max = 0; - } - components[maxtomin[2]] = uint64(float64(components[maxtomin[2]]) * max / float64(components[maxtomin[0]])); - components[maxtomin[1]] = uint64(float64(components[maxtomin[1]]) * max / float64(components[maxtomin[0]])); - components[maxtomin[0]] = max; - - uchar r = uchar(components[0]); - uchar g = uchar(components[1]); - uchar b = uchar(components[2]); - st::msgServiceBg.set(r, g, b, st::msgServiceBg->c.alpha()); - - float64 alphaSel = st::msgServiceSelectBg->c.alphaF(), addSel = (1. - ((1. - alphaSel) / (1. - st::msgServiceBg->c.alphaF()))) * 0xFF; - uchar rsel = snap(qRound(((1. - alphaSel) * r + addSel) / alphaSel), 0, 0xFF); - uchar gsel = snap(qRound(((1. - alphaSel) * g + addSel) / alphaSel), 0, 0xFF); - uchar bsel = snap(qRound(((1. - alphaSel) * b + addSel) / alphaSel), 0, 0xFF); - st::msgServiceSelectBg.set(r, g, b, qRound(alphaSel * 0xFF)); - - uchar rScroll = uchar(componentsScroll[0]), gScroll = uchar(componentsScroll[1]), bScroll = uchar(componentsScroll[2]); - st::historyScroll.barColor.set(rScroll, gScroll, bScroll, st::historyScroll.barColor->c.alpha()); - st::historyScroll.bgColor.set(rScroll, gScroll, bScroll, st::historyScroll.bgColor->c.alpha()); - st::historyScroll.barOverColor.set(rScroll, gScroll, bScroll, st::historyScroll.barOverColor->c.alpha()); - st::historyScroll.bgOverColor.set(rScroll, gScroll, bScroll, st::historyScroll.bgOverColor->c.alpha()); + auto bgColor = QColor(components[0], components[1], components[2]); + auto hue = bgColor.hslHueF(); + auto saturation = bgColor.hslSaturationF(); + initColor(st::msgServiceBg, hue, saturation); + initColor(st::msgServiceBgSelected, hue, saturation); + initColor(st::historyScroll.bg, hue, saturation); + initColor(st::historyScroll.bgOver, hue, saturation); + initColor(st::historyScroll.barBg, hue, saturation); + initColor(st::historyScroll.barBgOver, hue, saturation); } } // namespace @@ -461,7 +414,9 @@ void ChatBackground::setImage(int32 id, QImage &&image) { } void ChatBackground::setPreparedImage(QImage &&image) { - initColorsFromBackground(image); + if (_id != kThemeBackground && _id != internal::kTestingThemeBackground) { + initColorsFromBackground(image); + } _image = App::pixmapFromImageInPlace(std_::move(image)); } diff --git a/Telegram/build/version b/Telegram/build/version index aa37f0cb3..b2172bc8d 100644 --- a/Telegram/build/version +++ b/Telegram/build/version @@ -3,4 +3,4 @@ AppVersionStrMajor 0.10 AppVersionStrSmall 0.10.20 AppVersionStr 0.10.20 AlphaChannel 0 -BetaVersion 10020002 +BetaVersion 10020003