diff --git a/Telegram/SourceFiles/boxes/gift_premium_box.cpp b/Telegram/SourceFiles/boxes/gift_premium_box.cpp index 7de1b91cc..0f8aa249c 100644 --- a/Telegram/SourceFiles/boxes/gift_premium_box.cpp +++ b/Telegram/SourceFiles/boxes/gift_premium_box.cpp @@ -32,7 +32,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "ui/effects/premium_stars_colored.h" #include "ui/effects/premium_top_bar.h" #include "ui/layers/generic_box.h" -#include "ui/text/format_values.h" #include "ui/text/text_utilities.h" #include "ui/widgets/checkbox.h" #include "ui/widgets/gradient_round_button.h" @@ -41,8 +40,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "window/window_peer_menu.h" // ShowChooseRecipientBox. #include "window/window_session_controller.h" #include "styles/style_boxes.h" +#include "styles/style_giveaway.h" #include "styles/style_layers.h" -#include "styles/style_chat_helpers.h" #include "styles/style_info.h" #include "styles/style_premium.h" diff --git a/Telegram/SourceFiles/info/boosts/create_giveaway_box.cpp b/Telegram/SourceFiles/info/boosts/create_giveaway_box.cpp index 6304cba74..0d0ebc1de 100644 --- a/Telegram/SourceFiles/info/boosts/create_giveaway_box.cpp +++ b/Telegram/SourceFiles/info/boosts/create_giveaway_box.cpp @@ -32,6 +32,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "ui/widgets/continuous_sliders.h" #include "ui/widgets/labels.h" #include "ui/wrap/slide_wrap.h" +#include "styles/style_giveaway.h" #include "styles/style_info.h" #include "styles/style_layers.h" #include "styles/style_premium.h" diff --git a/Telegram/SourceFiles/info/boosts/giveaway/giveaway.style b/Telegram/SourceFiles/info/boosts/giveaway/giveaway.style new file mode 100644 index 000000000..d04b3bf6c --- /dev/null +++ b/Telegram/SourceFiles/info/boosts/giveaway/giveaway.style @@ -0,0 +1,117 @@ +/* +This file is part of Telegram Desktop, +the official desktop application for the Telegram messaging service. + +For license and copyright information please follow this link: +https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL +*/ +using "ui/basic.style"; +using "boxes/boxes.style"; +using "ui/effects/premium.style"; + +giveawayLoadingLabel: FlatLabel(membersAbout) { +} +giveawayGiftCodeTopHeight: 195px; +giveawayGiftCodeLink: FlatLabel(defaultFlatLabel) { + margin: margins(10px, 12px, 10px, 8px); + textFg: menuIconColor; + maxHeight: 24px; +} +giveawayGiftCodeLinkCopy: icon{{ "menu/copy", menuIconColor }}; +giveawayGiftCodeLinkHeight: 42px; +giveawayGiftCodeLinkCopyWidth: 40px; +giveawayGiftCodeLinkMargin: margins(24px, 8px, 24px, 12px); + +giveawayGiftCodeGiftOption: PremiumOption(premiumGiftOption) { + badgeShift: point(5px, 0px); +} +giveawayGiftCodeStartButton: RoundButton(defaultActiveButton) { + height: 42px; + textTop: 12px; + radius: 6px; +} +giveawayGiftCodeQuantitySubtitle: FlatLabel(defaultFlatLabel) { + style: TextStyle(semiboldTextStyle) { + font: font(boxFontSize semibold); + } + textFg: windowActiveTextFg; + minWidth: 240px; + align: align(right); +} +giveawayGiftCodeQuantityFloat: FlatLabel(defaultFlatLabel) { + style: TextStyle(semiboldTextStyle) { + font: font(13px); + } + textFg: windowActiveTextFg; + minWidth: 50px; + align: align(center); +} + +boostLinkStatsButton: IconButton(defaultIconButton) { + width: giveawayGiftCodeLinkCopyWidth; + height: giveawayGiftCodeLinkHeight; + icon: icon{{ "menu/stats", menuIconColor }}; + iconOver: icon{{ "menu/stats", menuIconColor }}; + ripple: emptyRippleAnimation; +} + +giveawayGiftCodeTable: Table(defaultTable) { + labelMinWidth: 91px; +} +giveawayGiftCodeTableMargin: margins(24px, 4px, 24px, 4px); +giveawayGiftCodeLabel: FlatLabel(defaultFlatLabel) { + textFg: menuIconColor; + maxHeight: 24px; + style: TextStyle(semiboldTextStyle) { + font: font(12px semibold); + } +} +giveawayGiftCodeLabelMargin: margins(13px, 10px, 13px, 10px); +giveawayGiftCodeValue: FlatLabel(defaultFlatLabel) { + maxHeight: 24px; + style: TextStyle(defaultTextStyle) { + font: font(12px); + linkUnderline: kLinkUnderlineNever; + } +} +giveawayGiftCodeValueMargin: margins(13px, 9px, 13px, 9px); +giveawayGiftCodePeerMargin: margins(11px, 6px, 11px, 4px); +giveawayGiftCodeUserpic: UserpicButton(defaultUserpicButton) { + size: size(24px, 24px); + photoSize: 24px; + photoPosition: point(-1px, -1px); +} +giveawayGiftCodeNamePosition: point(32px, 4px); +giveawayGiftCodeCover: PremiumCover(userPremiumCover) { + starSize: size(92px, 90px); + starTopSkip: 20px; + titlePadding: margins(0px, 15px, 0px, 17px); + titleFont: font(15px semibold); + about: FlatLabel(userPremiumCoverAbout) { + textFg: windowBoldFg; + style: TextStyle(premiumAboutTextStyle) { + lineHeight: 17px; + } + } +} +giveawayGiftCodeFooter: FlatLabel(defaultFlatLabel) { + align: align(top); + textFg: windowBoldFg; +} +giveawayGiftCodeFooterMargin: margins(0px, 9px, 0px, 4px); +giveawayGiftCodeBox: Box(defaultBox) { + buttonPadding: margins(22px, 11px, 22px, 22px); + buttonHeight: 42px; + button: RoundButton(defaultActiveButton) { + height: 42px; + textTop: 12px; + font: font(13px semibold); + } + shadowIgnoreTopSkip: true; +} +giveawayRefundedLabel: FlatLabel(boxLabel) { + align: align(top); + style: semiboldTextStyle; + textFg: attentionButtonFg; +} +giveawayRefundedPadding: margins(8px, 10px, 8px, 10px); diff --git a/Telegram/SourceFiles/ui/boxes/boost_box.cpp b/Telegram/SourceFiles/ui/boxes/boost_box.cpp index 408b54c4f..fb7708907 100644 --- a/Telegram/SourceFiles/ui/boxes/boost_box.cpp +++ b/Telegram/SourceFiles/ui/boxes/boost_box.cpp @@ -13,6 +13,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "ui/layers/generic_box.h" #include "ui/text/text_utilities.h" #include "ui/widgets/buttons.h" +#include "styles/style_giveaway.h" #include "styles/style_layers.h" #include "styles/style_premium.h" diff --git a/Telegram/SourceFiles/ui/effects/premium.style b/Telegram/SourceFiles/ui/effects/premium.style index 9d8736fde..46305a2c7 100644 --- a/Telegram/SourceFiles/ui/effects/premium.style +++ b/Telegram/SourceFiles/ui/effects/premium.style @@ -276,110 +276,3 @@ boostReplaceIconSkip: 3px; boostReplaceIconOutline: 2px; boostReplaceIconAdd: point(4px, 2px); boostReplaceArrow: icon{{ "mediaview/next", windowSubTextFg }}; - -giveawayLoadingLabel: FlatLabel(membersAbout) { -} -giveawayGiftCodeTopHeight: 195px; -giveawayGiftCodeLink: FlatLabel(defaultFlatLabel) { - margin: margins(10px, 12px, 10px, 8px); - textFg: menuIconColor; - maxHeight: 24px; -} -giveawayGiftCodeLinkCopy: icon{{ "menu/copy", menuIconColor }}; -giveawayGiftCodeLinkHeight: 42px; -giveawayGiftCodeLinkCopyWidth: 40px; -giveawayGiftCodeLinkMargin: margins(24px, 8px, 24px, 12px); - -giveawayGiftCodeGiftOption: PremiumOption(premiumGiftOption) { - badgeShift: point(5px, 0px); -} -giveawayGiftCodeStartButton: RoundButton(defaultActiveButton) { - height: 42px; - textTop: 12px; - radius: 6px; -} -giveawayGiftCodeQuantitySubtitle: FlatLabel(defaultFlatLabel) { - style: TextStyle(semiboldTextStyle) { - font: font(boxFontSize semibold); - } - textFg: windowActiveTextFg; - minWidth: 240px; - align: align(right); -} -giveawayGiftCodeQuantityFloat: FlatLabel(defaultFlatLabel) { - style: TextStyle(semiboldTextStyle) { - font: font(13px); - } - textFg: windowActiveTextFg; - minWidth: 50px; - align: align(center); -} - -boostLinkStatsButton: IconButton(defaultIconButton) { - width: giveawayGiftCodeLinkCopyWidth; - height: giveawayGiftCodeLinkHeight; - icon: icon{{ "menu/stats", menuIconColor }}; - iconOver: icon{{ "menu/stats", menuIconColor }}; - ripple: emptyRippleAnimation; -} - -giveawayGiftCodeTable: Table(defaultTable) { - labelMinWidth: 91px; -} -giveawayGiftCodeTableMargin: margins(24px, 4px, 24px, 4px); -giveawayGiftCodeLabel: FlatLabel(defaultFlatLabel) { - textFg: menuIconColor; - maxHeight: 24px; - style: TextStyle(semiboldTextStyle) { - font: font(12px semibold); - } -} -giveawayGiftCodeLabelMargin: margins(13px, 10px, 13px, 10px); -giveawayGiftCodeValue: FlatLabel(defaultFlatLabel) { - maxHeight: 24px; - style: TextStyle(defaultTextStyle) { - font: font(12px); - linkUnderline: kLinkUnderlineNever; - } -} -giveawayGiftCodeValueMargin: margins(13px, 9px, 13px, 9px); -giveawayGiftCodePeerMargin: margins(11px, 6px, 11px, 4px); -giveawayGiftCodeUserpic: UserpicButton(defaultUserpicButton) { - size: size(24px, 24px); - photoSize: 24px; - photoPosition: point(-1px, -1px); -} -giveawayGiftCodeNamePosition: point(32px, 4px); -giveawayGiftCodeCover: PremiumCover(userPremiumCover) { - starSize: size(92px, 90px); - starTopSkip: 20px; - titlePadding: margins(0px, 15px, 0px, 17px); - titleFont: font(15px semibold); - about: FlatLabel(userPremiumCoverAbout) { - textFg: windowBoldFg; - style: TextStyle(premiumAboutTextStyle) { - lineHeight: 17px; - } - } -} -giveawayGiftCodeFooter: FlatLabel(defaultFlatLabel) { - align: align(top); - textFg: windowBoldFg; -} -giveawayGiftCodeFooterMargin: margins(0px, 9px, 0px, 4px); -giveawayGiftCodeBox: Box(defaultBox) { - buttonPadding: margins(22px, 11px, 22px, 22px); - buttonHeight: 42px; - button: RoundButton(defaultActiveButton) { - height: 42px; - textTop: 12px; - font: font(13px semibold); - } - shadowIgnoreTopSkip: true; -} -giveawayRefundedLabel: FlatLabel(boxLabel) { - align: align(top); - style: semiboldTextStyle; - textFg: attentionButtonFg; -} -giveawayRefundedPadding: margins(8px, 10px, 8px, 10px); diff --git a/Telegram/cmake/td_ui.cmake b/Telegram/cmake/td_ui.cmake index e0d6fa4f5..b9eab3397 100644 --- a/Telegram/cmake/td_ui.cmake +++ b/Telegram/cmake/td_ui.cmake @@ -23,6 +23,7 @@ set(style_files calls/calls.style export/view/export.style info/info.style + info/boosts/giveaway/giveaway.style info/userpic/info_userpic_builder.style intro/intro.style media/player/media_player.style