2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-22 10:17:10 +00:00

Improve rating level design.

This commit is contained in:
John Preston 2025-08-01 14:48:05 +04:00
parent 719179c1c2
commit a28ca46460
24 changed files with 271 additions and 66 deletions

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="72px" height="72px" viewBox="0 0 72 72" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Badge / level10_inner</title>
<g id="Badge-/-level10_inner" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M23,15 L49,15 C53.418278,15 57,18.581722 57,23 L57,46.8429984 C57,48.7715399 55.8908719,50.5281562 54.1496679,51.357301 L37.2898007,59.3858092 C36.4738291,59.7743671 35.5261709,59.7743671 34.7101993,59.3858092 L17.8503321,51.357301 C16.1091281,50.5281562 15,48.7715399 15,46.8429984 L15,23 C15,18.581722 18.581722,15 23,15 Z" id="Path" fill="#FFFFFF"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 714 B

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="72px" height="72px" viewBox="0 0 72 72" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Badge / level1_inner</title>
<g id="Badge-/-level1_inner" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M53,45 C54.6943359,39.9169922 55.1925159,32.4416725 54.49454,22.5740409 C54.2708931,19.4342396 51.6589867,17.0009114 48.5112305,17 L23.4887695,17 C20.3410133,17.0009114 17.7291069,19.4342396 17.50546,22.5740409 C16.8074841,32.4416725 17.3056641,39.9169922 19,45 C20.9999787,50.9999361 32.8055802,57.9438271 36.0181519,58.0000467 C39.2307237,58.0555136 50.70353,51.8894101 53,45 Z" id="Path" fill="#FFFFFF"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 767 B

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="72px" height="72px" viewBox="0 0 72 72" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Badge / level20_inner</title>
<g id="Badge-/-level20_inner" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M17.5067188,13.1565216 L35.4932812,17.8672879 C35.8254913,17.9542953 36.1745087,17.9542953 36.5067188,17.8672879 L54.4932812,13.1565216 C55.5618111,12.8766685 56.6548914,13.5160174 56.9347444,14.5845472 C56.9780693,14.7499693 57,14.9202646 57,15.091266 L57,50 C57,53.8659932 53.8659932,57 50,57 L22,57 C18.1340068,57 15,53.8659932 15,50 L15,15.091266 C15,13.9866965 15.8954305,13.091266 17,13.091266 C17.1710014,13.091266 17.3412968,13.1131968 17.5067188,13.1565216 Z" id="Path" fill="#FFFFFF"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 857 B

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="72px" height="72px" viewBox="0 0 72 72" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Badge / level2_inner</title>
<g id="Badge-/-level2_inner" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M28,15 L44,15 C51.1797017,15 57,20.8202983 57,28 L57,44 C57,51.1797017 51.1797017,57 44,57 L28,57 C20.8202983,57 15,51.1797017 15,44 L15,28 C15,20.8202983 20.8202983,15 28,15 Z" id="Rectangle" fill="#FFFFFF"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 569 B

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="72px" height="72px" viewBox="0 0 72 72" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Badge / level30_inner</title>
<g id="Badge-/-level30_inner" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M17.5067188,13.1565216 L35.4932812,17.8672879 C35.8254913,17.9542953 36.1745087,17.9542953 36.5067188,17.8672879 L54.4932812,13.1565216 C55.5618111,12.8766685 56.6548914,13.5160174 56.9347444,14.5845472 C56.9780693,14.7499693 57,14.9202646 57,15.091266 L57,47.2740807 C57,49.2380496 55.850227,51.0201354 54.0608393,51.8296203 L37.2365036,59.4406293 C36.4505105,59.7961976 35.5494895,59.7961976 34.7634964,59.4406293 L17.9391607,51.8296203 C16.149773,51.0201354 15,49.2380496 15,47.2740807 L15,15.091266 C15,13.9866965 15.8954305,13.091266 17,13.091266 C17.1710014,13.091266 17.3412968,13.1131968 17.5067188,13.1565216 Z" id="Path" fill="#FFFFFF"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1009 B

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="72px" height="72px" viewBox="0 0 72 72" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Badge / level3_inner</title>
<g id="Badge-/-level3_inner" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M35.8544323,16.5 C42.5603579,16.5 48.9772339,17.3142695 55.1127909,18.9403855 C57.8720367,19.6721748 59.5984053,22.4098874 59.0695564,25.2151096 L58.9161688,25.9952446 C57.6492744,32.2345248 55.3583898,38.2325914 52.0339947,44.0033008 C48.4623738,50.2031617 44.2319724,54.8983246 39.3449322,58.1412366 L38.808,58.49 L38.6366496,58.5935691 C37.0148548,59.5241021 35.0268922,59.5572143 33.3750071,58.6812087 L33.244,58.609 L33.1538672,58.5548802 C27.4610226,55.1837021 22.8566119,50.5438551 19.3062949,44.5841668 L18.9660053,44.0033008 C15.6094458,38.1767582 13.4677002,31.8512809 12.5350759,24.997545 C12.1766452,22.3675806 13.7646861,19.874921 16.2717218,19.0736995 L16.531,18.998 L17.3695077,18.774139 C22.9281007,17.3348182 28.7645985,16.5777965 34.8855941,16.5056926 L35.8544323,16.5 Z" id="Path" fill="#FFFFFF"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="72px" height="72px" viewBox="0 0 72 72" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Badge / level40_inner</title>
<g id="Badge-/-level40_inner" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M13.8209245,17.0037365 L23.6412021,18.7573575 C24.5036156,18.9113599 25.3902576,18.6806984 26.0682874,18.1259467 L34.7335244,11.0362073 C35.4702562,10.4334268 36.5297438,10.4334268 37.2664756,11.0362073 L45.9317126,18.1259467 C46.6097424,18.6806984 47.4963844,18.9113599 48.3587979,18.7573575 L58.1790755,17.0037365 C59.2664441,16.8095635 60.3053389,17.5336417 60.4995119,18.6210104 C60.5408831,18.8526891 60.541039,19.0898514 60.4999724,19.3215843 L55.1703343,49.3959706 C54.4933325,53.2161951 51.17282,56 47.2930717,56 L24.7069283,56 C20.82718,56 17.5066675,53.2161951 16.8296657,49.3959706 L11.5000276,19.3215843 C11.3072843,18.2339613 12.0327276,17.1960193 13.1203506,17.003276 C13.3520835,16.9622094 13.5892458,16.9623653 13.8209245,17.0037365 Z" id="Path" fill="#FFFFFF"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="72px" height="72px" viewBox="0 0 72 72" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Badge / level4_inner</title>
<g id="Badge-/-level4_inner" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M44.3705856,16.4672101 L55.5327899,27.6294144 C60.1557367,32.2523612 60.1557367,39.7476388 55.5327899,44.3705856 L44.3705856,55.5327899 C39.7476388,60.1557367 32.2523612,60.1557367 27.6294144,55.5327899 L16.4672101,44.3705856 C11.8442633,39.7476388 11.8442633,32.2523612 16.4672101,27.6294144 L27.6294144,16.4672101 C32.2523612,11.8442633 39.7476388,11.8442633 44.3705856,16.4672101 Z" id="Polygon" fill="#FFFFFF"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 775 B

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="72px" height="72px" viewBox="0 0 72 72" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Badge / level50_inner</title>
<g id="Badge-/-level50_inner" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M13.8457992,17.0081784 L23.6412021,18.7573575 C24.5036156,18.9113599 25.3902576,18.6806984 26.0682874,18.1259467 L34.7335244,11.0362073 C35.4702562,10.4334268 36.5297438,10.4334268 37.2664756,11.0362073 L45.9317126,18.1259467 C46.6097424,18.6806984 47.4963844,18.9113599 48.3587979,18.7573575 L58.1542008,17.0081784 C59.2415694,16.8140055 60.2804642,17.5380836 60.4746372,18.6254523 C60.5169804,18.862574 60.516141,19.1053947 60.4721595,19.342218 L55.2572125,47.4227021 C54.7824054,49.9793556 53.0945991,52.1457247 50.731704,53.2313793 L37.6700007,59.2327024 C36.6099358,59.7197592 35.3900642,59.7197592 34.3299993,59.2327024 L21.268296,53.2313793 C18.9054009,52.1457247 17.2175946,49.9793556 16.7427875,47.4227021 L11.5278405,19.342218 C11.3261547,18.2562177 12.0430333,17.2123419 13.1290336,17.0106561 C13.3658569,16.9666746 13.6086775,16.9658353 13.8457992,17.0081784 Z" id="Path" fill="#FFFFFF"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="72px" height="72px" viewBox="0 0 72 72" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Badge / level5_inner</title>
<g id="Badge-/-level5_inner" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M24.6347159,52.197233 L15.086894,45.3306104 C13.3626301,44.0905507 12.6070688,41.9044024 13.1995002,39.8696074 L16.4885503,28.5785206 L20.056184,18.2789734 C20.736028,16.3172234 22.5589494,14.9756983 24.6408724,14.9050076 L35.519949,14.536208 L46.4041369,14.5 C48.4875477,14.4932153 50.3596774,15.7663386 51.1123731,17.7018167 L55.0199245,27.7496763 C55.0516847,27.8313442 55.081291,27.9138273 55.1087132,27.9970407 L58.7486546,39.0425771 C59.4120036,41.0555339 58.7334828,43.2666211 57.0537084,44.5658775 L47.7086588,51.7944553 L39.3643082,58.4096688 C37.5845851,59.8205932 35.0761178,59.866608 33.245468,58.5219115 L24.6347159,52.197233 Z" id="Star-Flat" fill="#FFFFFF"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="72px" height="72px" viewBox="0 0 72 72" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Badge / level60_inner</title>
<g id="Badge-/-level60_inner" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M25.1630277,52.850407 L17.8273486,50.8900353 C15.0747,50.1544232 13.4412291,47.3453418 14.1759196,44.6106697 L16.1338353,37.322897 C16.3667018,36.4561188 16.3667018,35.5438812 16.1338353,34.677103 L14.1759196,27.3893303 C13.4412291,24.6546582 15.0747,21.8455768 17.8273486,21.1099647 L25.1630277,19.149593 C26.0355037,18.9164343 26.8311982,18.4603155 27.4708076,17.826696 L32.848571,12.499295 C34.8665291,10.500235 38.1334709,10.500235 40.151429,12.499295 L45.5291924,17.826696 C46.1688018,18.4603155 46.9644963,18.9164343 47.8369723,19.149593 L55.1726514,21.1099647 C57.9253,21.8455768 59.5587709,24.6546582 58.8240804,27.3893303 L56.8661647,34.677103 C56.6332982,35.5438812 56.6332982,36.4561188 56.8661647,37.322897 L58.8240804,44.6106697 C59.5587709,47.3453418 57.9253,50.1544232 55.1726514,50.8900353 L47.8369723,52.850407 C46.9644963,53.0835657 46.1688018,53.5396845 45.5291924,54.173304 L40.151429,59.500705 C38.1334709,61.499765 34.8665291,61.499765 32.848571,59.500705 L27.4708076,54.173304 C26.8311982,53.5396845 26.0355037,53.0835657 25.1630277,52.850407 Z" id="Star-Flat" fill="#FFFFFF"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="72px" height="72px" viewBox="0 0 72 72" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Badge / level6_inner</title>
<g id="Badge-/-level6_inner" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M56.5,27.2077494 L56.5,44.7922506 C56.5,46.727022 55.4750178,48.5148244 53.8111544,49.4822101 L38.6888456,58.2744607 C37.0249822,59.2418464 34.9750178,59.2418464 33.3111544,58.2744607 L18.1888456,49.4822101 C16.5249822,48.5148244 15.5,46.727022 15.5,44.7922506 L15.5,27.2077494 C15.5,25.272978 16.5249822,23.4851756 18.1888456,22.5177899 L33.3111544,13.7255393 C34.9750178,12.7581536 37.0249822,12.7581536 38.6888456,13.7255393 L53.8111544,22.5177899 C55.4750178,23.4851756 56.5,25.272978 56.5,27.2077494 Z" id="Polygon-Flat" fill="#FFFFFF"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 902 B

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="72px" height="72px" viewBox="0 0 72 72" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Badge / level70_inner</title>
<g id="Badge-/-level70_inner" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M25.6231529,53.6849537 L20.2456512,53.1119864 C17.3639984,52.8049492 15.263688,50.1918606 15.5389909,47.256223 L16.0527382,41.7779796 C16.1648264,40.5827489 15.8804506,39.3837383 15.2449668,38.3721824 L12.332278,33.7357975 C10.7714495,31.2512883 11.4691887,27.9507327 13.8958667,26.3394648 L18.424332,23.3326503 C19.4123422,22.6766303 20.1560647,21.7027674 20.5368804,20.5663865 L22.2823186,15.3578763 C23.2176501,12.5667813 26.188027,11.0641444 28.9387422,11.9905637 L34.0718987,13.7193707 C35.1918391,14.0965579 36.4036217,14.0811813 37.5139749,13.6756934 L42.6031895,11.8171724 C45.3303573,10.821243 48.3366176,12.248041 49.3400252,15.0145349 L51.2125014,20.1771366 C51.621034,21.3035012 52.3883797,22.2581898 53.3921518,22.8889356 L57.9928604,25.779908 C60.4582516,27.3290994 61.2366199,30.6109243 59.7371336,33.1342664 L56.9389167,37.8431184 C56.3284081,38.870485 56.07349,40.0763388 56.2148201,41.2683538 L56.8625953,46.7318584 C57.20972,49.6595979 55.1740691,52.3251686 52.3008327,52.7052309 L46.9390371,53.4144716 C45.7692127,53.5692121 44.6839892,54.1181986 43.8564529,54.9738712 L40.0635069,58.8957776 C38.030973,60.9974176 34.7141896,61.0395051 32.6308086,58.9900928 L28.7429758,55.1656495 C27.8947373,54.3312412 26.7964039,53.8099624 25.6231529,53.6849537 Z" id="Star-Flat" fill="#FFFFFF"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="72px" height="72px" viewBox="0 0 72 72" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Badge / level7_inner</title>
<g id="Badge-/-level7_inner" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M47.5119469,15.9725146 L56.9485165,28.1544765 C57.8703305,29.3444749 58.2101938,30.8974518 57.8718989,32.3737956 L54.4087892,47.487062 C54.0704943,48.9634057 53.0908608,50.2024337 51.7472,50.8534058 L37.9922031,57.5173789 C36.6485423,58.1683511 35.087096,58.1604167 33.7498732,57.4958219 L20.0607825,50.6923941 C18.7235597,50.0277993 17.7561016,48.7788774 17.4322729,47.2991691 L14.1172527,32.1514602 C13.793424,30.6717519 14.1484698,29.1223062 15.0818847,27.9417349 L24.637213,15.8562787 C25.570628,14.6757075 26.9808209,13.9925021 28.468599,14 L43.6989186,14.0774536 C45.1866968,14.0850136 46.5901329,14.7825162 47.5119469,15.9725146 Z" id="Polygon-Flat" fill="#FFFFFF"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="72px" height="72px" viewBox="0 0 72 72" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Badge / level80_inner</title>
<g id="Badge-/-level80_inner" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M25.4075318,55.0983015 L20.6181753,54.4891523 C18.1878179,54.1800396 16.3367069,52.1599065 16.2405902,49.7118564 L16.0511788,44.887634 C16.0102196,43.84442 15.6446438,42.8400089 15.0054554,42.0145324 L12.0496025,38.1972124 C10.5496559,36.2601145 10.6691726,33.5227316 12.3322407,31.723734 L15.609547,28.1785595 C16.3182481,27.4119333 16.769973,26.4432062 16.9016985,25.4075318 L17.5108477,20.6181753 C17.8199604,18.1878179 19.8400935,16.3367069 22.2881436,16.2405902 L27.112366,16.0511788 C28.15558,16.0102196 29.1599911,15.6446438 29.9854676,15.0054554 L33.8027876,12.0496025 C35.7398855,10.5496559 38.4772684,10.6691726 40.276266,12.3322407 L43.8214405,15.609547 C44.5880667,16.3182481 45.5567938,16.769973 46.5924682,16.9016985 L51.3818247,17.5108477 C53.8121821,17.8199604 55.6632931,19.8400935 55.7594098,22.2881436 L55.9488212,27.112366 C55.9897804,28.15558 56.3553562,29.1599911 56.9945446,29.9854676 L59.9503975,33.8027876 C61.4503441,35.7398855 61.3308274,38.4772684 59.6677593,40.276266 L56.390453,43.8214405 C55.6817519,44.5880667 55.230027,45.5567938 55.0983015,46.5924682 L54.4891523,51.3818247 C54.1800396,53.8121821 52.1599065,55.6632931 49.7118564,55.7594098 L44.887634,55.9488212 C43.84442,55.9897804 42.8400089,56.3553562 42.0145324,56.9945446 L38.1972124,59.9503975 C36.2601145,61.4503441 33.5227316,61.3308274 31.723734,59.6677593 L28.1785595,56.390453 C27.4119333,55.6817519 26.4432062,55.230027 25.4075318,55.0983015 Z" id="Star" fill="#FFFFFF"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="72px" height="72px" viewBox="0 0 72 72" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Badge / level8_inner</title>
<g id="Badge-/-level8_inner" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M27.9852814,15 L44.0147186,15 C45.6060176,15 47.132141,15.632141 48.2573593,16.7573593 L55.2426407,23.7426407 C56.367859,24.867859 57,26.3939824 57,27.9852814 L57,44.0147186 C57,45.6060176 56.367859,47.132141 55.2426407,48.2573593 L48.2573593,55.2426407 C47.132141,56.367859 45.6060176,57 44.0147186,57 L27.9852814,57 C26.3939824,57 24.867859,56.367859 23.7426407,55.2426407 L16.7573593,48.2573593 C15.632141,47.132141 15,45.6060176 15,44.0147186 L15,27.9852814 C15,26.3939824 15.632141,24.867859 16.7573593,23.7426407 L23.7426407,16.7573593 C24.867859,15.632141 26.3939824,15 27.9852814,15 Z" id="Rectangle" fill="#FFFFFF"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 985 B

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="72px" height="72px" viewBox="0 0 72 72" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Badge / level90_inner</title>
<g id="Badge-/-level90_inner" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M15.8733536,45.5876663 L13.5374788,26.4767308 C13.2739231,24.3204523 14.4193524,22.2383675 16.3756386,21.3177141 L34.3082495,12.8783965 C35.3803169,12.3738678 36.6196831,12.3738678 37.6917505,12.8783965 L55.6243614,21.3177141 C57.5806476,22.2383675 58.7260769,24.3204523 58.4625212,26.4767308 L56.1266464,45.5876663 C55.9615284,46.9385772 55.2580965,48.1641245 54.1775745,48.9834175 L39.003776,60.4887707 C37.2255672,61.8370764 34.7744328,61.8370764 32.996224,60.4887707 L17.8224255,48.9834175 C16.7419035,48.1641245 16.0384716,46.9385772 15.8733536,45.5876663 Z" id="Diamond-Flat" fill="#FFFFFF"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 960 B

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="72px" height="72px" viewBox="0 0 72 72" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Badge / level9_inner</title>
<g id="Badge-/-level9_inner" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<circle id="Oval" fill="#FFFFFF" cx="36" cy="36" r="21"></circle>
</g>
</svg>

