mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-22 02:07:24 +00:00
Show nice info about star rating.
This commit is contained in:
parent
baf932dd8b
commit
003e42a2ae
7
Telegram/Resources/icons/limits/filled_rating_crown.svg
Normal file
7
Telegram/Resources/icons/limits/filled_rating_crown.svg
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>Icon / Filled / Folder / filled_rating_crown</title>
|
||||
<g id="Icon-/-Filled-/-Folder-/-filled_rating_crown" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<path d="M12.006194,4 C12.2804747,4 12.5305167,4.06540388 12.7563199,4.19621163 C12.9821231,4.32701939 13.1625206,4.50276893 13.2975123,4.72346025 C13.4325041,4.94415157 13.5,5.18550018 13.5,5.44750606 C13.5,5.71705917 13.4325041,5.96227898 13.2975123,6.18316549 C13.1625206,6.404052 12.9821231,6.5799154 12.7563199,6.71075569 L15.4435899,11.5643277 C15.5815617,11.7639089 15.7563694,11.7899721 15.968013,11.6425174 L18.1781768,9.33989673 C18.0593923,9.13003568 18,8.89851056 18,8.64532138 C18,8.38325043 18.0675127,8.14188556 18.202538,7.92122677 C18.3375634,7.70056798 18.5179776,7.52481844 18.7437808,7.39397816 C18.969584,7.26313787 19.2198274,7.19771773 19.494511,7.19771773 C19.7726861,7.19771773 20.0256488,7.26313787 20.2533991,7.39397816 C20.4811495,7.52481844 20.6625206,7.69962458 20.7975123,7.91839656 C20.9325041,8.13716855 21,8.37947682 21,8.64532138 C21,8.91526486 20.9315305,9.16058227 20.7945916,9.38127359 C20.6576527,9.60196491 20.4753248,9.77771445 20.247608,9.90852221 C20.0847544,10.0020705 19.9099761,10.0621678 19.7232729,10.0888143 L18.6881679,14.8280591 L18.18147,17.2645439 C18.0360821,17.8406994 17.5858498,18.2705453 17.2433245,18.5609529 C16.9007991,18.8513606 16.024907,19 15.4030968,19 L8.60301533,19 C7.98112362,19 7.07922209,18.853651 6.73645226,18.5609529 C6.39368244,18.2682549 5.96970407,17.8361186 5.82537564,17.2645439 L5.33200224,14.8280591 L4.28780473,10.091804 C4.09296054,10.0668449 3.91161924,10.005751 3.74378084,9.90852221 C3.51797764,9.77771445 3.33756337,9.60196491 3.20253802,9.38127359 C3.06751267,9.16058227 3,8.91526486 3,8.64532138 C3,8.38325043 3.06751267,8.14188556 3.20253802,7.92122677 C3.33756337,7.70056798 3.51797764,7.52481844 3.74378084,7.39397816 C3.96958405,7.26313787 4.21982744,7.19771773 4.49451103,7.19771773 C4.77268607,7.19771773 5.02564877,7.26313787 5.25339913,7.39397816 C5.48114949,7.52481844 5.66252056,7.69962458 5.79751234,7.91839656 C5.93250411,8.13716855 6,8.37947682 6,8.64532138 C6,8.85527742 5.9585802,9.05033621 5.8757406,9.23049773 L5.8356,9.31024634 L8.05741354,11.6413327 C8.17558193,11.7218918 8.27307085,11.7527925 8.3498803,11.7340349 C8.42668976,11.7152773 8.49488107,11.6628546 8.55445424,11.576767 L11.2500459,6.70934707 C11.0234694,6.57865415 10.8419403,6.40326029 10.7054588,6.18316549 C10.5684863,5.96227898 10.5,5.71705917 10.5,5.44750606 C10.5,5.18172656 10.5675127,4.93943456 10.702538,4.72063004 C10.8375634,4.50182552 11.0189344,4.32701939 11.2466512,4.19621163 C11.474368,4.06540388 11.7275489,4 12.006194,4 Z" id="Path" fill="#FFFFFF" fill-rule="nonzero"></path>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.9 KiB |
7
Telegram/Resources/icons/limits/filled_understood.svg
Normal file
7
Telegram/Resources/icons/limits/filled_understood.svg
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>Icon / Filled / Folder / filled_understood</title>
|
||||
<g id="Icon-/-Filled-/-Folder-/-filled_understood" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<path d="M12.8474094,2.35452236 C13.885383,1.47475174 14.8173541,2.39162557 15.6118925,3.37253311 L15.7012514,3.4837597 C16.5164257,4.50413739 16.896938,5.20519347 17.573079,6.45345067 C18.2023878,7.61607163 19,9.78891004 19,11.0676479 L18.9982623,11.4602681 C18.9876271,12.5429001 18.9217408,13.3886119 18.6297323,14.4132675 L18.4373147,15.0832437 C17.6686959,17.7193108 17.0159257,19.2763685 14.5216634,19.7807735 C13.10206,20.068163 10.6477559,20.1900858 9.65842399,19.3946847 C7.99649075,18.0581246 7.24548521,16.7868457 6.69332563,15.7108913 L6.48407363,15.2966137 C6.20747049,14.7436067 5.49035123,13.0903916 6.59969082,12.2935391 C7.07533115,11.9524455 7.88026093,12.0496935 8.21540442,12.3820783 C9.4579233,13.6143694 9.58232154,15.2464067 11.9078369,15.2464067 C13.3786631,15.2464067 13.9391869,14.2869904 13.9391869,12.58878 C13.9391869,11.3521345 12.1390712,10.1619357 9.97161486,11.0502304 C8.24621513,12.1140246 7.17909072,11.547078 6.86322591,10.7478144 L6.82781627,10.6508891 L6.79127892,10.5445502 C6.5448802,9.79724635 6.61229951,9.16312262 10.1911412,7.82363067 C10.6137438,7.6657143 11.3830789,7.698766 12.0161927,7.78792773 C12.8897042,8.04621996 13.6148836,8.35641256 14.1913276,8.71620571 C14.929645,9.17703372 15.7391454,9.82868756 16.6173642,10.6711738 C16.8017985,10.848104 17.0950516,10.8396614 17.2723632,10.6523169 C17.4496747,10.4649723 17.4439006,10.1696692 17.2594662,9.99273903 C16.7803672,9.5331334 16.3184045,9.12578598 15.8732309,8.77069768 L15.8624136,8.73672043 C15.3582916,7.35121785 14.8646161,6.25548747 14.3777651,5.44628421 C13.9445436,4.72621943 13.3206019,3.99276536 12.5068246,3.24305992 C12.4746432,2.90001775 12.5672164,2.59132364 12.8474094,2.35452236 Z M10.9668008,4.0469269 L11.0518595,3.98215031 C11.2745376,3.81947674 11.4718477,3.74284792 11.8308451,3.8850515 C12.6071746,4.59396408 13.1906226,5.27558261 13.5826599,5.9271944 C13.8835044,6.42723311 14.1925809,7.05721299 14.5092459,7.81609175 C13.7940229,7.39877614 12.9130339,7.05268239 11.8658275,6.77510676 L11.6720359,6.53222118 C11.6390059,6.49065589 11.6057339,6.44860798 11.5724054,6.40616676 L11.3960913,6.1777103 C10.8136406,5.40671311 10.3189783,4.5550951 10.9668008,4.0469269 Z" id="Shape" fill="#FFFFFF" fill-rule="nonzero"></path>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.6 KiB |
11
Telegram/Resources/icons/menu/rating_gifts.svg
Normal file
11
Telegram/Resources/icons/menu/rating_gifts.svg
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>Icon / Menu / rating_gifts</title>
|
||||
<g id="Icon-/-Menu-/-rating_gifts" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<path d="M9.49180328,1 C11.2844653,1 12.6018066,2.18644541 12.6018066,3.65 C12.6018066,5.11355459 11.2844653,6.3 9.49180328,6.3 C7.6991413,6.3 6.24590164,5.11355459 6.24590164,3.65 C6.24590164,2.18644541 7.6991413,1 9.49180328,1 Z M9.49180328,2.2 C8.31430075,2.2 7.44590164,2.90897331 7.44590164,3.65 C7.44590164,4.39102669 8.31430075,5.1 9.49180328,5.1 C10.6309547,5.1 11.4018066,4.43203043 11.4018066,3.65 C11.4018066,2.86796957 10.6309547,2.2 9.49180328,2.2 Z" id="Oval" fill="#FFFFFF" fill-rule="nonzero"></path>
|
||||
<path d="M14.5081967,1 C16.3008587,1 17.7540984,2.18644541 17.7540984,3.65 C17.7540984,5.11355459 16.3008587,6.3 14.5081967,6.3 C12.7155347,6.3 11.4638672,5.11355459 11.4638672,3.65 C11.4638672,2.18644541 12.7155347,1 14.5081967,1 Z M14.5081967,2.2 C13.3883731,2.2 12.6638672,2.84700401 12.6638672,3.65 C12.6638672,4.45299599 13.3883731,5.1 14.5081967,5.1 C15.6856993,5.1 16.5540984,4.39102669 16.5540984,3.65 C16.5540984,2.90897331 15.6856993,2.2 14.5081967,2.2 Z" id="Oval" fill="#FFFFFF" fill-rule="nonzero"></path>
|
||||
<path d="M19.5245902,5.2245614 C20.6708074,5.2245614 21.6,6.15375404 21.6,7.29997124 L21.6,9.62036238 C21.6,10.2776718 21.0671455,10.8105263 20.4098361,10.8105263 L3.59016393,10.8105263 C2.93285454,10.8105263 2.4,10.2776718 2.4,9.62036238 L2.4,7.29997124 C2.4,6.15375404 3.32919263,5.2245614 4.47540984,5.2245614 L19.5245902,5.2245614 Z M19.5245902,6.4245614 L4.47540984,6.4245614 C3.99193433,6.4245614 3.6,6.81649574 3.6,7.29997124 L3.6,9.6095614 L20.4,9.6095614 L20.4,7.29997124 C20.4,6.85368616 20.0660441,6.48540066 19.6343997,6.43138209 L19.5245902,6.4245614 Z" id="Rectangle" fill="#FFFFFF" fill-rule="nonzero"></path>
|
||||
<path d="M5.07540984,10.7953216 L5.07540984,18.3761864 C5.07540984,19.3485697 5.86368226,20.1368421 6.83606557,20.1368421 L17.1639344,20.1368421 C18.1363177,20.1368421 18.9245902,19.3485697 18.9245902,18.3761864 L18.9245902,10.7953216 L20.1245902,10.7953216 L20.1245902,18.3761864 C20.1245902,20.0113114 18.7990594,21.3368421 17.1639344,21.3368421 L6.83606557,21.3368421 C5.20094056,21.3368421 3.87540984,20.0113114 3.87540984,18.3761864 L3.87540984,10.7953216 L5.07540984,10.7953216 Z" id="Path" fill="#FFFFFF" fill-rule="nonzero"></path>
|
||||
<polygon id="Path" fill="#FFFFFF" fill-rule="nonzero" points="11.4 6.11695906 11.4 21 12.6 21 12.6 6.11695906"></polygon>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.6 KiB |
9
Telegram/Resources/icons/menu/rating_refund.svg
Normal file
9
Telegram/Resources/icons/menu/rating_refund.svg
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>Icon / Menu / rating_refund</title>
|
||||
<g id="Icon-/-Menu-/-rating_refund" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<path d="M9.58495703,2.34314741 C14.845204,0.914046898 20.2520851,4.07916838 21.661564,9.41264412 C23.0710429,14.7461199 19.9493787,20.2282711 14.6891317,21.6573716 C9.70832403,23.0105542 4.55852362,20.241996 2.84766326,15.3548697 L2.79687536,15.2061286 C2.7724639,15.132795 2.65678419,14.7396157 2.52176727,14.2756688 L2.02361181,12.5403036 C1.92527607,12.1682007 2.1430666,11.785725 2.51006058,11.6860203 C2.87705455,11.5863156 3.25427881,11.807138 3.35261455,12.179241 L3.59432993,13.0275538 C3.80113943,13.7451404 4.06828557,14.6632038 4.10050903,14.760005 C5.52633258,19.0432668 10.0041242,21.485941 14.3330265,20.3098676 C18.8592855,19.0801764 21.5453687,14.3629766 20.3325613,9.77370673 C19.1197538,5.18443691 14.4673212,2.46096029 9.94106224,3.69065143 C7.52370963,4.34739623 5.56035445,6.02376558 4.49357103,8.2653952 C4.32845825,8.61234632 3.91721015,8.75789206 3.57502268,8.59048072 C3.23283521,8.42306937 3.08928781,8.00609621 3.25440059,7.65914509 C4.49336656,5.05570865 6.77676829,3.10607433 9.58495703,2.34314741 Z" id="Path" fill="#FFFFFF" fill-rule="nonzero"></path>
|
||||
<path d="M2.49794681,3.90217796 C2.49794681,3.51694863 2.80594913,3.20465855 3.18588925,3.20465855 C3.56582936,3.20465855 3.87383169,3.51694863 3.87383169,3.90217796 L3.87360558,7.52173176 L6.91980245,7.41555441 C7.2814361,7.4029357 7.58746725,7.67568116 7.62708143,8.03426422 L7.63099908,8.08867052 C7.64406681,8.47367193 7.34684021,8.79651819 6.96712488,8.80976784 L3.24117729,8.93977968 C2.86111038,8.95304159 2.53984537,8.66451926 2.50172057,8.28653895 L2.49800979,8.22097241 L2.49794681,3.90217796 Z" id="Path" fill="#FFFFFF" fill-rule="nonzero"></path>
|
||||
<path d="M12.3540269,17.3251877 C12.6431336,17.3251877 12.9561718,17.1659567 12.9561718,16.7838024 L12.9561718,16.1901404 C14.6843872,16.0054325 15.7076642,14.9990928 15.7076642,13.5341679 C15.7076642,12.2730587 14.9431377,11.50875 13.3562633,11.1648111 L12.0520711,10.8718262 C11.2361478,10.6934875 10.8378231,10.3240717 10.8378231,9.78268638 C10.8378231,9.13302405 11.4031872,8.66170039 12.289781,8.66170039 C13.0093353,8.66170039 13.5104536,8.90373146 14.0693931,9.5215476 C14.3520752,9.81453257 14.5705113,9.92280963 14.8660426,9.92280963 C15.2258197,9.92280963 15.5020772,9.67440933 15.5020772,9.30499349 C15.5020772,8.94831613 15.2900657,8.55979258 14.9302885,8.20948446 C14.4548686,7.76363776 13.7920916,7.47065278 12.9890176,7.36874497 L12.9890176,6.69989325 C12.9890176,6.32410818 12.6816811,6.16487722 12.3861499,6.16487722 C12.0970432,6.16487722 11.7838443,6.31773894 11.7838443,6.69989325 L11.7838443,7.34963725 C10.1198749,7.50249898 9.11603231,8.48973095 9.11603231,9.90370191 C9.11603231,11.1393342 9.88055881,11.960966 11.3453659,12.2857971 L12.6495582,12.5851513 C13.6003978,12.8080747 13.992298,13.1392751 13.992298,13.6997681 C13.992298,14.4258613 13.4205093,14.8844465 12.3989991,14.8844465 C11.6344726,14.8844465 10.9984379,14.5978307 10.4202246,13.9800146 C10.0925704,13.6551834 9.91268177,13.5851218 9.66854726,13.5851218 C9.27664712,13.5851218 8.98111587,13.8335221 8.98111587,14.2602611 C8.98111587,14.6360462 9.19955201,15.0245697 9.59145215,15.3621394 C10.1054195,15.8270938 10.852439,16.1137095 11.7454573,16.1965096 L11.7454573,16.7838024 C11.7454573,17.1659567 12.0584957,17.3251877 12.3540269,17.3251877 Z" id="Path" fill="#FFFFFF" fill-rule="nonzero"></path>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 3.6 KiB |
10
Telegram/Resources/icons/menu/users_stars.svg
Normal file
10
Telegram/Resources/icons/menu/users_stars.svg
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>Icon / Menu / users_stars</title>
|
||||
<g id="Icon-/-Menu-/-users_stars" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<path d="M10.6647222,14.6083333 C13.1679529,14.6083333 15.1972222,16.6376027 15.1972222,19.1408333 L15.1972222,19.1805556 C15.1972222,19.5119264 14.9285931,19.7805556 14.5972222,19.7805556 C14.2658514,19.7805556 13.9972222,19.5119264 13.9972222,19.1805556 L13.9972222,19.1408333 C13.9972222,17.3003444 12.5052112,15.8083333 10.6647222,15.8083333 L5.47983871,15.8083333 C3.75894714,15.8083333 2.36388889,17.2033916 2.36388889,18.9242832 C2.36388889,19.255654 2.09525974,19.5242832 1.76388889,19.5242832 C1.43251804,19.5242832 1.16388889,19.255654 1.16388889,18.9242832 C1.16388889,16.5406499 3.09620544,14.6083333 5.47983871,14.6083333 L10.6647222,14.6083333 Z" id="Path" fill="#FFFFFF" fill-rule="nonzero"></path>
|
||||
<path d="M8.47745116,3.81325275 C8.84434853,3.9691957 9.13648401,4.26133118 9.29242697,4.62822855 L9.837,5.91011111 L11.2536218,6.01848992 C12.0546381,6.07958882 12.6656371,6.74303885 12.6765549,7.53105369 L12.6721689,7.67131095 C12.640454,8.08709799 12.4414977,8.47225506 12.1207729,8.73875142 L11.07,9.61111111 L11.3938701,10.9206432 C11.5864903,11.7005519 11.1475494,12.4884712 10.4025244,12.745423 L10.2679383,12.785146 C9.87396987,12.8824474 9.45751925,12.8203294 9.10909531,12.6122923 L7.874,11.8751111 L6.65149995,12.6059661 C5.96413876,13.016376 5.08613461,12.8292111 4.62167189,12.196898 L4.53957882,12.0731599 C4.32863667,11.7198706 4.26783432,11.2968624 4.3707302,10.8984627 L4.60871396,9.97701978 C4.63955115,9.85762211 4.67934978,9.74174595 4.72741862,9.63019415 L4.781,9.51711111 C4.72402035,9.48693702 4.66830927,9.45442225 4.61377597,9.41969742 L4.45384681,9.30892937 L3.75085061,8.78062735 C3.07086182,8.2696154 2.93387902,7.30411853 3.44489097,6.62412974 C3.71113573,6.26984554 4.11709183,6.04742064 4.55898263,6.01371466 L5.912,5.91011111 L6.45757303,4.62822855 C6.79029762,3.84540525 7.69462787,3.48052816 8.47745116,3.81325275 Z M8.00805289,4.91763731 C7.83516435,4.84415422 7.63544068,4.92473827 7.5619576,5.09762682 L6.81242023,6.8611133 C6.762712,6.97806516 6.65195707,7.05755523 6.52524782,7.06722019 L4.65024959,7.21023893 C4.55265687,7.21768299 4.46300042,7.2668061 4.40419957,7.34505068 C4.29134126,7.49522796 4.32159427,7.70846043 4.47177155,7.82131874 L5.17476775,8.34962077 C5.44651754,8.55384088 5.78694643,8.64456615 6.12428682,8.60267031 L7.57841053,8.42207605 C7.70002725,8.40697192 7.81692252,8.4743167 7.86485999,8.58710305 C7.92415906,8.72662077 7.85912899,8.88779362 7.71961127,8.94709269 L6.4517079,9.48598834 C6.11405341,9.62950127 5.8623347,9.92186941 5.77058814,10.2771004 L5.53260437,11.1985433 C5.50987955,11.2865309 5.52330791,11.3799534 5.56989503,11.4579782 C5.66620013,11.6192716 5.87502492,11.671955 6.03631826,11.5756499 L7.70062419,10.5819253 C7.80803032,10.5177952 7.94196968,10.5177952 8.04937581,10.5819253 L9.72427701,11.5819761 C9.80122733,11.6279216 9.89320153,11.6416405 9.98021047,11.6201513 C10.1625874,11.5751082 10.2739185,11.3907479 10.2288754,11.208371 L9.77632428,9.37601536 C9.74506588,9.24945178 9.78889505,9.11615638 9.88916433,9.03284072 L11.3538674,7.81579097 C11.4247003,7.75693456 11.4686403,7.67187163 11.4756446,7.58004398 C11.4899322,7.3927312 11.3496676,7.2293018 11.1623548,7.21501419 L9.22475218,7.06722019 C9.09804293,7.05755523 8.987288,6.97806516 8.93757977,6.8611133 L8.1880424,5.09762682 C8.153602,5.01659659 8.08908313,4.95207771 8.00805289,4.91763731 Z" id="Star" fill="#FFFFFF" fill-rule="nonzero"></path>
|
||||
<path d="M18.0174227,5.90931057 C18.3486503,6.04652517 18.611812,6.3096869 18.7490266,6.64091449 L19.1044444,7.5 L20.0337984,7.57332883 C20.7344012,7.62815795 21.2683217,8.20775826 21.2801433,8.89635992 L21.2761548,9.02664858 C21.2481303,9.38474356 21.0787573,9.71696686 20.805417,9.94999576 L20.0974444,10.552 L20.3154363,11.4563406 C20.4799024,12.1395692 20.0937745,12.8265284 19.4425658,13.0506693 L19.3174274,13.0871582 C18.9686126,13.1711245 18.6007266,13.1129982 18.2947908,12.9255805 L17.4994444,12.438 L16.7339799,12.9079554 C16.1370798,13.2736191 15.3682309,13.1207349 14.9530722,12.5755767 L14.8749121,12.4613522 C14.6783232,12.1404454 14.6243898,11.7521195 14.7260855,11.389785 L14.9136874,10.721373 C14.9302657,10.6623057 14.9495081,10.6043097 14.9712932,10.5475329 L14.9924444,10.496 L14.8586084,10.4042198 L14.3173233,9.99771597 C13.7202762,9.54933497 13.5997585,8.701848 14.0481395,8.10480086 C14.2812853,7.79435268 14.6366446,7.59911993 15.0237072,7.56882844 L15.8944444,7.5 L16.2509734,6.64091449 C16.536738,5.95109613 17.3276044,5.6235459 18.0174227,5.90931057 Z M17.59643,6.9255611 C17.4678713,6.87230428 17.3204807,6.93334851 17.2672239,7.0619072 L16.7120856,8.40197687 C16.6758104,8.48954314 16.5934614,8.54934298 16.4989677,8.55673805 L15.1095308,8.66547529 C15.0373954,8.6711206 14.9711685,8.70750534 14.9277181,8.76536233 C14.8441551,8.87663162 14.8666155,9.03457438 14.9778848,9.11813736 L15.5191699,9.52464117 C15.7230236,9.67773481 15.9788884,9.7445585 16.2315688,9.71069694 L17.183292,9.58315701 C17.2805543,9.57012294 17.375435,9.61996727 17.4198915,9.70745139 C17.4776834,9.82117784 17.4323395,9.96022092 17.318613,10.0180128 L16.4184593,10.4754402 C16.2004755,10.5862121 16.0388382,10.7832041 15.9727639,11.0186219 L15.7851621,11.6870339 C15.7662094,11.7545607 15.7762608,11.8269315 15.8128983,11.8867376 C15.8855887,12.0053956 16.0407073,12.0426597 16.1593653,11.9699692 L17.3683823,11.2293199 C17.449152,11.17984 17.550848,11.17984 17.6316177,11.2293199 L18.8694054,11.9875943 C18.9264214,12.0225226 18.9949829,12.0333554 19.0599901,12.0177069 C19.1952788,11.9851403 19.2785516,11.8490667 19.245985,11.7137779 L18.9067247,10.304416 C18.8845188,10.212168 18.9160198,10.1152669 18.988225,10.0537103 L20.0917784,9.1129056 C20.1427197,9.06947694 20.1742851,9.00756181 20.1795079,8.94082508 C20.1903648,8.80209601 20.086704,8.68083261 19.9479749,8.66997568 L18.5010323,8.55673805 C18.4065386,8.54934298 18.3241896,8.48954314 18.2879144,8.40197687 L17.7327761,7.0619072 C17.707204,7.00017764 17.6581596,6.95113324 17.59643,6.9255611 Z" id="Star-Copy" fill="#FFFFFF" fill-rule="nonzero"></path>
|
||||
<path d="M18.2638889,14.6083333 C20.7890575,14.6083333 22.8361111,16.6553869 22.8361111,19.1805556 C22.8361111,19.5119264 22.567482,19.7805556 22.2361111,19.7805556 C21.9047403,19.7805556 21.6361111,19.5119264 21.6361111,19.1805556 C21.6361111,17.3181286 20.1263158,15.8083333 18.2638889,15.8083333 L15.8789648,15.8077138 C15.6342075,15.3537143 15.2908888,14.9468235 14.8660915,14.6068359 L18.2638889,14.6083333 Z" id="Path" fill="#FFFFFF" fill-rule="nonzero"></path>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 6.7 KiB |
@ -1876,8 +1876,24 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
"lng_star_ref_revoked_title" = "Link removed";
|
||||
"lng_star_ref_revoked_text" = "It will no longer work.";
|
||||
|
||||
"lng_stars_rating_tooltip" = "Profile level reflects the user's payment reliability.";
|
||||
"lng_stars_rating_learn_more" = "Learn More";
|
||||
"lng_stars_rating_title" = "Rating";
|
||||
"lng_stars_rating_future" = "Future Rating";
|
||||
"lng_stars_rating_subtitle" = "The rating update updates in 21 days after purchases.";
|
||||
"lng_stars_rating_pending#one" = "{count} point is pending. {link}";
|
||||
"lng_stars_rating_pending#other" = "{count} points are pending. {link}";
|
||||
"lng_stars_rating_pending_preview" = "Preview {arrow}";
|
||||
"lng_stars_rating_pending_back" = "Back {arrow}";
|
||||
"lng_stars_rating_about" = "This rating reflects **{name}'s** activity on Telegram. What affects it:";
|
||||
"lng_stars_rating_about_your" = "This rating reflects your activity on Telegram. What affects it:";
|
||||
"lng_stars_title_gifts_telegram" = "Gifts from Telegram";
|
||||
"lng_stars_about_gifts_telegram" = "{emoji} 100% of the Stars spent on gifts purchased from Telegram.";
|
||||
"lng_stars_title_gifts_users" = "Gifts and Posts from Users";
|
||||
"lng_stars_about_gifts_users" = "{emoji} 20% of the Stars spent on resold gifts, paid messages and channel posts.";
|
||||
"lng_stars_title_refunds" = "Refunds and Conversions";
|
||||
"lng_stars_about_refunds" = "{emoji} 10x of refunded Stars and 85% of bought gifts converted to Stars.";
|
||||
"lng_stars_rating_added" = "Added";
|
||||
"lng_stars_rating_deducted" = "Deducted";
|
||||
"lng_stars_rating_understood" = "Understood";
|
||||
|
||||
"lng_manage_discussion_group" = "Discussion";
|
||||
"lng_manage_discussion_group_add" = "Add a group";
|
||||
|
@ -11,12 +11,12 @@ namespace Data {
|
||||
|
||||
struct StarsRating {
|
||||
int level = 0;
|
||||
int levelStars = 0;
|
||||
int currentStars = 0;
|
||||
int stars = 0;
|
||||
int thisLevelStars = 0;
|
||||
int nextLevelStars = 0;
|
||||
|
||||
explicit operator bool() const {
|
||||
return level != 0 || levelStars != 0;
|
||||
return level != 0 || thisLevelStars != 0;
|
||||
}
|
||||
|
||||
friend inline bool operator==(StarsRating, StarsRating) = default;
|
||||
|
@ -72,8 +72,8 @@ bool ApplyBotVerifierSettings(
|
||||
const auto &data = rating->data();
|
||||
return {
|
||||
.level = data.vlevel().v,
|
||||
.levelStars = int(data.vcurrent_level_stars().v),
|
||||
.currentStars = int(data.vstars().v),
|
||||
.stars = int(data.vstars().v),
|
||||
.thisLevelStars = int(data.vcurrent_level_stars().v),
|
||||
.nextLevelStars = int(data.vnext_level_stars().value_or_empty()),
|
||||
};
|
||||
}
|
||||
|
@ -1195,12 +1195,8 @@ StarsRating {
|
||||
margin: margins;
|
||||
padding: margins;
|
||||
style: TextStyle;
|
||||
minSkip: pixels;
|
||||
border: pixels;
|
||||
activeBg: color;
|
||||
inactiveBg: color;
|
||||
activeFg: color;
|
||||
inactiveFg: color;
|
||||
}
|
||||
infoStarsRating: StarsRating {
|
||||
margin: margins(6px, 6px, 6px, 6px);
|
||||
@ -1208,24 +1204,37 @@ infoStarsRating: StarsRating {
|
||||
style: TextStyle(defaultTextStyle) {
|
||||
font: font(11px semibold);
|
||||
}
|
||||
minSkip: 32px;
|
||||
border: 2px;
|
||||
activeBg: windowBgActive;
|
||||
inactiveBg: windowBgRipple;
|
||||
activeFg: windowFgActive;
|
||||
inactiveFg: windowBoldFg;
|
||||
}
|
||||
infoStarsRatingLearn: RoundButton(defaultActiveButton) {
|
||||
width: -24px;
|
||||
height: 44px;
|
||||
textTop: 13px;
|
||||
textFg: mediaviewTextLinkFg;
|
||||
textFgOver: mediaviewTextLinkFg;
|
||||
textBg: transparent;
|
||||
textBgOver: transparent;
|
||||
ripple: emptyRippleAnimation;
|
||||
infoStarsTitle: FlatLabel(defaultFlatLabel) {
|
||||
minWidth: 40px;
|
||||
textFg: windowBoldFg;
|
||||
maxHeight: 24px;
|
||||
style: TextStyle(boxTextStyle) {
|
||||
font: font(17px semibold);
|
||||
}
|
||||
align: align(top);
|
||||
}
|
||||
infoStarsFeatureTitle: FlatLabel(defaultFlatLabel) {
|
||||
textFg: windowBoldFg;
|
||||
style: semiboldTextStyle;
|
||||
minWidth: 10px;
|
||||
maxHeight: 20px;
|
||||
}
|
||||
infoStarsFeatureAbout: FlatLabel(defaultFlatLabel) {
|
||||
textFg: windowSubTextFg;
|
||||
minWidth: 20px;
|
||||
}
|
||||
infoStarsFeatureIconPosition: point(3px, 7px);
|
||||
infoStarsFeatureMargin: margins(0px, 8px, 0px, 6px);
|
||||
infoStarsFeatureLabelLeft: 46px;
|
||||
infoStarsFeatureSkip: 2px;
|
||||
infoStarsCrown: icon {{ "limits/filled_rating_crown-24x24", windowFgActive }};
|
||||
infoStarsUnderstood: IconEmoji{
|
||||
icon: icon {{ "limits/filled_understood-20x20", windowFgActive }};
|
||||
padding: margins(0px, -1px, 0px, 0px);
|
||||
}
|
||||
infoStarsRatingTooltip: defaultImportantTooltip;
|
||||
|
||||
collectionAbout: FlatLabel(defaultFlatLabel) {
|
||||
minWidth: 256px;
|
||||
|
@ -651,8 +651,9 @@ Cover::Cover(
|
||||
? std::make_unique<Ui::StarsRating>(
|
||||
this,
|
||||
st::infoStarsRating,
|
||||
Data::StarsRatingValue(_peer),
|
||||
_parentForTooltip)
|
||||
_controller->uiShow(),
|
||||
_peer->isSelf() ? QString() : _peer->shortName(),
|
||||
Data::StarsRatingValue(_peer))
|
||||
: nullptr)
|
||||
, _status(this, _st.status)
|
||||
, _showLastSeen(this, tr::lng_status_lastseen_when(), _st.showLastSeen)
|
||||
@ -668,14 +669,6 @@ Cover::Cover(
|
||||
if (!_peer->isMegagroup()) {
|
||||
_status->setAttribute(Qt::WA_TransparentForMouseEvents);
|
||||
if (const auto rating = _starsRating.get()) {
|
||||
_status->widthValue() | rpl::start_with_next([=](int width) {
|
||||
rating->setMinimalAddedWidth(width);
|
||||
}, rating->lifetime());
|
||||
const auto session = &_peer->session();
|
||||
rating->learnMoreRequests() | rpl::start_with_next([=] {
|
||||
const auto &appConfig = session->appConfig();
|
||||
UrlClickHandler::Open(appConfig.starsRatingLearnMoreUrl());
|
||||
}, rating->lifetime());
|
||||
_statusShift = rating->collapsedWidthValue();
|
||||
_statusShift.changes() | rpl::start_with_next([=] {
|
||||
refreshStatusGeometry(width());
|
||||
|
@ -246,12 +246,6 @@ QString AppConfig::ageVerifyBotUsername() const {
|
||||
return get<QString>(u"verify_age_bot_username"_q, QString());
|
||||
}
|
||||
|
||||
QString AppConfig::starsRatingLearnMoreUrl() const {
|
||||
return get<QString>(
|
||||
u"stars_rating_learnmore_url"_q,
|
||||
u"https://telegram.org/blog"_q);
|
||||
}
|
||||
|
||||
int AppConfig::storiesAlbumsLimit() const {
|
||||
return get<int>(u"stories_albums_limit"_q, 100);
|
||||
}
|
||||
|
@ -112,8 +112,6 @@ public:
|
||||
[[nodiscard]] int ageVerifyMinAge() const;
|
||||
[[nodiscard]] QString ageVerifyBotUsername() const;
|
||||
|
||||
[[nodiscard]] QString starsRatingLearnMoreUrl() const;
|
||||
|
||||
[[nodiscard]] int storiesAlbumsLimit() const;
|
||||
[[nodiscard]] int storiesAlbumLimit() const;
|
||||
|
||||
|
@ -451,7 +451,7 @@ void BoostBox(
|
||||
: tr::lng_boost_channel_button();
|
||||
}) | rpl::flatten_latest();
|
||||
|
||||
const auto button = box->addButton(rpl::duplicate(submit), [=] {
|
||||
box->addButton(rpl::duplicate(submit), [=] {
|
||||
if (state->submitted) {
|
||||
return;
|
||||
} else if (state->data.current().nextLevelBoosts > 0
|
||||
@ -519,17 +519,6 @@ void BoostBox(
|
||||
box->closeBox();
|
||||
}
|
||||
});
|
||||
|
||||
rpl::combine(
|
||||
std::move(submit),
|
||||
box->widthValue()
|
||||
) | rpl::start_with_next([=](const QString &, int width) {
|
||||
const auto &padding = st::boostBox.buttonPadding;
|
||||
button->resizeToWidth(width
|
||||
- padding.left()
|
||||
- padding.right());
|
||||
button->moveToLeft(padding.left(), button->y());
|
||||
}, button->lifetime());
|
||||
}
|
||||
|
||||
object_ptr<Ui::RpWidget> MakeLinkLabel(
|
||||
@ -788,20 +777,10 @@ void AskBoostBox(
|
||||
data.group);
|
||||
|
||||
auto submit = tr::lng_boost_channel_ask_button();
|
||||
const auto button = box->addButton(rpl::duplicate(submit), [=] {
|
||||
box->addButton(rpl::duplicate(submit), [=] {
|
||||
QGuiApplication::clipboard()->setText(data.link);
|
||||
box->uiShow()->showToast(tr::lng_username_copied(tr::now));
|
||||
});
|
||||
rpl::combine(
|
||||
std::move(submit),
|
||||
box->widthValue()
|
||||
) | rpl::start_with_next([=](const QString &, int width) {
|
||||
const auto &padding = st::boostBox.buttonPadding;
|
||||
button->resizeToWidth(width
|
||||
- padding.left()
|
||||
- padding.right());
|
||||
button->moveToLeft(padding.left(), button->y());
|
||||
}, button->lifetime());
|
||||
}
|
||||
|
||||
void FillBoostLimit(
|
||||
|
@ -7,7 +7,13 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
#include "ui/controls/stars_rating.h"
|
||||
|
||||
#include "info/profile/info_profile_icon.h"
|
||||
#include "lang/lang_keys.h"
|
||||
#include "ui/effects/premium_bubble.h"
|
||||
#include "ui/effects/premium_graphics.h"
|
||||
#include "ui/layers/generic_box.h"
|
||||
#include "ui/layers/show.h"
|
||||
#include "ui/text/custom_emoji_helper.h"
|
||||
#include "ui/text/text_utilities.h"
|
||||
#include "ui/toast/toast.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
@ -17,25 +23,395 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "ui/rp_widget.h"
|
||||
#include "ui/ui_utility.h"
|
||||
#include "styles/style_info.h"
|
||||
#include "styles/style_layers.h"
|
||||
#include "styles/style_premium.h"
|
||||
#include "styles/style_settings.h"
|
||||
#include "styles/style_media_view.h"
|
||||
#include "styles/style_menu_icons.h"
|
||||
|
||||
namespace Ui {
|
||||
namespace {
|
||||
|
||||
constexpr auto kAutoCollapseTimeout = 4 * crl::time(1000);
|
||||
|
||||
using Counters = Data::StarsRating;
|
||||
|
||||
struct Feature {
|
||||
const style::icon &icon;
|
||||
QString title;
|
||||
TextWithEntities about;
|
||||
};
|
||||
|
||||
[[nodiscard]] object_ptr<Ui::RpWidget> MakeFeature(
|
||||
QWidget *parent,
|
||||
Feature feature,
|
||||
const Text::MarkedContext &context) {
|
||||
auto result = object_ptr<Ui::PaddingWrap<>>(
|
||||
parent,
|
||||
object_ptr<Ui::RpWidget>(parent),
|
||||
st::infoStarsFeatureMargin);
|
||||
const auto widget = result->entity();
|
||||
const auto icon = Ui::CreateChild<Info::Profile::FloatingIcon>(
|
||||
widget,
|
||||
feature.icon,
|
||||
st::infoStarsFeatureIconPosition);
|
||||
const auto title = Ui::CreateChild<Ui::FlatLabel>(
|
||||
widget,
|
||||
feature.title,
|
||||
st::infoStarsFeatureTitle);
|
||||
const auto about = Ui::CreateChild<Ui::FlatLabel>(
|
||||
widget,
|
||||
rpl::single(feature.about),
|
||||
st::infoStarsFeatureAbout,
|
||||
st::defaultPopupMenu,
|
||||
context);
|
||||
icon->show();
|
||||
title->show();
|
||||
about->show();
|
||||
widget->widthValue(
|
||||
) | rpl::start_with_next([=](int width) {
|
||||
const auto left = st::infoStarsFeatureLabelLeft;
|
||||
const auto available = width - left;
|
||||
title->resizeToWidth(available);
|
||||
about->resizeToWidth(available);
|
||||
auto top = 0;
|
||||
title->move(left, top);
|
||||
top += title->height() + st::infoStarsFeatureSkip;
|
||||
about->move(left, top);
|
||||
top += about->height();
|
||||
widget->resize(width, top);
|
||||
}, widget->lifetime());
|
||||
return result;
|
||||
}
|
||||
|
||||
[[nodiscard]] Fn<QImage()> CustomEmojiBadgeFactory(
|
||||
const QString &text,
|
||||
const style::color &bg,
|
||||
const style::color &fg) {
|
||||
return [=] {
|
||||
auto string = Ui::Text::String(
|
||||
st::settingsPremiumNewBadge.style,
|
||||
text.toUpper());
|
||||
const auto size = QSize(string.maxWidth(), string.minHeight());
|
||||
const auto padding = st::settingsPremiumNewBadgePadding;
|
||||
const auto full = size.grownBy(padding);
|
||||
const auto ratio = style::DevicePixelRatio();
|
||||
|
||||
auto result = QImage(
|
||||
full * ratio,
|
||||
QImage::Format_ARGB32_Premultiplied);
|
||||
result.setDevicePixelRatio(ratio);
|
||||
result.fill(Qt::transparent);
|
||||
|
||||
auto p = QPainter(&result);
|
||||
auto hq = PainterHighQualityEnabler(p);
|
||||
p.setPen(Qt::NoPen);
|
||||
p.setBrush(bg);
|
||||
|
||||
const auto r = padding.left();
|
||||
p.drawRoundedRect(0, 0, full.width(), full.height(), r, r);
|
||||
|
||||
p.setPen(fg);
|
||||
string.draw(p, { .position = { padding.left(), padding.top() } });
|
||||
|
||||
p.end();
|
||||
return result;
|
||||
};
|
||||
}
|
||||
|
||||
[[nodiscard]] Counters AdjustByReached(Counters data) {
|
||||
const auto reached = !data.nextLevelStars;
|
||||
if (reached) {
|
||||
--data.level;
|
||||
data.stars = data.nextLevelStars = std::max({
|
||||
data.stars,
|
||||
data.thisLevelStars,
|
||||
1
|
||||
});
|
||||
data.thisLevelStars = 0;
|
||||
} else {
|
||||
data.stars = std::max(data.thisLevelStars, data.stars);
|
||||
data.nextLevelStars = std::max(
|
||||
data.nextLevelStars,
|
||||
data.stars + 1);
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
[[nodiscard]] Fn<QString(int)> BubbleTextFactory(int countForScale) {
|
||||
return [=](int count) {
|
||||
return (countForScale < 10'000)
|
||||
? QString::number(count)
|
||||
: (countForScale < 10'000'000)
|
||||
? (QString::number((count / 100) / 10.) + 'K')
|
||||
: (QString::number((count / 100'000) / 10.) + 'M');
|
||||
};
|
||||
}
|
||||
|
||||
void FillRatingLimit(
|
||||
rpl::producer<> showFinished,
|
||||
not_null<VerticalLayout*> container,
|
||||
rpl::producer<Counters> data,
|
||||
style::margins limitLinePadding,
|
||||
int starsForScale) {
|
||||
const auto addSkip = [&](int skip) {
|
||||
container->add(object_ptr<Ui::FixedHeightWidget>(container, skip));
|
||||
};
|
||||
|
||||
const auto ratio = [=](Counters rating) {
|
||||
const auto min = rating.thisLevelStars;
|
||||
const auto max = rating.nextLevelStars;
|
||||
|
||||
Assert(rating.stars >= min && rating.stars <= max);
|
||||
const auto count = (max - min);
|
||||
const auto index = (rating.stars - min);
|
||||
if (!index) {
|
||||
return 0.;
|
||||
} else if (index == count) {
|
||||
return 1.;
|
||||
} else if (count == 2) {
|
||||
return 0.5;
|
||||
}
|
||||
const auto available = st::boxWideWidth
|
||||
- st::boxPadding.left()
|
||||
- st::boxPadding.right();
|
||||
const auto average = available / float64(count);
|
||||
const auto levelWidth = [&](int add) {
|
||||
return st::normalFont->width(
|
||||
tr::lng_boost_level(
|
||||
tr::now,
|
||||
lt_count,
|
||||
rating.level + add));
|
||||
};
|
||||
const auto paddings = 2 * st::premiumLineTextSkip;
|
||||
const auto labelLeftWidth = paddings + levelWidth(0);
|
||||
const auto labelRightWidth = paddings + levelWidth(1);
|
||||
const auto first = std::max(average, labelLeftWidth * 1.);
|
||||
const auto last = std::max(average, labelRightWidth * 1.);
|
||||
const auto other = (available - first - last) / (count - 2);
|
||||
return (first + (index - 1) * other) / available;
|
||||
};
|
||||
|
||||
auto adjustedData = rpl::duplicate(data) | rpl::map(AdjustByReached);
|
||||
|
||||
auto bubbleRowState = rpl::duplicate(
|
||||
adjustedData
|
||||
) | rpl::combine_previous(
|
||||
Counters()
|
||||
) | rpl::map([=](Counters previous, Counters counters) {
|
||||
return Premium::BubbleRowState{
|
||||
.counter = counters.stars,
|
||||
.ratio = ratio(counters),
|
||||
.animateFromZero = (counters.level != previous.level),
|
||||
.dynamic = true,
|
||||
};
|
||||
});
|
||||
Premium::AddBubbleRow(
|
||||
container,
|
||||
st::boostBubble,
|
||||
std::move(showFinished),
|
||||
rpl::duplicate(bubbleRowState),
|
||||
Premium::BubbleType::StarRating,
|
||||
BubbleTextFactory(starsForScale),
|
||||
&st::infoStarsCrown,
|
||||
limitLinePadding);
|
||||
addSkip(st::premiumLineTextSkip);
|
||||
|
||||
const auto level = [](int level) {
|
||||
return tr::lng_boost_level(tr::now, lt_count, level);
|
||||
};
|
||||
auto limitState = std::move(
|
||||
bubbleRowState
|
||||
) | rpl::map([](const Premium::BubbleRowState &state) {
|
||||
return Premium::LimitRowState{
|
||||
.ratio = state.ratio,
|
||||
.animateFromZero = state.animateFromZero,
|
||||
.dynamic = state.dynamic
|
||||
};
|
||||
});
|
||||
auto left = rpl::duplicate(
|
||||
adjustedData
|
||||
) | rpl::map([=](Counters counters) {
|
||||
return level(counters.level);
|
||||
});
|
||||
auto right = rpl::duplicate(
|
||||
adjustedData
|
||||
) | rpl::map([=](Counters counters) {
|
||||
return level(counters.level + 1);
|
||||
});
|
||||
Premium::AddLimitRow(
|
||||
container,
|
||||
st::boostLimits,
|
||||
Premium::LimitRowLabels{
|
||||
.leftLabel = std::move(left),
|
||||
.rightLabel = std::move(right),
|
||||
.activeLineBg = [=] { return st::windowBgActive->b; },
|
||||
},
|
||||
std::move(limitState),
|
||||
limitLinePadding);
|
||||
}
|
||||
|
||||
object_ptr<Ui::FlatLabel> MakeBoostFeaturesBadge(
|
||||
not_null<QWidget*> parent,
|
||||
rpl::producer<QString> text,
|
||||
Fn<QBrush(QRect)> bg) {
|
||||
auto result = object_ptr<Ui::FlatLabel>(
|
||||
parent,
|
||||
std::move(text),
|
||||
st::boostLevelBadge);
|
||||
const auto label = result.data();
|
||||
|
||||
label->show();
|
||||
label->paintRequest() | rpl::start_with_next([=] {
|
||||
const auto size = label->textMaxWidth();
|
||||
const auto rect = QRect(
|
||||
(label->width() - size) / 2,
|
||||
st::boostLevelBadge.margin.top(),
|
||||
size,
|
||||
st::boostLevelBadge.style.font->height
|
||||
).marginsAdded(st::boostLevelBadge.margin);
|
||||
auto p = QPainter(label);
|
||||
auto hq = PainterHighQualityEnabler(p);
|
||||
p.setBrush(bg(rect));
|
||||
p.setPen(Qt::NoPen);
|
||||
p.drawRoundedRect(rect, rect.height() / 2., rect.height() / 2.);
|
||||
|
||||
const auto &lineFg = st::windowBgRipple;
|
||||
const auto line = st::boostLevelBadgeLine;
|
||||
const auto top = st::boostLevelBadge.margin.top()
|
||||
+ ((st::boostLevelBadge.style.font->height - line) / 2);
|
||||
const auto left = 0;
|
||||
const auto skip = st::boostLevelBadgeSkip;
|
||||
if (const auto right = rect.x() - skip; right > left) {
|
||||
p.fillRect(left, top, right - left, line, lineFg);
|
||||
}
|
||||
const auto right = label->width();
|
||||
if (const auto left = rect.x() + rect.width() + skip
|
||||
; left < right) {
|
||||
p.fillRect(left, top, right - left, line, lineFg);
|
||||
}
|
||||
}, label->lifetime());
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void AboutRatingBox(
|
||||
not_null<GenericBox*> box,
|
||||
const QString &name,
|
||||
Counters data) {
|
||||
box->setWidth(st::boxWideWidth);
|
||||
box->setStyle(st::boostBox);
|
||||
|
||||
struct State {
|
||||
rpl::variable<Counters> data;
|
||||
rpl::variable<bool> full;
|
||||
};
|
||||
const auto state = box->lifetime().make_state<State>();
|
||||
state->data = std::move(data);
|
||||
|
||||
FillRatingLimit(
|
||||
BoxShowFinishes(box),
|
||||
box->verticalLayout(),
|
||||
state->data.value(),
|
||||
st::boxRowPadding,
|
||||
data.stars);
|
||||
|
||||
box->setMaxHeight(st::boostBoxMaxHeight);
|
||||
const auto close = box->addTopButton(
|
||||
st::boxTitleClose,
|
||||
[=] { box->closeBox(); });
|
||||
|
||||
auto title = tr::lng_stars_rating_title();;
|
||||
|
||||
auto text = !name.isEmpty()
|
||||
? tr::lng_stars_rating_about(
|
||||
lt_name,
|
||||
rpl::single(TextWithEntities{ name }),
|
||||
Ui::Text::RichLangValue) | rpl::type_erased()
|
||||
: tr::lng_stars_rating_about_your(
|
||||
Ui::Text::RichLangValue) | rpl::type_erased();
|
||||
|
||||
box->addRow(
|
||||
object_ptr<Ui::FlatLabel>(box, std::move(title), st::infoStarsTitle),
|
||||
st::boxRowPadding + QMargins(0, st::boostTitleSkip / 2, 0, 0));
|
||||
|
||||
const auto aboutLabel = box->addRow(
|
||||
object_ptr<Ui::FlatLabel>(
|
||||
box,
|
||||
std::move(text),
|
||||
st::boostText),
|
||||
(st::boxRowPadding
|
||||
+ QMargins(0, st::boostTextSkip, 0, st::boostBottomSkip)));
|
||||
aboutLabel->setTryMakeSimilarLines(true);
|
||||
|
||||
auto helper = Ui::Text::CustomEmojiHelper();
|
||||
const auto makeBadge = [&](
|
||||
const QString &text,
|
||||
const style::color &bg,
|
||||
const style::color &fg) {
|
||||
return helper.paletteDependent(
|
||||
CustomEmojiBadgeFactory(text, bg, fg),
|
||||
st::badgeEmojiMargin);
|
||||
};
|
||||
const auto makeActive = [&](const QString &text) {
|
||||
return makeBadge(text, st::windowBgActive, st::windowFgActive);
|
||||
};
|
||||
const auto makeInactive = [&](const QString &text) {
|
||||
return makeBadge(text, st::windowSubTextFg, st::windowFgActive);
|
||||
};
|
||||
const auto features = std::vector<Feature>{
|
||||
{
|
||||
st::menuIconRatingGifts,
|
||||
tr::lng_stars_title_gifts_telegram(tr::now),
|
||||
tr::lng_stars_about_gifts_telegram(
|
||||
tr::now,
|
||||
lt_emoji,
|
||||
makeActive(tr::lng_stars_rating_added(tr::now)),
|
||||
Ui::Text::RichLangValue),
|
||||
},
|
||||
{
|
||||
st::menuIconRatingUsers,
|
||||
tr::lng_stars_title_gifts_users(tr::now),
|
||||
tr::lng_stars_about_gifts_users(
|
||||
tr::now,
|
||||
lt_emoji,
|
||||
makeActive(tr::lng_stars_rating_added(tr::now)),
|
||||
Ui::Text::RichLangValue),
|
||||
},
|
||||
{
|
||||
st::menuIconRatingRefund,
|
||||
tr::lng_stars_title_refunds(tr::now),
|
||||
tr::lng_stars_about_refunds(
|
||||
tr::now,
|
||||
lt_emoji,
|
||||
makeInactive(tr::lng_stars_rating_deducted(tr::now)),
|
||||
Ui::Text::RichLangValue),
|
||||
},
|
||||
};
|
||||
const auto context = helper.context();
|
||||
for (const auto &feature : features) {
|
||||
box->addRow(MakeFeature(box, feature, context));
|
||||
}
|
||||
box->addButton(rpl::single(QString()), [=] {
|
||||
box->closeBox();
|
||||
})->setText(rpl::single(Ui::Text::IconEmoji(
|
||||
&st::infoStarsUnderstood
|
||||
).append(' ').append(tr::lng_stars_rating_understood(tr::now))));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
StarsRating::StarsRating(
|
||||
QWidget *parent,
|
||||
const style::StarsRating &st,
|
||||
rpl::producer<Data::StarsRating> value,
|
||||
Fn<not_null<QWidget*>()> parentForTooltip)
|
||||
std::shared_ptr<Ui::Show> show,
|
||||
const QString &name,
|
||||
rpl::producer<Counters> value)
|
||||
: _widget(std::make_unique<Ui::AbstractButton>(parent))
|
||||
, _st(st)
|
||||
, _parentForTooltip(std::move(parentForTooltip))
|
||||
, _value(std::move(value))
|
||||
, _collapseTimer([=] { _expanded = false; }) {
|
||||
, _show(std::move(show))
|
||||
, _name(name)
|
||||
, _value(std::move(value)) {
|
||||
init();
|
||||
}
|
||||
|
||||
@ -43,18 +419,6 @@ StarsRating::~StarsRating() = default;
|
||||
|
||||
void StarsRating::init() {
|
||||
_widget->setPointerCursor(true);
|
||||
_expanded.changes() | rpl::start_with_next([=](bool expanded) {
|
||||
_widget->setPointerCursor(!expanded);
|
||||
const auto from = expanded ? 0. : 1.;
|
||||
const auto till = expanded ? 1. : 0.;
|
||||
_expandedAnimation.start([=] {
|
||||
updateWidth();
|
||||
if (!_expandedAnimation.animating()) {
|
||||
updateStarsTooltipGeometry();
|
||||
}
|
||||
}, from, till, st::slideDuration);
|
||||
toggleTooltips(expanded);
|
||||
}, lifetime());
|
||||
|
||||
_widget->paintRequest() | rpl::start_with_next([=] {
|
||||
auto p = QPainter(_widget.get());
|
||||
@ -65,189 +429,43 @@ void StarsRating::init() {
|
||||
if (!_value.current()) {
|
||||
return;
|
||||
}
|
||||
_expanded = true;
|
||||
_collapseTimer.callOnce(kAutoCollapseTimeout);
|
||||
_show->show(Box(AboutRatingBox, _name, _value.current()));
|
||||
});
|
||||
|
||||
const auto added = _st.margin + _st.padding;
|
||||
const auto border = 2 * _st.border;
|
||||
const auto fontHeight = _st.style.font->height;
|
||||
const auto height = added.top() + fontHeight + added.bottom() + border;
|
||||
const auto height = added.top() + fontHeight + added.bottom();
|
||||
_widget->resize(_widget->width(), height);
|
||||
|
||||
_value.value() | rpl::start_with_next([=](Data::StarsRating rating) {
|
||||
_value.value() | rpl::start_with_next([=](Counters rating) {
|
||||
if (!rating) {
|
||||
_widget->resize(0, _widget->height());
|
||||
_collapsedWidthValue = 0;
|
||||
_expanded = false;
|
||||
updateExpandedWidth();
|
||||
_expandedAnimation.stop();
|
||||
return;
|
||||
}
|
||||
updateTexts(rating);
|
||||
}, lifetime());
|
||||
}
|
||||
|
||||
void StarsRating::updateTexts(Data::StarsRating rating) {
|
||||
void StarsRating::updateTexts(Counters rating) {
|
||||
_collapsedText.setText(
|
||||
_st.style,
|
||||
Lang::FormatCountDecimal(rating.level));
|
||||
_expandedText.setText(
|
||||
_st.style,
|
||||
tr::lng_boost_level(tr::now, lt_count_decimal, rating.level));
|
||||
_nextText.setText(
|
||||
_st.style,
|
||||
(rating.nextLevelStars
|
||||
? Lang::FormatCountDecimal(rating.level + 1)
|
||||
: QString()));
|
||||
|
||||
const auto added = _st.padding;
|
||||
const auto border = 2 * _st.border;
|
||||
const auto add = added.left() + added.right() + border;
|
||||
const auto min = _expandedText.maxWidth() + _nextText.maxWidth();
|
||||
const auto add = added.left() + added.right();
|
||||
const auto height = _widget->height();
|
||||
_minimalContentWidth = add + min + _st.minSkip;
|
||||
_collapsedWidthValue = _st.margin.right()
|
||||
+ std::max(
|
||||
add + _collapsedText.maxWidth(),
|
||||
height - _st.margin.top() - _st.margin.bottom());
|
||||
updateExpandedWidth();
|
||||
updateWidth();
|
||||
}
|
||||
|
||||
void StarsRating::updateExpandedWidth() {
|
||||
_expandedWidthValue = _st.margin.right() + std::max(
|
||||
_collapsedWidthValue.current() + _minimalAddedWidth.current(),
|
||||
_minimalContentWidth.current());
|
||||
}
|
||||
|
||||
void StarsRating::updateWidth() {
|
||||
const auto widthToRight = anim::interpolate(
|
||||
_collapsedWidthValue.current(),
|
||||
_expandedWidthValue.current(),
|
||||
_expandedAnimation.value(_expanded.current() ? 1. : 0.));
|
||||
const auto widthToRight = _collapsedWidthValue.current();
|
||||
_widget->resize(_st.margin.left() + widthToRight, _widget->height());
|
||||
_widget->update();
|
||||
updateStarsTooltipGeometry();
|
||||
}
|
||||
|
||||
void StarsRating::toggleTooltips(bool shown) {
|
||||
if (!shown) {
|
||||
if (const auto strong = _about.get()) {
|
||||
strong->hideAnimated();
|
||||
}
|
||||
if (const auto strong = _stars.release()) {
|
||||
strong->toggleAnimated(false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
const auto value = _value.current();
|
||||
const auto parent = _parentForTooltip
|
||||
? _parentForTooltip().get()
|
||||
: _widget->window();
|
||||
const auto text = value.nextLevelStars
|
||||
? (Lang::FormatCountDecimal(value.currentStars)
|
||||
+ u" / "_q
|
||||
+ Lang::FormatCountDecimal(value.nextLevelStars))
|
||||
: Lang::FormatCountDecimal(value.currentStars);
|
||||
_stars = std::make_unique<Ui::ImportantTooltip>(
|
||||
parent,
|
||||
Ui::MakeNiceTooltipLabel(
|
||||
_widget.get(),
|
||||
rpl::single(TextWithEntities{ text }),
|
||||
st::storiesInfoTooltipMaxWidth,
|
||||
st::storiesInfoTooltipLabel),
|
||||
st::infoStarsRatingTooltip);
|
||||
const auto stars = _stars.get();
|
||||
const auto weak = QPointer<QWidget>(stars);
|
||||
const auto destroy = [=] {
|
||||
delete weak.data();
|
||||
};
|
||||
stars->setAttribute(Qt::WA_TransparentForMouseEvents);
|
||||
stars->setHiddenCallback(destroy);
|
||||
updateStarsTooltipGeometry();
|
||||
stars->toggleAnimated(true);
|
||||
|
||||
_aboutSt = std::make_unique<style::Toast>(st::defaultMultilineToast);
|
||||
const auto learn = tr::lng_stars_rating_learn_more(tr::now);
|
||||
_aboutSt->padding.setRight(
|
||||
(st::infoStarsRatingLearn.style.font->width(learn)
|
||||
- st::infoStarsRatingLearn.width));
|
||||
|
||||
_about = Ui::Toast::Show(parent, {
|
||||
.text = tr::lng_stars_rating_tooltip(
|
||||
tr::now,
|
||||
Ui::Text::WithEntities),
|
||||
.st = _aboutSt.get(),
|
||||
.attach = RectPart::Top,
|
||||
.dark = true,
|
||||
.adaptive = true,
|
||||
.acceptinput = true,
|
||||
.duration = kAutoCollapseTimeout,
|
||||
});
|
||||
const auto strong = _about.get();
|
||||
if (!strong) {
|
||||
return;
|
||||
}
|
||||
const auto widget = strong->widget();
|
||||
const auto hideToast = [weak = _about] {
|
||||
if (const auto strong = weak.get()) {
|
||||
strong->hideAnimated();
|
||||
}
|
||||
};
|
||||
|
||||
const auto button = Ui::CreateChild<Ui::RoundButton>(
|
||||
widget.get(),
|
||||
rpl::single(learn),
|
||||
st::infoStarsRatingLearn);
|
||||
button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
|
||||
button->show();
|
||||
rpl::combine(
|
||||
widget->sizeValue(),
|
||||
button->sizeValue()
|
||||
) | rpl::start_with_next([=](QSize outer, QSize inner) {
|
||||
button->moveToRight(
|
||||
0,
|
||||
(outer.height() - inner.height()) / 2,
|
||||
outer.width());
|
||||
}, widget->lifetime());
|
||||
button->setClickedCallback([=] {
|
||||
_learnMoreRequests.fire({});
|
||||
});
|
||||
}
|
||||
|
||||
void StarsRating::updateStarsTooltipGeometry() {
|
||||
if (!_stars) {
|
||||
return;
|
||||
}
|
||||
const auto weakParent = base::make_weak(_stars->parentWidget());
|
||||
const auto weak = base::make_weak(_widget.get());
|
||||
const auto point = _st.margin.left()
|
||||
+ _st.border
|
||||
+ (_activeWidth / (_value.current().nextLevelStars ? 1 : 2));
|
||||
const auto countPosition = [=](QSize size) {
|
||||
const auto strong = weak.get();
|
||||
const auto parent = weakParent.get();
|
||||
if (!strong || !parent) {
|
||||
return QPoint();
|
||||
}
|
||||
const auto geometry = Ui::MapFrom(parent, strong, strong->rect());
|
||||
const auto shift = size.width() / 2;
|
||||
const auto left = geometry.x() + point - shift;
|
||||
const auto margin = st::defaultImportantTooltip.margin;
|
||||
return QPoint(
|
||||
std::min(
|
||||
std::max(left, margin.left()),
|
||||
parent->width() - size.width() - margin.right()),
|
||||
geometry.y() + geometry.height());
|
||||
};
|
||||
_stars->pointAt(
|
||||
Ui::MapFrom(
|
||||
_stars->parentWidget(),
|
||||
_widget.get(),
|
||||
QRect(point, 0, st::lineWidth, _widget->height())),
|
||||
RectPart::Bottom,
|
||||
countPosition);
|
||||
}
|
||||
|
||||
void StarsRating::raise() {
|
||||
@ -263,92 +481,27 @@ void StarsRating::paint(QPainter &p) {
|
||||
if (outer.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
const auto border = _st.border;
|
||||
const auto middle = outer.marginsRemoved(
|
||||
{ border, border, border, border });
|
||||
const auto mradius = middle.height() / 2.;
|
||||
const auto inner = middle.marginsRemoved(_st.padding);
|
||||
|
||||
const auto expanded = _expandedAnimation.value(
|
||||
_expanded.current() ? 1. : 0.);
|
||||
const auto inner = outer.marginsRemoved(_st.padding);
|
||||
|
||||
auto hq = PainterHighQualityEnabler(p);
|
||||
p.setPen(Qt::NoPen);
|
||||
p.setBrush(_st.inactiveBg);
|
||||
const auto oradius = outer.height() / 2.;
|
||||
p.drawRoundedRect(outer, oradius, oradius);
|
||||
p.setBrush(_st.activeBg);
|
||||
|
||||
const auto value = _value.current();
|
||||
const auto expandedRatio = (value.nextLevelStars > value.levelStars)
|
||||
? ((value.currentStars - value.levelStars)
|
||||
/ float64(value.nextLevelStars - value.levelStars))
|
||||
: 1.;
|
||||
const auto expandedFilled = (expandedRatio < 1.)
|
||||
? (_st.padding.left()
|
||||
+ _expandedText.maxWidth()
|
||||
+ _st.padding.right()
|
||||
+ expandedRatio * (middle.width()
|
||||
- _st.padding.left()
|
||||
- _expandedText.maxWidth()
|
||||
- _st.padding.right()
|
||||
- _st.padding.left()
|
||||
- _nextText.maxWidth()
|
||||
- _st.padding.right()))
|
||||
: middle.width();
|
||||
const auto collapsedFilled = _collapsedWidthValue.current()
|
||||
- _st.margin.right()
|
||||
- 2 * _st.border;
|
||||
_activeWidth = anim::interpolate(
|
||||
collapsedFilled,
|
||||
expandedFilled,
|
||||
expanded);
|
||||
p.drawRoundedRect(
|
||||
middle.x(),
|
||||
middle.y(),
|
||||
_activeWidth,
|
||||
middle.height(),
|
||||
mradius,
|
||||
mradius);
|
||||
const auto radius = outer.height() / 2.;
|
||||
p.drawRoundedRect(outer, radius, radius);
|
||||
p.setPen(_st.activeFg);
|
||||
if (expanded < 1.) {
|
||||
p.setOpacity(1. - expanded);
|
||||
const auto skip = (inner.width() - _collapsedText.maxWidth()) / 2;
|
||||
_collapsedText.draw(p, {
|
||||
.position = inner.topLeft() + QPoint(skip, 0),
|
||||
.availableWidth = _collapsedText.maxWidth(),
|
||||
});
|
||||
}
|
||||
if (expanded > 0.) {
|
||||
p.setOpacity(expanded);
|
||||
_expandedText.draw(p, {
|
||||
.position = inner.topLeft(),
|
||||
.availableWidth = _expandedText.maxWidth(),
|
||||
});
|
||||
|
||||
p.setPen(_st.inactiveFg);
|
||||
_nextText.draw(p, {
|
||||
.position = (inner.topLeft()
|
||||
+ QPoint(inner.width() - _nextText.maxWidth(), 0)),
|
||||
.availableWidth = _nextText.maxWidth(),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void StarsRating::setMinimalAddedWidth(int addedWidth) {
|
||||
_minimalAddedWidth = addedWidth + (_st.style.font->spacew * 2);
|
||||
updateExpandedWidth();
|
||||
updateWidth();
|
||||
}
|
||||
|
||||
rpl::producer<int> StarsRating::collapsedWidthValue() const {
|
||||
return _collapsedWidthValue.value();
|
||||
}
|
||||
|
||||
rpl::producer<> StarsRating::learnMoreRequests() const {
|
||||
return _learnMoreRequests.events();
|
||||
}
|
||||
|
||||
rpl::lifetime &StarsRating::lifetime() {
|
||||
return _widget->lifetime();
|
||||
}
|
||||
|
@ -7,7 +7,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "base/timer.h"
|
||||
#include "base/weak_ptr.h"
|
||||
#include "data/data_peer_common.h"
|
||||
|
||||
@ -25,22 +24,22 @@ namespace Ui {
|
||||
class ImportantTooltip;
|
||||
class AbstractButton;
|
||||
class FlatLabel;
|
||||
class Show;
|
||||
|
||||
class StarsRating final {
|
||||
public:
|
||||
StarsRating(
|
||||
QWidget *parent,
|
||||
const style::StarsRating &st,
|
||||
rpl::producer<Data::StarsRating> value,
|
||||
Fn<not_null<QWidget*>()> parentForTooltip);
|
||||
std::shared_ptr<Ui::Show> show,
|
||||
const QString &name,
|
||||
rpl::producer<Data::StarsRating> value);
|
||||
~StarsRating();
|
||||
|
||||
void raise();
|
||||
void moveTo(int x, int y);
|
||||
void setMinimalAddedWidth(int addedWidth);
|
||||
|
||||
[[nodiscard]] rpl::producer<int> collapsedWidthValue() const;
|
||||
[[nodiscard]] rpl::producer<> learnMoreRequests() const;
|
||||
|
||||
[[nodiscard]] rpl::lifetime &lifetime();
|
||||
|
||||
@ -48,35 +47,17 @@ private:
|
||||
void init();
|
||||
void paint(QPainter &p);
|
||||
void updateTexts(Data::StarsRating rating);
|
||||
void updateExpandedWidth();
|
||||
void updateWidth();
|
||||
void toggleTooltips(bool shown);
|
||||
void updateStarsTooltipGeometry();
|
||||
|
||||
const std::unique_ptr<Ui::AbstractButton> _widget;
|
||||
const style::StarsRating &_st;
|
||||
const Fn<not_null<QWidget*>()> _parentForTooltip;
|
||||
|
||||
std::unique_ptr<style::Toast> _aboutSt;
|
||||
base::weak_ptr<Ui::Toast::Instance> _about;
|
||||
std::unique_ptr<Ui::ImportantTooltip> _stars;
|
||||
const std::shared_ptr<Ui::Show> _show;
|
||||
const QString _name;
|
||||
|
||||
Ui::Text::String _collapsedText;
|
||||
Ui::Text::String _expandedText;
|
||||
Ui::Text::String _nextText;
|
||||
|
||||
rpl::variable<Data::StarsRating> _value;
|
||||
rpl::variable<int> _collapsedWidthValue;
|
||||
rpl::variable<int> _expandedWidthValue;
|
||||
rpl::variable<int> _minimalContentWidth;
|
||||
rpl::variable<int> _minimalAddedWidth;
|
||||
rpl::variable<bool> _expanded = false;
|
||||
Ui::Animations::Simple _expandedAnimation;
|
||||
mutable int _activeWidth = 0;
|
||||
|
||||
rpl::event_stream<> _learnMoreRequests;
|
||||
|
||||
base::Timer _collapseTimer;
|
||||
|
||||
};
|
||||
|
||||
|
@ -294,6 +294,7 @@ boostBottomSkip: 6px;
|
||||
boostBox: Box(premiumPreviewDoubledLimitsBox) {
|
||||
buttonPadding: margins(16px, 12px, 16px, 12px);
|
||||
buttonHeight: 42px;
|
||||
buttonWide: true;
|
||||
button: RoundButton(defaultActiveButton) {
|
||||
height: 42px;
|
||||
textTop: 12px;
|
||||
|
@ -422,7 +422,8 @@ void BubbleWidget::paintEvent(QPaintEvent *e) {
|
||||
|
||||
_bubble.paintBubble(p, bubbleRect, [&] {
|
||||
switch (_type) {
|
||||
case BubbleType::NoPremium: return st::windowBgActive->b;
|
||||
case BubbleType::NoPremium:
|
||||
case BubbleType::StarRating: return st::windowBgActive->b;
|
||||
case BubbleType::Premium: return QBrush(_cachedGradient);
|
||||
case BubbleType::Credits: return st::creditsBg3->b;
|
||||
}
|
||||
|
@ -88,6 +88,7 @@ struct BubbleRowState {
|
||||
};
|
||||
|
||||
enum class BubbleType : uchar {
|
||||
StarRating,
|
||||
NoPremium,
|
||||
Premium,
|
||||
Credits,
|
||||
|
@ -504,9 +504,17 @@ void AddLimitRow(
|
||||
LimitRowLabels labels,
|
||||
rpl::producer<LimitRowState> state,
|
||||
const style::margins &padding) {
|
||||
parent->add(
|
||||
const auto color = std::move(labels.activeLineBg);
|
||||
const auto line = parent->add(
|
||||
object_ptr<Line>(parent, st, std::move(labels), std::move(state)),
|
||||
padding);
|
||||
if (color) {
|
||||
line->setColorOverride(color());
|
||||
|
||||
style::PaletteChanged() | rpl::start_with_next([=] {
|
||||
line->setColorOverride(color());
|
||||
}, line->lifetime());
|
||||
}
|
||||
}
|
||||
|
||||
void AddAccountsRow(
|
||||
|
@ -65,6 +65,7 @@ struct LimitRowLabels {
|
||||
rpl::producer<QString> leftCount;
|
||||
rpl::producer<QString> rightLabel;
|
||||
rpl::producer<QString> rightCount;
|
||||
Fn<QBrush()> activeLineBg;
|
||||
};
|
||||
|
||||
struct LimitRowState {
|
||||
|
@ -185,7 +185,10 @@ menuIconPayment: icon {{ "payments/payment_card", menuIconColor }};
|
||||
menuIconOrderPrice: icon {{ "menu/order_price", menuIconColor }};
|
||||
menuIconOrderDate: icon {{ "menu/order_date", menuIconColor }};
|
||||
menuIconOrderNumber: icon {{ "menu/order_number", menuIconColor }};
|
||||
menuIconAdd: icon{{ "menu/add", menuIconColor }};
|
||||
menuIconAdd: icon {{ "menu/add", menuIconColor }};
|
||||
menuIconRatingGifts: icon {{ "menu/rating_gifts-24x24", menuIconColor }};
|
||||
menuIconRatingUsers: icon {{ "menu/users_stars-24x24", menuIconColor }};
|
||||
menuIconRatingRefund: icon {{ "menu/rating_refund-24x24", menuIconColor }};
|
||||
|
||||
menuIconTTLAny: icon {{ "menu/auto_delete_plain", menuIconColor }};
|
||||
menuIconTTLAnyTextPosition: point(11px, 22px);
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit ea3c209939fc10e93750c4207f5aa1fe6af66e99
|
||||
Subproject commit cd01ab20e485aabd0991bb43c7d8302cd0a2ebc4
|
Loading…
x
Reference in New Issue
Block a user