FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
tdesktop/Telegram/SourceFiles/ui/effects/premium_graphics.h at dev · feiyunwill/tdesktop · GitHub
feiyunwill
/
tdesktop
Public
forked from
telegramdesktop/tdesktop
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
tdesktop
/
Telegram
/
SourceFiles
/
ui
/
effects
/
premium_graphics.h
Copy path
More file actions
More file actions
Latest commit
History
History
History
133 lines (109 loc) · 3.15 KB
Breadcrumbs
tdesktop
/
Telegram
/
SourceFiles
/
ui
/
effects
/
premium_graphics.h
Copy path
File metadata and controls
133 lines (109 loc) · 3.15 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
/*
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
*/
#
pragma
once
#
include
"
ui/effects/round_checkbox.h
"
namespace
style
{
struct
PremiumLimits
;
}
//
namespace style
namespace
tr
{
template
<
typename
...>
struct
phrase
;
}
//
namespace tr
enum
lngtag_count :
int
;
namespace
Data
{
struct
PremiumSubscriptionOption
;
}
//
namespace Data
namespace
style
{
struct
RoundImageCheckbox
;
struct
PremiumOption
;
struct
TextStyle
;
struct
PremiumBubble
;
}
//
namespace style
namespace
Ui
{
class
GenericBox
;
class
RadiobuttonGroup
;
class
VerticalLayout
;
namespace
Premium
{
inline
constexpr
auto
kLimitRowRatio
=
0.5
;
[[nodiscard]]
QString
Svg
();
[[nodiscard]]
QByteArray
ColorizedSvg
(
const
QGradientStops &gradientStops);
[[nodiscard]]
QImage
GenerateStarForLightTopBar
(QRectF rect);
void
AddLimitRow
(
not_null<Ui::VerticalLayout*> parent,
const
style::PremiumLimits &st,
QString max,
QString min = {},
float64 ratio =
kLimitRowRatio
);
void
AddLimitRow
(
not_null<Ui::VerticalLayout*> parent,
const
style::PremiumLimits &st,
int
max,
std::optional<tr::phrase<lngtag_count>> phrase,
int
min =
0
,
float64 ratio =
kLimitRowRatio
);
struct
LimitRowLabels
{
rpl::producer<QString> leftLabel;
rpl::producer<QString> leftCount;
rpl::producer<QString> rightLabel;
rpl::producer<QString> rightCount;
Fn<QBrush()> activeLineBg;
};
struct
LimitRowState
{
float64 ratio =
0
.;
bool
animateFromZero =
false
;
bool
dynamic =
false
;
};
void
AddLimitRow
(
not_null<Ui::VerticalLayout*> parent,
const
style::PremiumLimits &st,
LimitRowLabels labels,
rpl::producer<LimitRowState> state,
const
style::margins &padding);
struct
AccountsRowArgs
final
{
std::shared_ptr<Ui::RadiobuttonGroup> group;
const
style::RoundImageCheckbox &st;
const
style::TextStyle &stName;
const
style::color &stNameFg;
struct
Entry
final
{
QString name;
Ui::RoundImageCheckbox::PaintRoundImage paintRoundImage;
};
std::vector<Entry> entries;
};
void
AddAccountsRow
(
not_null<Ui::VerticalLayout*> parent,
AccountsRowArgs &&args);
[[nodiscard]]
QGradientStops
LimitGradientStops
();
[[nodiscard]]
QGradientStops
ButtonGradientStops
();
[[nodiscard]]
QGradientStops
LockGradientStops
();
[[nodiscard]]
QGradientStops
FullHeightGradientStops
();
[[nodiscard]]
QGradientStops
GiftGradientStops
();
[[nodiscard]]
QGradientStops
CreditsIconGradientStops
();
[[nodiscard]]
QLinearGradient
ComputeGradient
(
not_null<QWidget*> content,
int
left,
int
width);
struct
ListEntry
final
{
rpl::producer<QString> title;
rpl::producer<TextWithEntities> about;
int
leftNumber =
0
;
int
rightNumber =
0
;
std::optional<QString> customRightText;
const
style::icon *icon =
nullptr
;
};
void
ShowListBox
(
not_null<Ui::GenericBox*> box,
const
style::PremiumLimits &st,
std::vector<ListEntry> entries);
void
AddGiftOptions
(
not_null<Ui::VerticalLayout*> parent,
std::shared_ptr<Ui::RadiobuttonGroup> group,
std::vector<Data::PremiumSubscriptionOption> gifts,
const
style::PremiumOption &st,
bool
topBadges =
false
);
}
//
namespace Premium
}
//
namespace Ui
Back
|
FazBrowse Home
|
New Git URL