mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-05-30 03:33:55 +02:00
Moved out some constant color indices to separated style file.
This commit is contained in:
parent
c04f68f25c
commit
2dfa58aae2
6 changed files with 28 additions and 15 deletions
|
@ -45,6 +45,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "ui/widgets/labels.h"
|
#include "ui/widgets/labels.h"
|
||||||
#include "ui/wrap/slide_wrap.h"
|
#include "ui/wrap/slide_wrap.h"
|
||||||
#include "ui/ui_utility.h"
|
#include "ui/ui_utility.h"
|
||||||
|
#include "styles/style_color_indices.h"
|
||||||
#include "styles/style_credits.h"
|
#include "styles/style_credits.h"
|
||||||
#include "styles/style_giveaway.h"
|
#include "styles/style_giveaway.h"
|
||||||
#include "styles/style_info.h"
|
#include "styles/style_info.h"
|
||||||
|
@ -59,7 +60,6 @@ namespace {
|
||||||
|
|
||||||
constexpr auto kDoneTooltipDuration = 5 * crl::time(1000);
|
constexpr auto kDoneTooltipDuration = 5 * crl::time(1000);
|
||||||
constexpr auto kAdditionalPrizeLengthMax = 128;
|
constexpr auto kAdditionalPrizeLengthMax = 128;
|
||||||
constexpr auto kColorIndexCredits = int(1);
|
|
||||||
|
|
||||||
[[nodiscard]] QDateTime ThreeDaysAfterToday() {
|
[[nodiscard]] QDateTime ThreeDaysAfterToday() {
|
||||||
auto dateNow = QDateTime::currentDateTime();
|
auto dateNow = QDateTime::currentDateTime();
|
||||||
|
@ -370,7 +370,7 @@ void CreateGiveawayBox(
|
||||||
prepaid->credits
|
prepaid->credits
|
||||||
? GiveawayType::PrepaidCredits
|
? GiveawayType::PrepaidCredits
|
||||||
: GiveawayType::Prepaid,
|
: GiveawayType::Prepaid,
|
||||||
prepaid->credits ? kColorIndexCredits : prepaid->id,
|
prepaid->credits ? st::colorIndexOrange : prepaid->id,
|
||||||
tr::lng_boosts_prepaid_giveaway_single(),
|
tr::lng_boosts_prepaid_giveaway_single(),
|
||||||
prepaid->credits
|
prepaid->credits
|
||||||
? tr::lng_boosts_prepaid_giveaway_credits_status(
|
? tr::lng_boosts_prepaid_giveaway_credits_status(
|
||||||
|
@ -508,7 +508,7 @@ void CreateGiveawayBox(
|
||||||
object_ptr<Giveaway::GiveawayTypeRow>(
|
object_ptr<Giveaway::GiveawayTypeRow>(
|
||||||
box,
|
box,
|
||||||
GiveawayType::Credits,
|
GiveawayType::Credits,
|
||||||
kColorIndexCredits,
|
st::colorIndexOrange,
|
||||||
tr::lng_credits_summary_title(),
|
tr::lng_credits_summary_title(),
|
||||||
tr::lng_giveaway_create_subtitle(),
|
tr::lng_giveaway_create_subtitle(),
|
||||||
std::move(badge)));
|
std::move(badge)));
|
||||||
|
|
|
@ -16,14 +16,12 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "ui/widgets/checkbox.h"
|
#include "ui/widgets/checkbox.h"
|
||||||
#include "styles/style_boxes.h"
|
#include "styles/style_boxes.h"
|
||||||
#include "styles/style_chat.h"
|
#include "styles/style_chat.h"
|
||||||
|
#include "styles/style_color_indices.h"
|
||||||
#include "styles/style_giveaway.h"
|
#include "styles/style_giveaway.h"
|
||||||
#include "styles/style_statistics.h"
|
#include "styles/style_statistics.h"
|
||||||
|
|
||||||
namespace Giveaway {
|
namespace Giveaway {
|
||||||
|
|
||||||
constexpr auto kColorIndexSpecific = int(4);
|
|
||||||
constexpr auto kColorIndexRandom = int(2);
|
|
||||||
|
|
||||||
GiveawayTypeRow::GiveawayTypeRow(
|
GiveawayTypeRow::GiveawayTypeRow(
|
||||||
not_null<Ui::RpWidget*> parent,
|
not_null<Ui::RpWidget*> parent,
|
||||||
Type type,
|
Type type,
|
||||||
|
@ -32,7 +30,7 @@ GiveawayTypeRow::GiveawayTypeRow(
|
||||||
: GiveawayTypeRow(
|
: GiveawayTypeRow(
|
||||||
parent,
|
parent,
|
||||||
type,
|
type,
|
||||||
(type == Type::SpecificUsers) ? kColorIndexSpecific : kColorIndexRandom,
|
(type == Type::SpecificUsers) ? st::colorIndexBlue : st::colorIndexGreen,
|
||||||
(type == Type::SpecificUsers)
|
(type == Type::SpecificUsers)
|
||||||
? tr::lng_giveaway_award_option()
|
? tr::lng_giveaway_award_option()
|
||||||
: (type == Type::Random)
|
: (type == Type::Random)
|
||||||
|
|
|
@ -39,6 +39,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "ui/widgets/slider_natural_width.h"
|
#include "ui/widgets/slider_natural_width.h"
|
||||||
#include "ui/wrap/slide_wrap.h"
|
#include "ui/wrap/slide_wrap.h"
|
||||||
#include "ui/ui_utility.h"
|
#include "ui/ui_utility.h"
|
||||||
|
#include "styles/style_color_indices.h"
|
||||||
#include "styles/style_dialogs.h" // dialogsSearchTabs
|
#include "styles/style_dialogs.h" // dialogsSearchTabs
|
||||||
#include "styles/style_giveaway.h"
|
#include "styles/style_giveaway.h"
|
||||||
#include "styles/style_info.h"
|
#include "styles/style_info.h"
|
||||||
|
@ -339,7 +340,6 @@ void InnerWidget::fill() {
|
||||||
Ui::AddSkip(inner);
|
Ui::AddSkip(inner);
|
||||||
|
|
||||||
if (!status.prepaidGiveaway.empty()) {
|
if (!status.prepaidGiveaway.empty()) {
|
||||||
constexpr auto kColorIndexCredits = int(1);
|
|
||||||
const auto multiplier = Api::PremiumGiftCodeOptions(_peer)
|
const auto multiplier = Api::PremiumGiftCodeOptions(_peer)
|
||||||
.giveawayBoostsPerPremium();
|
.giveawayBoostsPerPremium();
|
||||||
Ui::AddSkip(inner);
|
Ui::AddSkip(inner);
|
||||||
|
@ -352,7 +352,7 @@ void InnerWidget::fill() {
|
||||||
g.credits
|
g.credits
|
||||||
? GiveawayTypeRow::Type::PrepaidCredits
|
? GiveawayTypeRow::Type::PrepaidCredits
|
||||||
: GiveawayTypeRow::Type::Prepaid,
|
: GiveawayTypeRow::Type::Prepaid,
|
||||||
g.credits ? kColorIndexCredits : g.id,
|
g.credits ? st::colorIndexOrange : g.id,
|
||||||
g.credits
|
g.credits
|
||||||
? tr::lng_boosts_prepaid_giveaway_single()
|
? tr::lng_boosts_prepaid_giveaway_single()
|
||||||
: tr::lng_boosts_prepaid_giveaway_quantity(
|
: tr::lng_boosts_prepaid_giveaway_quantity(
|
||||||
|
|
|
@ -35,6 +35,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "ui/wrap/slide_wrap.h"
|
#include "ui/wrap/slide_wrap.h"
|
||||||
#include "ui/wrap/vertical_layout.h"
|
#include "ui/wrap/vertical_layout.h"
|
||||||
#include "styles/style_boxes.h"
|
#include "styles/style_boxes.h"
|
||||||
|
#include "styles/style_color_indices.h"
|
||||||
#include "styles/style_credits.h"
|
#include "styles/style_credits.h"
|
||||||
#include "styles/style_dialogs.h" // dialogsStoriesFull.
|
#include "styles/style_dialogs.h" // dialogsStoriesFull.
|
||||||
#include "styles/style_layers.h" // boxRowPadding.
|
#include "styles/style_layers.h" // boxRowPadding.
|
||||||
|
@ -47,9 +48,6 @@ namespace Info::Statistics {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using BoostCallback = Fn<void(const Data::Boost &)>;
|
using BoostCallback = Fn<void(const Data::Boost &)>;
|
||||||
constexpr auto kColorIndexCredits = int(1);
|
|
||||||
constexpr auto kColorIndexUnclaimed = int(3);
|
|
||||||
constexpr auto kColorIndexPending = int(4);
|
|
||||||
|
|
||||||
[[nodiscard]] PeerListRowId UniqueRowIdFromEntry(
|
[[nodiscard]] PeerListRowId UniqueRowIdFromEntry(
|
||||||
const Data::CreditsHistoryEntry &entry) {
|
const Data::CreditsHistoryEntry &entry) {
|
||||||
|
@ -475,10 +473,10 @@ BoostRow::BoostRow(const Data::Boost &boost)
|
||||||
, _boost(boost)
|
, _boost(boost)
|
||||||
, _userpic(
|
, _userpic(
|
||||||
Ui::EmptyUserpic::UserpicColor(boost.credits
|
Ui::EmptyUserpic::UserpicColor(boost.credits
|
||||||
? kColorIndexCredits
|
? st::colorIndexOrange
|
||||||
: boost.isUnclaimed
|
: boost.isUnclaimed
|
||||||
? kColorIndexUnclaimed
|
? st::colorIndexSea
|
||||||
: kColorIndexPending),
|
: st::colorIndexBlue),
|
||||||
QString()) {
|
QString()) {
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
16
Telegram/SourceFiles/ui/color_indices.style
Normal file
16
Telegram/SourceFiles/ui/color_indices.style
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
/*
|
||||||
|
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
|
||||||
|
*/
|
||||||
|
|
||||||
|
colorIndexRed: 0;
|
||||||
|
colorIndexOrange: 1;
|
||||||
|
colorIndexGreen: 2;
|
||||||
|
colorIndexSea: 3;
|
||||||
|
colorIndexBlue: 4;
|
||||||
|
colorIndexPurple: 5;
|
||||||
|
colorIndexPink: 6;
|
||||||
|
colorIndexYellow: 7;
|
|
@ -18,6 +18,7 @@ set(style_files
|
||||||
ui/chat/chat.style
|
ui/chat/chat.style
|
||||||
ui/effects/credits.style
|
ui/effects/credits.style
|
||||||
ui/effects/premium.style
|
ui/effects/premium.style
|
||||||
|
ui/color_indices.style
|
||||||
boxes/boxes.style
|
boxes/boxes.style
|
||||||
dialogs/dialogs.style
|
dialogs/dialogs.style
|
||||||
chat_helpers/chat_helpers.style
|
chat_helpers/chat_helpers.style
|
||||||
|
|
Loading…
Add table
Reference in a new issue