After

Width:  |  Height:  |  Size: 410 B

View File

@ -1191,22 +1191,6 @@ topicsLayoutButtonIconSize: 140px;
topicsLayoutButtonPadding: margins(4px, 0px, 4px, 12px); topicsLayoutButtonPadding: margins(4px, 0px, 4px, 12px);
topicsLayoutButtonSkip: 0px; topicsLayoutButtonSkip: 0px;
StarsRating {
margin: margins;
padding: margins;
style: TextStyle;
activeBg: color;
activeFg: color;
}
infoStarsRating: StarsRating {
margin: margins(6px, 6px, 6px, 6px);
padding: margins(6px, 1px, 6px, 1px);
style: TextStyle(defaultTextStyle) {
font: font(11px semibold);
}
activeBg: windowBgActive;
activeFg: windowFgActive;
}
infoStarsTitle: FlatLabel(defaultFlatLabel) { infoStarsTitle: FlatLabel(defaultFlatLabel) {
minWidth: 40px; minWidth: 40px;
textFg: windowBoldFg; textFg: windowBoldFg;

View File

@ -0,0 +1,76 @@
/*
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";
LevelShape {
icon: icon;
position: point;
}
levelStyle: TextStyle(defaultTextStyle) {
font: font(11px semibold);
}
levelTextFg: windowFgActive;
levelMargin: margins(6px, 6px, 6px, 6px);
levelBase: LevelShape {
position: point(0px, 8px);
}
level1: LevelShape(levelBase) {
icon: icon {{ "levels/level1_inner-31x31", windowBgActive }};
}
level2: LevelShape(levelBase) {
icon: icon {{ "levels/level2_inner-31x31", windowBgActive }};
}
level3: LevelShape(levelBase) {
icon: icon {{ "levels/level3_inner-31x31", windowBgActive }};
}
level4: LevelShape(levelBase) {
icon: icon {{ "levels/level4_inner-31x31", windowBgActive }};
}
level5: LevelShape(levelBase) {
icon: icon {{ "levels/level5_inner-31x31", windowBgActive }};
}
level6: LevelShape(levelBase) {
icon: icon {{ "levels/level6_inner-31x31", windowBgActive }};
}
level7: LevelShape(levelBase) {
icon: icon {{ "levels/level7_inner-31x31", windowBgActive }};
}
level8: LevelShape(levelBase) {
icon: icon {{ "levels/level8_inner-31x31", windowBgActive }};
}
level9: LevelShape(levelBase) {
icon: icon {{ "levels/level9_inner-31x31", windowBgActive }};
}
level10: LevelShape(levelBase) {
icon: icon {{ "levels/level10_inner-31x31", windowBgActive }};
}
level20: LevelShape(levelBase) {
icon: icon {{ "levels/level20_inner-31x31", windowBgActive }};
}
level30: LevelShape(levelBase) {
icon: icon {{ "levels/level30_inner-31x31", windowBgActive }};
}
level40: LevelShape(levelBase) {
icon: icon {{ "levels/level40_inner-31x31", windowBgActive }};
}
level50: LevelShape(levelBase) {
icon: icon {{ "levels/level50_inner-31x31", windowBgActive }};
}
level60: LevelShape(levelBase) {
icon: icon {{ "levels/level60_inner-31x31", windowBgActive }};
}
level70: LevelShape(levelBase) {
icon: icon {{ "levels/level70_inner-31x31", windowBgActive }};
}
level80: LevelShape(levelBase) {
icon: icon {{ "levels/level80_inner-31x31", windowBgActive }};
}
level90: LevelShape(levelBase) {
icon: icon {{ "levels/level90_inner-31x31", windowBgActive }};
}

View File

@ -650,7 +650,6 @@ Cover::Cover(
, _starsRating(_peer->isUser() , _starsRating(_peer->isUser()
? std::make_unique<Ui::StarsRating>( ? std::make_unique<Ui::StarsRating>(
this, this,
st::infoStarsRating,
_controller->uiShow(), _controller->uiShow(),
_peer->isSelf() ? QString() : _peer->shortName(), _peer->isSelf() ? QString() : _peer->shortName(),
Data::StarsRatingValue(_peer)) Data::StarsRatingValue(_peer))
@ -669,7 +668,7 @@ Cover::Cover(
if (!_peer->isMegagroup()) { if (!_peer->isMegagroup()) {
_status->setAttribute(Qt::WA_TransparentForMouseEvents); _status->setAttribute(Qt::WA_TransparentForMouseEvents);
if (const auto rating = _starsRating.get()) { if (const auto rating = _starsRating.get()) {
_statusShift = rating->collapsedWidthValue(); _statusShift = rating->widthValue();
_statusShift.changes() | rpl::start_with_next([=] { _statusShift.changes() | rpl::start_with_next([=] {
refreshStatusGeometry(width()); refreshStatusGeometry(width());
}, _status->lifetime()); }, _status->lifetime());

View File

@ -23,6 +23,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/rp_widget.h" #include "ui/rp_widget.h"
#include "ui/ui_utility.h" #include "ui/ui_utility.h"
#include "styles/style_info.h" #include "styles/style_info.h"
#include "styles/style_info_levels.h"
#include "styles/style_layers.h" #include "styles/style_layers.h"
#include "styles/style_premium.h" #include "styles/style_premium.h"
#include "styles/style_settings.h" #include "styles/style_settings.h"
@ -355,16 +356,47 @@ void AboutRatingBox(
).append(' ').append(tr::lng_stars_rating_understood(tr::now)))); ).append(' ').append(tr::lng_stars_rating_understood(tr::now))));
} }
[[nodiscard]] not_null<const style::LevelShape*> SelectShape(int level) {
struct Shape {
int level = 0;
not_null<const style::LevelShape*> shape;
};
const auto list = std::vector<Shape>{
{ 1, &st::level1 },
{ 2, &st::level2 },
{ 3, &st::level3 },
{ 4, &st::level4 },
{ 5, &st::level5 },
{ 6, &st::level6 },
{ 7, &st::level7 },
{ 8, &st::level8 },
{ 9, &st::level9 },
{ 10, &st::level10 },
{ 20, &st::level20 },
{ 30, &st::level30 },
{ 40, &st::level40 },
{ 50, &st::level50 },
{ 60, &st::level60 },
{ 70, &st::level70 },
{ 80, &st::level80 },
{ 90, &st::level90 },
};
const auto i = ranges::lower_bound(
list,
level + 1,
ranges::less(),
&Shape::level);
return (i != begin(list)) ? (i - 1)->shape : list.front().shape;
}
} // namespace } // namespace
StarsRating::StarsRating( StarsRating::StarsRating(
QWidget *parent, QWidget *parent,
const style::StarsRating &st,
std::shared_ptr<Ui::Show> show, std::shared_ptr<Ui::Show> show,
const QString &name, const QString &name,
rpl::producer<Counters> value) rpl::producer<Counters> value)
: _widget(std::make_unique<Ui::AbstractButton>(parent)) : _widget(std::make_unique<Ui::AbstractButton>(parent))
, _st(st)
, _show(std::move(show)) , _show(std::move(show))
, _name(name) , _name(name)
, _value(std::move(value)) { , _value(std::move(value)) {
@ -388,40 +420,35 @@ void StarsRating::init() {
_show->show(Box(AboutRatingBox, _name, _value.current())); _show->show(Box(AboutRatingBox, _name, _value.current()));
}); });
const auto added = _st.margin + _st.padding; _widget->resize(_widget->width(), st::level1.icon.height());
const auto fontHeight = _st.style.font->height;
const auto height = added.top() + fontHeight + added.bottom();
_widget->resize(_widget->width(), height);
_value.value() | rpl::start_with_next([=](Counters rating) { _value.value() | rpl::start_with_next([=](Counters rating) {
if (!rating) { updateData(rating);
_widget->resize(0, _widget->height());
_collapsedWidthValue = 0;
return;
}
updateTexts(rating);
}, lifetime()); }, lifetime());
} }
void StarsRating::updateTexts(Counters rating) { void StarsRating::updateData(Data::StarsRating rating) {
_collapsedText.setText( if (!rating) {
_st.style, _shape = nullptr;
Lang::FormatCountDecimal(rating.level)); _widthValue = 0;
} else {
const auto added = _st.padding; _shape = SelectShape(rating.level);
const auto add = added.left() + added.right(); _collapsedText.setText(
const auto height = _widget->height(); st::levelStyle,
_collapsedWidthValue = _st.margin.right() Lang::FormatCountDecimal(rating.level));
+ std::max( _widthValue = _shape->icon.width() - st::levelMargin.left();
add + _collapsedText.maxWidth(), }
height - _st.margin.top() - _st.margin.bottom());
updateWidth(); updateWidth();
} }
void StarsRating::updateWidth() { void StarsRating::updateWidth() {
const auto widthToRight = _collapsedWidthValue.current(); if (const auto widthToRight = _widthValue.current()) {
_widget->resize(_st.margin.left() + widthToRight, _widget->height()); const auto &margin = st::levelMargin;
_widget->update(); _widget->resize(margin.left() + widthToRight, _widget->height());
_widget->update();
} else {
_widget->resize(0, _widget->height());
}
} }
void StarsRating::raise() { void StarsRating::raise() {
@ -429,32 +456,25 @@ void StarsRating::raise() {
} }
void StarsRating::moveTo(int x, int y) { void StarsRating::moveTo(int x, int y) {
_widget->move(x - _st.margin.left(), y - _st.margin.top()); _widget->move(x - st::levelMargin.left(), y - st::levelMargin.top());
} }
void StarsRating::paint(QPainter &p) { void StarsRating::paint(QPainter &p) {
const auto outer = _widget->rect().marginsRemoved(_st.margin); if (!_shape) {
if (outer.isEmpty()) {
return; return;
} }
const auto inner = outer.marginsRemoved(_st.padding); _shape->icon.paint(p, 0, 0, _widget->width());
auto hq = PainterHighQualityEnabler(p); const auto x = (_widget->width() - _collapsedText.maxWidth()) / 2;
p.setPen(Qt::NoPen); p.setPen(st::levelTextFg);
p.setBrush(_st.activeBg);
const auto radius = outer.height() / 2.;
p.drawRoundedRect(outer, radius, radius);
p.setPen(_st.activeFg);
const auto skip = (inner.width() - _collapsedText.maxWidth()) / 2;
_collapsedText.draw(p, { _collapsedText.draw(p, {
.position = inner.topLeft() + QPoint(skip, 0), .position = QPoint(x, 0) + _shape->position,
.availableWidth = _collapsedText.maxWidth(), .availableWidth = _collapsedText.maxWidth(),
}); });
} }
rpl::producer<int> StarsRating::collapsedWidthValue() const { rpl::producer<int> StarsRating::widthValue() const {
return _collapsedWidthValue.value(); return _widthValue.value();
} }
rpl::lifetime &StarsRating::lifetime() { rpl::lifetime &StarsRating::lifetime() {

View File

@ -12,7 +12,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace style { namespace style {
struct Toast; struct Toast;
struct StarsRating; struct LevelShape;
} // namespace style } // namespace style
namespace Ui::Toast { namespace Ui::Toast {
@ -30,7 +30,6 @@ class StarsRating final {
public: public:
StarsRating( StarsRating(
QWidget *parent, QWidget *parent,
const style::StarsRating &st,
std::shared_ptr<Ui::Show> show, std::shared_ptr<Ui::Show> show,
const QString &name, const QString &name,
rpl::producer<Data::StarsRating> value); rpl::producer<Data::StarsRating> value);
@ -39,25 +38,25 @@ public:
void raise(); void raise();
void moveTo(int x, int y); void moveTo(int x, int y);
[[nodiscard]] rpl::producer<int> collapsedWidthValue() const; [[nodiscard]] rpl::producer<int> widthValue() const;
[[nodiscard]] rpl::lifetime &lifetime(); [[nodiscard]] rpl::lifetime &lifetime();
private: private:
void init(); void init();
void paint(QPainter &p); void paint(QPainter &p);
void updateTexts(Data::StarsRating rating); void updateData(Data::StarsRating rating);
void updateWidth(); void updateWidth();
const std::unique_ptr<Ui::AbstractButton> _widget; const std::unique_ptr<Ui::AbstractButton> _widget;
const style::StarsRating &_st;
const std::shared_ptr<Ui::Show> _show; const std::shared_ptr<Ui::Show> _show;
const QString _name; const QString _name;
Ui::Text::String _collapsedText; Ui::Text::String _collapsedText;
rpl::variable<Data::StarsRating> _value; rpl::variable<Data::StarsRating> _value;
rpl::variable<int> _collapsedWidthValue; rpl::variable<int> _widthValue;
const style::LevelShape *_shape = nullptr;
}; };

View File

@ -27,6 +27,7 @@ set(style_files
info/info.style info/info.style
info/channel_statistics/boosts/giveaway/giveaway.style info/channel_statistics/boosts/giveaway/giveaway.style
info/channel_statistics/earn/channel_earn.style info/channel_statistics/earn/channel_earn.style
info/profile/info_levels.style
info/userpic/info_userpic_builder.style info/userpic/info_userpic_builder.style
intro/intro.style intro/intro.style
iv/iv.style iv/iv.style