Update API scheme on layer 148: Topic icons.
18
Telegram/Resources/art/topic_icons/blue.svg
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="84px" height="84px" viewBox="0 0 84 84" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<title>topic blue</title>
|
||||||
|
<defs>
|
||||||
|
<linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="linearGradient-1">
|
||||||
|
<stop stop-color="#4BB7FF" offset="0%"></stop>
|
||||||
|
<stop stop-color="#015EC1" offset="100%"></stop>
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient x1="50%" y1="0%" x2="50%" y2="99.39588%" id="linearGradient-2">
|
||||||
|
<stop stop-color="#0888DF" offset="0%"></stop>
|
||||||
|
<stop stop-color="#0042AC" offset="100%"></stop>
|
||||||
|
</linearGradient>
|
||||||
|
</defs>
|
||||||
|
<g id="topic-blue" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||||
|
<path d="M42,4.47368421 C52.6535116,4.47368421 62.3029461,8.44172846 69.286057,14.8715044 C76.2233062,21.2590526 80.5263158,30.0798831 80.5263158,39.8304382 C80.5263158,49.5809933 76.2233062,58.4018239 69.286057,64.7893721 C62.3029461,71.219148 52.6535116,75.1871923 42,75.1871923 C37.5267059,75.1871923 33.2308553,74.4877643 29.2348341,73.2001187 C29.0182529,73.1303293 28.8019654,73.0586229 28.5862413,72.9852481 C28.3948519,73.106612 28.2000814,73.2292009 28.0019297,73.3530173 C26.1800899,74.4914063 24.5768234,75.4183854 23.1902273,76.1332316 C19.9632993,77.7968433 15.8838664,78.895322 10.968708,79.4573148 L10.3331597,79.5269374 C10.8475353,78.5381033 11.3155893,77.6262907 11.7364879,76.7897918 L12.0856904,76.0911971 C13.1548056,73.9371347 13.8747553,72.3343394 14.2288664,71.2486595 C14.8154652,69.4501884 15.1095499,67.6701625 15.2363061,66.0328103 C15.2549358,65.7921643 15.2704685,65.5479168 15.2812363,65.2994157 C15.1072303,65.1457013 14.9345381,64.9902431 14.7631844,64.8330639 C7.79678435,58.4429296 3.47368421,49.6037286 3.47368421,39.8304382 C3.47368421,30.0798831 7.77669379,21.2590526 14.713943,14.8715044 C21.6970539,8.44172846 31.3464884,4.47368421 42,4.47368421 Z" id="Combined-Shape-Copy-2" stroke="url(#linearGradient-2)" stroke-width="2.94736842" fill="url(#linearGradient-1)"></path>
|
||||||
|
<path d="M9.68078613,24.6137047 C9.8721537,24.8136848 10.1894036,24.8206666 10.3893837,24.629299 C10.3964827,24.6225057 10.4033805,24.6155051 10.410082,24.6083194 C20.5178445,13.7276637 31.3141669,8.50123177 42.7990494,8.92902374 C54.2584365,9.35586606 64.9235425,15.3681505 74.7943671,26.9658769 C75.0309355,27.243826 75.4426222,27.2904538 75.7353592,27.0724506 C76.0315877,26.8518473 76.1075038,26.440096 75.9094038,26.1283693 C67.7821181,13.3374534 56.7453333,6.69089625 42.7990494,6.18869781 C28.8220513,5.68539338 17.7581791,11.5492352 9.60743269,23.7802233 C9.4336795,24.0409463 9.46416665,24.3873362 9.68078613,24.6137047 Z" id="Path-22" fill="#71D0FF" opacity="0.37491644"></path>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 2.8 KiB |
18
Telegram/Resources/art/topic_icons/gray.svg
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="84px" height="84px" viewBox="0 0 84 84" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<title>topic gray</title>
|
||||||
|
<defs>
|
||||||
|
<linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="linearGradient-1">
|
||||||
|
<stop stop-color="#A5A5A5" offset="0%"></stop>
|
||||||
|
<stop stop-color="#616161" offset="100%"></stop>
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient x1="50%" y1="0%" x2="50%" y2="99.39588%" id="linearGradient-2">
|
||||||
|
<stop stop-color="#737373" offset="0%"></stop>
|
||||||
|
<stop stop-color="#565656" offset="100%"></stop>
|
||||||
|
</linearGradient>
|
||||||
|
</defs>
|
||||||
|
<g id="topic-gray" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||||
|
<path d="M42,4.47368421 C52.6535116,4.47368421 62.3029461,8.44172846 69.286057,14.8715044 C76.2233062,21.2590526 80.5263158,30.0798831 80.5263158,39.8304382 C80.5263158,49.5809933 76.2233062,58.4018239 69.286057,64.7893721 C62.3029461,71.219148 52.6535116,75.1871923 42,75.1871923 C37.5267059,75.1871923 33.2308553,74.4877643 29.2348341,73.2001187 C29.0182529,73.1303293 28.8019654,73.0586229 28.5862413,72.9852481 C28.3948519,73.106612 28.2000814,73.2292009 28.0019297,73.3530173 C26.1800899,74.4914063 24.5768234,75.4183854 23.1902273,76.1332316 C19.9632993,77.7968433 15.8838664,78.895322 10.968708,79.4573148 L10.3331597,79.5269374 C10.8475353,78.5381033 11.3155893,77.6262907 11.7364879,76.7897918 L12.0856904,76.0911971 C13.1548056,73.9371347 13.8747553,72.3343394 14.2288664,71.2486595 C14.8154652,69.4501884 15.1095499,67.6701625 15.2363061,66.0328103 C15.2549358,65.7921643 15.2704685,65.5479168 15.2812363,65.2994157 C15.1072303,65.1457013 14.9345381,64.9902431 14.7631844,64.8330639 C7.79678435,58.4429296 3.47368421,49.6037286 3.47368421,39.8304382 C3.47368421,30.0798831 7.77669379,21.2590526 14.713943,14.8715044 C21.6970539,8.44172846 31.3464884,4.47368421 42,4.47368421 Z" id="Combined-Shape-Copy-2" stroke="url(#linearGradient-2)" stroke-width="2.94736842" fill="url(#linearGradient-1)"></path>
|
||||||
|
<path d="M9.68078613,24.6137047 C9.8721537,24.8136848 10.1894036,24.8206666 10.3893837,24.629299 C10.3964827,24.6225057 10.4033805,24.6155051 10.410082,24.6083194 C20.5178445,13.7276637 31.3141669,8.50123177 42.7990494,8.92902374 C54.2584365,9.35586606 64.9235425,15.3681505 74.7943671,26.9658769 C75.0309355,27.243826 75.4426222,27.2904538 75.7353592,27.0724506 C76.0315877,26.8518473 76.1075038,26.440096 75.9094038,26.1283693 C67.7821181,13.3374534 56.7453333,6.69089625 42.7990494,6.18869781 C28.8220513,5.68539338 17.7581791,11.5492352 9.60743269,23.7802233 C9.4336795,24.0409463 9.46416665,24.3873362 9.68078613,24.6137047 Z" id="Path-22" fill="#B8B8B8" opacity="0.37491644"></path>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 2.8 KiB |
18
Telegram/Resources/art/topic_icons/green.svg
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="84px" height="84px" viewBox="0 0 84 84" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<title>topic green</title>
|
||||||
|
<defs>
|
||||||
|
<linearGradient x1="50%" y1="0%" x2="50%" y2="99.7635421%" id="linearGradient-1">
|
||||||
|
<stop stop-color="#97E334" offset="0%"></stop>
|
||||||
|
<stop stop-color="#11B411" offset="100%"></stop>
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient x1="50%" y1="0%" x2="50%" y2="98.9250576%" id="linearGradient-2">
|
||||||
|
<stop stop-color="#48AF18" offset="0%"></stop>
|
||||||
|
<stop stop-color="#05951A" offset="100%"></stop>
|
||||||
|
</linearGradient>
|
||||||
|
</defs>
|
||||||
|
<g id="topic-green" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||||
|
<path d="M42,4.42105263 C52.6675181,4.42105263 62.3294728,8.39460913 69.3217075,14.8327858 C76.2697184,21.230243 80.5789474,30.0648871 80.5789474,39.8304382 C80.5789474,49.5959894 76.2697184,58.4306335 69.3217075,64.8280906 C62.3294728,71.2662674 52.6675181,75.2398239 42,75.2398239 C37.5210466,75.2398239 33.2197662,74.5394876 29.2186919,73.2502137 C29.0098956,73.1829329 28.8013719,73.1138726 28.5929684,73.0432995 C28.4083865,73.1602808 28.2206704,73.2783974 28.0298198,73.3976517 C26.2065565,74.5369301 24.6020235,75.4646079 23.2143446,76.1800123 C19.9826132,77.8461004 15.8972513,78.9467661 10.9744394,79.5096334 L10.3380323,79.5793501 C12.3422829,75.5502987 13.657562,72.8305079 14.1788292,71.2323391 C14.7640488,69.4380965 15.0573738,67.6622454 15.1838316,66.0287479 C15.2017691,65.7970433 15.21683,65.561992 15.2283048,65.3228731 C15.0601712,65.1741519 14.8932645,65.0238038 14.727607,64.8718496 C7.75040024,58.4718025 3.42105263,49.6187586 3.42105263,39.8304382 C3.42105263,30.0648871 7.7302816,21.230243 14.6782925,14.8327858 C21.6705272,8.39460913 31.3324819,4.42105263 42,4.42105263 Z" id="Combined-Shape-Copy-2" stroke="url(#linearGradient-2)" stroke-width="2.84210526" fill="url(#linearGradient-1)"></path>
|
||||||
|
<path d="M9.68078613,24.6137047 C9.8721537,24.8136848 10.1894036,24.8206666 10.3893837,24.629299 C10.3964827,24.6225057 10.4033805,24.6155051 10.410082,24.6083194 C20.5178445,13.7276637 31.3141669,8.50123177 42.7990494,8.92902374 C54.2584365,9.35586606 64.9235425,15.3681505 74.7943671,26.9658769 C75.0309355,27.243826 75.4426222,27.2904538 75.7353592,27.0724506 C76.0315877,26.8518473 76.1075038,26.440096 75.9094038,26.1283693 C67.7821181,13.3374534 56.7453333,6.69089625 42.7990494,6.18869781 C28.8220513,5.68539338 17.7581791,11.5492352 9.60743269,23.7802233 C9.4336795,24.0409463 9.46416665,24.3873362 9.68078613,24.6137047 Z" id="Path-22" fill="#C2FF71" opacity="0.37491644"></path>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 2.7 KiB |
18
Telegram/Resources/art/topic_icons/red.svg
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="84px" height="84px" viewBox="0 0 84 84" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<title>topic red</title>
|
||||||
|
<defs>
|
||||||
|
<linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="linearGradient-1">
|
||||||
|
<stop stop-color="#FF714C" offset="0%"></stop>
|
||||||
|
<stop stop-color="#C61505" offset="100%"></stop>
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient x1="50%" y1="0%" x2="50%" y2="98.6056043%" id="linearGradient-2">
|
||||||
|
<stop stop-color="#E12F1F" offset="0%"></stop>
|
||||||
|
<stop stop-color="#B40101" offset="100%"></stop>
|
||||||
|
</linearGradient>
|
||||||
|
</defs>
|
||||||
|
<g id="topic-red" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||||
|
<path d="M42,4.42105263 C52.6675181,4.42105263 62.3294728,8.39460913 69.3217075,14.8327858 C76.2697184,21.230243 80.5789474,30.0648871 80.5789474,39.8304382 C80.5789474,49.5959894 76.2697184,58.4306335 69.3217075,64.8280906 C62.3294728,71.2662674 52.6675181,75.2398239 42,75.2398239 C37.5210466,75.2398239 33.2197662,74.5394876 29.2186919,73.2502137 C29.0098956,73.1829329 28.8013719,73.1138726 28.5929684,73.0432995 C28.4083865,73.1602808 28.2206704,73.2783974 28.0298198,73.3976517 C26.2065565,74.5369301 24.6020235,75.4646079 23.2143446,76.1800123 C19.9826132,77.8461004 15.8972513,78.9467661 10.9744394,79.5096334 L10.3380323,79.5793501 C12.3422829,75.5502987 13.657562,72.8305079 14.1788292,71.2323391 C14.7640488,69.4380965 15.0573738,67.6622454 15.1838316,66.0287479 C15.2017691,65.7970433 15.21683,65.561992 15.2283048,65.3228731 C15.0601712,65.1741519 14.8932645,65.0238038 14.727607,64.8718496 C7.75040024,58.4718025 3.42105263,49.6187586 3.42105263,39.8304382 C3.42105263,30.0648871 7.7302816,21.230243 14.6782925,14.8327858 C21.6705272,8.39460913 31.3324819,4.42105263 42,4.42105263 Z" id="Combined-Shape-Copy-2" stroke="url(#linearGradient-2)" stroke-width="2.84210526" fill="url(#linearGradient-1)"></path>
|
||||||
|
<path d="M9.68078613,24.6137047 C9.8721537,24.8136848 10.1894036,24.8206666 10.3893837,24.629299 C10.3964827,24.6225057 10.4033805,24.6155051 10.410082,24.6083194 C20.5178445,13.7276637 31.3141669,8.50123177 42.7990494,8.92902374 C54.2584365,9.35586606 64.9235425,15.3681505 74.7943671,26.9658769 C75.0309355,27.243826 75.4426222,27.2904538 75.7353592,27.0724506 C76.0315877,26.8518473 76.1075038,26.440096 75.9094038,26.1283693 C67.7821181,13.3374534 56.7453333,6.69089625 42.7990494,6.18869781 C28.8220513,5.68539338 17.7581791,11.5492352 9.60743269,23.7802233 C9.4336795,24.0409463 9.46416665,24.3873362 9.68078613,24.6137047 Z" id="Path-22" fill="#FFB47D" opacity="0.37491644"></path>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 2.7 KiB |
18
Telegram/Resources/art/topic_icons/rose.svg
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="84px" height="84px" viewBox="0 0 84 84" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<title>topic rose</title>
|
||||||
|
<defs>
|
||||||
|
<linearGradient x1="50%" y1="4.31422203%" x2="50%" y2="99.6023762%" id="linearGradient-1">
|
||||||
|
<stop stop-color="#FF7999" offset="0%"></stop>
|
||||||
|
<stop stop-color="#E4215A" offset="98.5968743%"></stop>
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient x1="50%" y1="0%" x2="50%" y2="96.4024371%" id="linearGradient-2">
|
||||||
|
<stop stop-color="#F83B72" offset="0%"></stop>
|
||||||
|
<stop stop-color="#BA0940" offset="100%"></stop>
|
||||||
|
</linearGradient>
|
||||||
|
</defs>
|
||||||
|
<g id="topic-rose" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||||
|
<path d="M42,4.42105263 C52.6675181,4.42105263 62.3294728,8.39460913 69.3217075,14.8327858 C76.2697184,21.230243 80.5789474,30.0648871 80.5789474,39.8304382 C80.5789474,49.5959894 76.2697184,58.4306335 69.3217075,64.8280906 C62.3294728,71.2662674 52.6675181,75.2398239 42,75.2398239 C37.5210466,75.2398239 33.2197662,74.5394876 29.2186919,73.2502137 C29.0098956,73.1829329 28.8013719,73.1138726 28.5929684,73.0432995 C28.4083865,73.1602808 28.2206704,73.2783974 28.0298198,73.3976517 C26.2065565,74.5369301 24.6020235,75.4646079 23.2143446,76.1800123 C19.9826132,77.8461004 15.8972513,78.9467661 10.9744394,79.5096334 L10.3380323,79.5793501 C12.3422829,75.5502987 13.657562,72.8305079 14.1788292,71.2323391 C14.7640488,69.4380965 15.0573738,67.6622454 15.1838316,66.0287479 C15.2017691,65.7970433 15.21683,65.561992 15.2283048,65.3228731 C15.0601712,65.1741519 14.8932645,65.0238038 14.727607,64.8718496 C7.75040024,58.4718025 3.42105263,49.6187586 3.42105263,39.8304382 C3.42105263,30.0648871 7.7302816,21.230243 14.6782925,14.8327858 C21.6705272,8.39460913 31.3324819,4.42105263 42,4.42105263 Z" id="Combined-Shape-Copy-2" stroke="url(#linearGradient-2)" stroke-width="2.84210526" fill="url(#linearGradient-1)"></path>
|
||||||
|
<path d="M9.68078613,24.6137047 C9.8721537,24.8136848 10.1894036,24.8206666 10.3893837,24.629299 C10.3964827,24.6225057 10.4033805,24.6155051 10.410082,24.6083194 C20.5178445,13.7276637 31.3141669,8.50123177 42.7990494,8.92902374 C54.2584365,9.35586606 64.9235425,15.3681505 74.7943671,26.9658769 C75.0309355,27.243826 75.4426222,27.2904538 75.7353592,27.0724506 C76.0315877,26.8518473 76.1075038,26.440096 75.9094038,26.1283693 C67.7821181,13.3374534 56.7453333,6.69089625 42.7990494,6.18869781 C28.8220513,5.68539338 17.7581791,11.5492352 9.60743269,23.7802233 C9.4336795,24.0409463 9.46416665,24.3873362 9.68078613,24.6137047 Z" id="Path-22" fill="#FFC7D6" opacity="0.37491644"></path>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 2.7 KiB |
18
Telegram/Resources/art/topic_icons/violet.svg
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="84px" height="84px" viewBox="0 0 84 84" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<title>topic violet</title>
|
||||||
|
<defs>
|
||||||
|
<linearGradient x1="50%" y1="0%" x2="50%" y2="99.7635421%" id="linearGradient-1">
|
||||||
|
<stop stop-color="#E57AFF" offset="0%"></stop>
|
||||||
|
<stop stop-color="#A438BB" offset="99.8550522%"></stop>
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient x1="50%" y1="0%" x2="50%" y2="99.39588%" id="linearGradient-2">
|
||||||
|
<stop stop-color="#B239D1" offset="0%"></stop>
|
||||||
|
<stop stop-color="#7C279A" offset="100%"></stop>
|
||||||
|
</linearGradient>
|
||||||
|
</defs>
|
||||||
|
<g id="topic-violet" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||||
|
<path d="M42,4.42105263 C52.6675181,4.42105263 62.3294728,8.39460913 69.3217075,14.8327858 C76.2697184,21.230243 80.5789474,30.0648871 80.5789474,39.8304382 C80.5789474,49.5959894 76.2697184,58.4306335 69.3217075,64.8280906 C62.3294728,71.2662674 52.6675181,75.2398239 42,75.2398239 C37.5210466,75.2398239 33.2197662,74.5394876 29.2186919,73.2502137 C29.0098956,73.1829329 28.8013719,73.1138726 28.5929684,73.0432995 C28.4083865,73.1602808 28.2206704,73.2783974 28.0298198,73.3976517 C26.2065565,74.5369301 24.6020235,75.4646079 23.2143446,76.1800123 C19.9826132,77.8461004 15.8972513,78.9467661 10.9744394,79.5096334 L10.3380323,79.5793501 C12.3422829,75.5502987 13.657562,72.8305079 14.1788292,71.2323391 C14.7640488,69.4380965 15.0573738,67.6622454 15.1838316,66.0287479 C15.2017691,65.7970433 15.21683,65.561992 15.2283048,65.3228731 C15.0601712,65.1741519 14.8932645,65.0238038 14.727607,64.8718496 C7.75040024,58.4718025 3.42105263,49.6187586 3.42105263,39.8304382 C3.42105263,30.0648871 7.7302816,21.230243 14.6782925,14.8327858 C21.6705272,8.39460913 31.3324819,4.42105263 42,4.42105263 Z" id="Combined-Shape-Copy-2" stroke="url(#linearGradient-2)" stroke-width="2.84210526" fill="url(#linearGradient-1)"></path>
|
||||||
|
<path d="M9.68078613,24.6137047 C9.8721537,24.8136848 10.1894036,24.8206666 10.3893837,24.629299 C10.3964827,24.6225057 10.4033805,24.6155051 10.410082,24.6083194 C20.5178445,13.7276637 31.3141669,8.50123177 42.7990494,8.92902374 C54.2584365,9.35586606 64.9235425,15.3681505 74.7943671,26.9658769 C75.0309355,27.243826 75.4426222,27.2904538 75.7353592,27.0724506 C76.0315877,26.8518473 76.1075038,26.440096 75.9094038,26.1283693 C67.7821181,13.3374534 56.7453333,6.69089625 42.7990494,6.18869781 C28.8220513,5.68539338 17.7581791,11.5492352 9.60743269,23.7802233 C9.4336795,24.0409463 9.46416665,24.3873362 9.68078613,24.6137047 Z" id="Path-22" fill="#F5BDFF" opacity="0.37491644"></path>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 2.7 KiB |
18
Telegram/Resources/art/topic_icons/yellow.svg
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="84px" height="84px" viewBox="0 0 84 84" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<title>topic yellow</title>
|
||||||
|
<defs>
|
||||||
|
<linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="linearGradient-1">
|
||||||
|
<stop stop-color="#FFDB5C" offset="0%"></stop>
|
||||||
|
<stop stop-color="#EA5800" offset="100%"></stop>
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient x1="50%" y1="0%" x2="50%" y2="99.0141482%" id="linearGradient-2">
|
||||||
|
<stop stop-color="#F2A807" offset="0%"></stop>
|
||||||
|
<stop stop-color="#D93A00" offset="100%"></stop>
|
||||||
|
</linearGradient>
|
||||||
|
</defs>
|
||||||
|
<g id="topic-yellow" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||||
|
<path d="M42,4.42105263 C52.6675181,4.42105263 62.3294728,8.39460913 69.3217075,14.8327858 C76.2697184,21.230243 80.5789474,30.0648871 80.5789474,39.8304382 C80.5789474,49.5959894 76.2697184,58.4306335 69.3217075,64.8280906 C62.3294728,71.2662674 52.6675181,75.2398239 42,75.2398239 C37.5210466,75.2398239 33.2197662,74.5394876 29.2186919,73.2502137 C29.0098956,73.1829329 28.8013719,73.1138726 28.5929684,73.0432995 C28.4083865,73.1602808 28.2206704,73.2783974 28.0298198,73.3976517 C26.2065565,74.5369301 24.6020235,75.4646079 23.2143446,76.1800123 C19.9826132,77.8461004 15.8972513,78.9467661 10.9744394,79.5096334 L10.3380323,79.5793501 C12.3422829,75.5502987 13.657562,72.8305079 14.1788292,71.2323391 C14.7640488,69.4380965 15.0573738,67.6622454 15.1838316,66.0287479 C15.2017691,65.7970433 15.21683,65.561992 15.2283048,65.3228731 C15.0601712,65.1741519 14.8932645,65.0238038 14.727607,64.8718496 C7.75040024,58.4718025 3.42105263,49.6187586 3.42105263,39.8304382 C3.42105263,30.0648871 7.7302816,21.230243 14.6782925,14.8327858 C21.6705272,8.39460913 31.3324819,4.42105263 42,4.42105263 Z" id="Combined-Shape-Copy-2" stroke="url(#linearGradient-2)" stroke-width="2.84210526" fill="url(#linearGradient-1)"></path>
|
||||||
|
<path d="M9.68078613,24.6137047 C9.8721537,24.8136848 10.1894036,24.8206666 10.3893837,24.629299 C10.3964827,24.6225057 10.4033805,24.6155051 10.410082,24.6083194 C20.5178445,13.7276637 31.3141669,8.50123177 42.7990494,8.92902374 C54.2584365,9.35586606 64.9235425,15.3681505 74.7943671,26.9658769 C75.0309355,27.243826 75.4426222,27.2904538 75.7353592,27.0724506 C76.0315877,26.8518473 76.1075038,26.440096 75.9094038,26.1283693 C67.7821181,13.3374534 56.7453333,6.69089625 42.7990494,6.18869781 C28.8220513,5.68539338 17.7581791,11.5492352 9.60743269,23.7802233 C9.4336795,24.0409463 9.46416665,24.3873362 9.68078613,24.6137047 Z" id="Path-22" fill="#F9FF71" opacity="0.37491644"></path>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 2.7 KiB |
|
@ -28,6 +28,13 @@
|
||||||
<file alias="icons/settings/dino.svg">../../icons/settings/dino.svg</file>
|
<file alias="icons/settings/dino.svg">../../icons/settings/dino.svg</file>
|
||||||
<file alias="icons/settings/star.svg">../../icons/settings/star.svg</file>
|
<file alias="icons/settings/star.svg">../../icons/settings/star.svg</file>
|
||||||
<file alias="icons/settings/starmini.svg">../../icons/settings/starmini.svg</file>
|
<file alias="icons/settings/starmini.svg">../../icons/settings/starmini.svg</file>
|
||||||
|
<file alias="topic_icons/blue.svg">../../art/topic_icons/blue.svg</file>
|
||||||
|
<file alias="topic_icons/yellow.svg">../../art/topic_icons/yellow.svg</file>
|
||||||
|
<file alias="topic_icons/violet.svg">../../art/topic_icons/violet.svg</file>
|
||||||
|
<file alias="topic_icons/green.svg">../../art/topic_icons/green.svg</file>
|
||||||
|
<file alias="topic_icons/rose.svg">../../art/topic_icons/rose.svg</file>
|
||||||
|
<file alias="topic_icons/red.svg">../../art/topic_icons/red.svg</file>
|
||||||
|
<file alias="topic_icons/gray.svg">../../art/topic_icons/gray.svg</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
<qresource prefix="/icons">
|
<qresource prefix="/icons">
|
||||||
<file alias="calls/hands.lottie">../../icons/calls/hands.lottie</file>
|
<file alias="calls/hands.lottie">../../icons/calls/hands.lottie</file>
|
||||||
|
|
|
@ -192,9 +192,8 @@ messageActionChatJoinedByRequest#ebbca3cb = MessageAction;
|
||||||
messageActionWebViewDataSentMe#47dd8079 text:string data:string = MessageAction;
|
messageActionWebViewDataSentMe#47dd8079 text:string data:string = MessageAction;
|
||||||
messageActionWebViewDataSent#b4c38cb5 text:string = MessageAction;
|
messageActionWebViewDataSent#b4c38cb5 text:string = MessageAction;
|
||||||
messageActionGiftPremium#aba0f5c6 currency:string amount:long months:int = MessageAction;
|
messageActionGiftPremium#aba0f5c6 currency:string amount:long months:int = MessageAction;
|
||||||
messageActionTopicCreate#6fa796ac flags:# title:string icon_emoji_id:flags.0?long = MessageAction;
|
messageActionTopicCreate#d999256 flags:# title:string icon_color:int icon_emoji_id:flags.0?long = MessageAction;
|
||||||
messageActionTopicEditTitle#ce0b23cd title:string = MessageAction;
|
messageActionTopicEdit#b117a9f5 flags:# title:flags.0?string icon_emoji_id:flags.1?long = MessageAction;
|
||||||
messageActionTopicEditIcon#820a6e2b emoji_document_id:long = MessageAction;
|
|
||||||
|
|
||||||
dialog#a8edd0f5 flags:# pinned:flags.2?true unread_mark:flags.3?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int unread_reactions_count:int notify_settings:PeerNotifySettings pts:flags.0?int draft:flags.1?DraftMessage folder_id:flags.4?int = Dialog;
|
dialog#a8edd0f5 flags:# pinned:flags.2?true unread_mark:flags.3?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int unread_reactions_count:int notify_settings:PeerNotifySettings pts:flags.0?int draft:flags.1?DraftMessage folder_id:flags.4?int = Dialog;
|
||||||
dialogFolder#71bd134c flags:# pinned:flags.2?true folder:Folder peer:Peer top_message:int unread_muted_peers_count:int unread_unmuted_peers_count:int unread_muted_messages_count:int unread_unmuted_messages_count:int = Dialog;
|
dialogFolder#71bd134c flags:# pinned:flags.2?true folder:Folder peer:Peer top_message:int unread_muted_peers_count:int unread_unmuted_peers_count:int unread_muted_messages_count:int unread_unmuted_messages_count:int = Dialog;
|
||||||
|
@ -1455,7 +1454,7 @@ stickerKeyword#fcfeb29c document_id:long keyword:Vector<string> = StickerKeyword
|
||||||
|
|
||||||
username#b4073647 flags:# editable:flags.0?true active:flags.1?true username:string = Username;
|
username#b4073647 flags:# editable:flags.0?true active:flags.1?true username:string = Username;
|
||||||
|
|
||||||
forumTopic#2f3e1a06 flags:# id:int date:int title:string icon_emoji_id:flags.0?long top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int unread_reactions_count:int = ForumTopic;
|
forumTopic#18a9a864 flags:# my:flags.1?true id:int date:int title:string icon_color:int icon_emoji_id:flags.0?long top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int unread_reactions_count:int from_id:Peer = ForumTopic;
|
||||||
|
|
||||||
messages.forumTopics#367617d3 flags:# order_by_create_date:flags.0?true count:int topics:Vector<ForumTopic> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> pts:int = messages.ForumTopics;
|
messages.forumTopics#367617d3 flags:# order_by_create_date:flags.0?true count:int topics:Vector<ForumTopic> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> pts:int = messages.ForumTopics;
|
||||||
|
|
||||||
|
@ -1862,11 +1861,10 @@ channels.toggleJoinRequest#4c2985b6 channel:InputChannel enabled:Bool = Updates;
|
||||||
channels.reorderUsernames#b45ced1d channel:InputChannel order:Vector<string> = Bool;
|
channels.reorderUsernames#b45ced1d channel:InputChannel order:Vector<string> = Bool;
|
||||||
channels.toggleUsername#50f24105 channel:InputChannel username:string active:Bool = Bool;
|
channels.toggleUsername#50f24105 channel:InputChannel username:string active:Bool = Bool;
|
||||||
channels.toggleForum#a4298b29 channel:InputChannel enabled:Bool = Updates;
|
channels.toggleForum#a4298b29 channel:InputChannel enabled:Bool = Updates;
|
||||||
channels.createForumTopic#60bf3bc9 flags:# channel:InputChannel title:string icon_emoji_id:flags.3?long random_id:long send_as:flags.2?InputPeer = Updates;
|
channels.createForumTopic#f40c0224 flags:# channel:InputChannel title:string icon_color:flags.0?int icon_emoji_id:flags.3?long random_id:long send_as:flags.2?InputPeer = Updates;
|
||||||
channels.getForumTopics#de560d1 flags:# channel:InputChannel q:flags.0?string offset_date:int offset_id:int offset_topic:int limit:int = messages.ForumTopics;
|
channels.getForumTopics#de560d1 flags:# channel:InputChannel q:flags.0?string offset_date:int offset_id:int offset_topic:int limit:int = messages.ForumTopics;
|
||||||
channels.getForumTopicsByID#b0831eb9 channel:InputChannel topics:Vector<int> = messages.ForumTopics;
|
channels.getForumTopicsByID#b0831eb9 channel:InputChannel topics:Vector<int> = messages.ForumTopics;
|
||||||
channels.editForumTitle#8881b9b1 channel:InputChannel topic_id:int title:string = Updates;
|
channels.editForumTopic#8a7f464b flags:# channel:InputChannel topic_id:int title:flags.0?string icon_emoji_id:flags.1?long = Updates;
|
||||||
channels.editForumIcon#55cea2dd channel:InputChannel topic_id:int emoji_document_id:long = Updates;
|
|
||||||
|
|
||||||
bots.sendCustomRequest#aa2769ed custom_method:string params:DataJSON = DataJSON;
|
bots.sendCustomRequest#aa2769ed custom_method:string params:DataJSON = DataJSON;
|
||||||
bots.answerWebhookJSONQuery#e6213f4d query_id:long data:DataJSON = Bool;
|
bots.answerWebhookJSONQuery#e6213f4d query_id:long data:DataJSON = Bool;
|
||||||
|
|
|
@ -9,11 +9,13 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
|
|
||||||
#include "ui/widgets/input_fields.h"
|
#include "ui/widgets/input_fields.h"
|
||||||
#include "ui/abstract_button.h"
|
#include "ui/abstract_button.h"
|
||||||
|
#include "ui/color_int_conversion.h"
|
||||||
#include "data/data_channel.h"
|
#include "data/data_channel.h"
|
||||||
#include "data/data_forum.h"
|
#include "data/data_forum.h"
|
||||||
#include "data/data_forum_topic.h"
|
#include "data/data_forum_topic.h"
|
||||||
#include "data/data_session.h"
|
#include "data/data_session.h"
|
||||||
#include "data/stickers/data_custom_emoji.h"
|
#include "data/stickers/data_custom_emoji.h"
|
||||||
|
#include "base/random.h"
|
||||||
#include "main/main_session.h"
|
#include "main/main_session.h"
|
||||||
#include "history/history.h"
|
#include "history/history.h"
|
||||||
#include "history/view/history_view_replies_section.h"
|
#include "history/view/history_view_replies_section.h"
|
||||||
|
@ -22,7 +24,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "window/window_session_controller.h"
|
#include "window/window_session_controller.h"
|
||||||
#include "settings/settings_common.h"
|
#include "settings/settings_common.h"
|
||||||
#include "apiwrap.h"
|
#include "apiwrap.h"
|
||||||
#include "styles/style_chat_helpers.h"
|
#include "styles/style_dialogs.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
@ -34,34 +36,39 @@ namespace {
|
||||||
[[nodiscard]] rpl::producer<DocumentId> EditIconButton(
|
[[nodiscard]] rpl::producer<DocumentId> EditIconButton(
|
||||||
not_null<Window::SessionController*> controller,
|
not_null<Window::SessionController*> controller,
|
||||||
not_null<QWidget*> parent,
|
not_null<QWidget*> parent,
|
||||||
DocumentId id) {
|
int32 colorId,
|
||||||
|
DocumentId iconId) {
|
||||||
using namespace Info::Profile;
|
using namespace Info::Profile;
|
||||||
struct State {
|
struct State {
|
||||||
rpl::variable<DocumentId> id;
|
rpl::variable<DocumentId> iconId;
|
||||||
EmojiStatusPanel panel;
|
EmojiStatusPanel panel;
|
||||||
std::unique_ptr<Ui::Text::CustomEmoji> chosen;
|
std::unique_ptr<Ui::Text::CustomEmoji> chosen;
|
||||||
|
QImage empty;
|
||||||
};
|
};
|
||||||
const auto tag = Data::CustomEmojiManager::SizeTag::Large;
|
const auto tag = Data::CustomEmojiManager::SizeTag::Large;
|
||||||
const auto size = EditIconSize();
|
const auto size = EditIconSize();
|
||||||
const auto result = Ui::CreateChild<Ui::AbstractButton>(parent.get());
|
const auto result = Ui::CreateChild<Ui::AbstractButton>(parent.get());
|
||||||
const auto state = result->lifetime().make_state<State>();
|
const auto state = result->lifetime().make_state<State>();
|
||||||
state->id.value(
|
state->empty = Data::ForumTopicIconBackground(
|
||||||
) | rpl::start_with_next([=](DocumentId id) {
|
colorId,
|
||||||
|
st::largeForumTopicIcon.size);
|
||||||
|
state->iconId.value(
|
||||||
|
) | rpl::start_with_next([=](DocumentId iconId) {
|
||||||
const auto owner = &controller->session().data();
|
const auto owner = &controller->session().data();
|
||||||
state->chosen = id
|
state->chosen = iconId
|
||||||
? owner->customEmojiManager().create(
|
? owner->customEmojiManager().create(
|
||||||
id,
|
iconId,
|
||||||
[=] { result->update(); },
|
[=] { result->update(); },
|
||||||
tag)
|
tag)
|
||||||
: nullptr;
|
: nullptr;
|
||||||
result->update();
|
result->update();
|
||||||
}, result->lifetime());
|
}, result->lifetime());
|
||||||
state->id = id;
|
state->iconId = iconId;
|
||||||
state->panel.setChooseFilter([=](DocumentId) {
|
state->panel.setChooseFilter([=](DocumentId) {
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
state->panel.setChooseCallback([=](DocumentId id) {
|
state->panel.setChooseCallback([=](DocumentId id) {
|
||||||
state->id = id;
|
state->iconId = id;
|
||||||
});
|
});
|
||||||
result->resize(size, size);
|
result->resize(size, size);
|
||||||
result->paintRequest(
|
result->paintRequest(
|
||||||
|
@ -78,14 +85,14 @@ namespace {
|
||||||
if (state->chosen) {
|
if (state->chosen) {
|
||||||
state->chosen->paint(p, args);
|
state->chosen->paint(p, args);
|
||||||
} else {
|
} else {
|
||||||
// #TODO forum
|
const auto skip = (size - st::largeForumTopicIcon.size) / 2;
|
||||||
st::stickersPremium.paint(p, 0, 0, result->width());
|
p.drawImage(skip, skip, state->empty);
|
||||||
}
|
}
|
||||||
}, result->lifetime());
|
}, result->lifetime());
|
||||||
result->setClickedCallback([=] {
|
result->setClickedCallback([=] {
|
||||||
state->panel.show(controller, result, tag);
|
state->panel.show(controller, result, tag);
|
||||||
});
|
});
|
||||||
return state->id.value();
|
return state->iconId.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -110,11 +117,16 @@ void EditForumTopicBox(
|
||||||
box->setTitle(rpl::single(creating ? u"New topic"_q : u"Edit topic"_q));
|
box->setTitle(rpl::single(creating ? u"New topic"_q : u"Edit topic"_q));
|
||||||
|
|
||||||
struct State {
|
struct State {
|
||||||
|
int32 colorId = 0;
|
||||||
DocumentId iconId = 0;
|
DocumentId iconId = 0;
|
||||||
mtpRequestId titleRequestId = 0;
|
mtpRequestId requestId = 0;
|
||||||
mtpRequestId iconRequestId = 0;
|
|
||||||
};
|
};
|
||||||
const auto state = box->lifetime().make_state<State>();
|
const auto state = box->lifetime().make_state<State>();
|
||||||
|
const auto &colors = Data::ForumTopicColorIds();
|
||||||
|
state->iconId = topic ? topic->iconId() : 0;
|
||||||
|
state->colorId = topic
|
||||||
|
? topic->colorId()
|
||||||
|
: colors[base::RandomIndex(colors.size())];
|
||||||
// #TODO forum lang and design
|
// #TODO forum lang and design
|
||||||
Settings::AddSubsectionTitle(
|
Settings::AddSubsectionTitle(
|
||||||
box->verticalLayout(),
|
box->verticalLayout(),
|
||||||
|
@ -124,7 +136,8 @@ void EditForumTopicBox(
|
||||||
EditIconButton(
|
EditIconButton(
|
||||||
controller,
|
controller,
|
||||||
badgeWrap,
|
badgeWrap,
|
||||||
topic ? topic->iconId() : 0
|
state->colorId,
|
||||||
|
state->iconId
|
||||||
) | rpl::start_with_next([=](DocumentId id) {
|
) | rpl::start_with_next([=](DocumentId id) {
|
||||||
state->iconId = id;
|
state->iconId = id;
|
||||||
}, box->lifetime());
|
}, box->lifetime());
|
||||||
|
@ -154,6 +167,7 @@ void EditForumTopicBox(
|
||||||
forum,
|
forum,
|
||||||
channel->forum()->reserveCreatingId(
|
channel->forum()->reserveCreatingId(
|
||||||
title->getLastText().trimmed(),
|
title->getLastText().trimmed(),
|
||||||
|
state->colorId,
|
||||||
state->iconId)),
|
state->iconId)),
|
||||||
Window::SectionShow::Way::ClearStack);
|
Window::SectionShow::Way::ClearStack);
|
||||||
};
|
};
|
||||||
|
@ -166,59 +180,32 @@ void EditForumTopicBox(
|
||||||
if (!topic) {
|
if (!topic) {
|
||||||
box->closeBox();
|
box->closeBox();
|
||||||
return;
|
return;
|
||||||
}
|
} else if (state->requestId > 0) {
|
||||||
const auto api = &forum->session().api();
|
return;
|
||||||
if (state->titleRequestId <= 0) {
|
} else if (title->getLastText().trimmed().isEmpty()) {
|
||||||
if (title->getLastText().trimmed().isEmpty()) {
|
title->showError();
|
||||||
title->showError();
|
return;
|
||||||
return;
|
} else if (parent->creating(rootId)) {
|
||||||
} else if (parent->creating(rootId)) {
|
topic->applyTitle(title->getLastText().trimmed());
|
||||||
topic->applyTitle(title->getLastText().trimmed());
|
topic->applyColorId(state->colorId);
|
||||||
} else {
|
|
||||||
const auto done = [=] {
|
|
||||||
state->titleRequestId = 0;
|
|
||||||
if (!state->iconRequestId) {
|
|
||||||
box->closeBox();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
state->titleRequestId = api->request(MTPchannels_EditForumTitle(
|
|
||||||
topic->channel()->inputChannel,
|
|
||||||
MTP_int(rootId),
|
|
||||||
MTP_string(title->getLastText().trimmed())
|
|
||||||
)).done([=](const MTPUpdates &result) {
|
|
||||||
api->applyUpdates(result);
|
|
||||||
done();
|
|
||||||
}).fail([=](const MTP::Error &error) {
|
|
||||||
if (error.type() == u"TOPIC_NOT_MODIFIED") {
|
|
||||||
done();
|
|
||||||
} else {
|
|
||||||
state->titleRequestId = -1;
|
|
||||||
}
|
|
||||||
}).send();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (parent->creating(rootId)) {
|
|
||||||
topic->applyIconId(state->iconId);
|
topic->applyIconId(state->iconId);
|
||||||
box->closeBox();
|
} else {
|
||||||
} else if (state->iconRequestId <= 0) {
|
using Flag = MTPchannels_EditForumTopic::Flag;
|
||||||
const auto done = [=] {
|
const auto api = &forum->session().api();
|
||||||
state->iconRequestId = 0;
|
state->requestId = api->request(MTPchannels_EditForumTopic(
|
||||||
if (!state->titleRequestId) {
|
MTP_flags(Flag::f_title | Flag::f_icon_emoji_id),
|
||||||
box->closeBox();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
state->iconRequestId = api->request(MTPchannels_EditForumIcon(
|
|
||||||
topic->channel()->inputChannel,
|
topic->channel()->inputChannel,
|
||||||
MTP_int(rootId),
|
MTP_int(rootId),
|
||||||
|
MTP_string(title->getLastText().trimmed()),
|
||||||
MTP_long(state->iconId)
|
MTP_long(state->iconId)
|
||||||
)).done([=](const MTPUpdates &result) {
|
)).done([=](const MTPUpdates &result) {
|
||||||
api->applyUpdates(result);
|
api->applyUpdates(result);
|
||||||
done();
|
box->closeBox();
|
||||||
}).fail([=](const MTP::Error &error) {
|
}).fail([=](const MTP::Error &error) {
|
||||||
if (error.type() == u"TOPIC_NOT_MODIFIED") {
|
if (error.type() == u"TOPIC_NOT_MODIFIED") {
|
||||||
done();
|
box->closeBox();
|
||||||
} else {
|
} else {
|
||||||
state->iconRequestId = -1;
|
state->requestId = -1;
|
||||||
}
|
}
|
||||||
}).send();
|
}).send();
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,7 @@ CloudTheme CloudTheme::Parse(
|
||||||
settings.match([&](const MTPDthemeSettings &data) {
|
settings.match([&](const MTPDthemeSettings &data) {
|
||||||
if (const auto colors = data.vmessage_colors()) {
|
if (const auto colors = data.vmessage_colors()) {
|
||||||
for (const auto &color : colors->v) {
|
for (const auto &color : colors->v) {
|
||||||
result.push_back(ColorFromSerialized(color));
|
result.push_back(Ui::ColorFromSerialized(color));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -57,12 +57,12 @@ CloudTheme CloudTheme::Parse(
|
||||||
};
|
};
|
||||||
const auto accentColor = [&](const MTPThemeSettings &settings) {
|
const auto accentColor = [&](const MTPThemeSettings &settings) {
|
||||||
return settings.match([&](const MTPDthemeSettings &data) {
|
return settings.match([&](const MTPDthemeSettings &data) {
|
||||||
return ColorFromSerialized(data.vaccent_color().v);
|
return Ui::ColorFromSerialized(data.vaccent_color());
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const auto outgoingAccentColor = [&](const MTPThemeSettings &settings) {
|
const auto outgoingAccentColor = [&](const MTPThemeSettings &settings) {
|
||||||
return settings.match([&](const MTPDthemeSettings &data) {
|
return settings.match([&](const MTPDthemeSettings &data) {
|
||||||
return MaybeColorFromSerialized(data.voutbox_accent_color());
|
return Ui::MaybeColorFromSerialized(data.voutbox_accent_color());
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const auto basedOnDark = [&](const MTPThemeSettings &settings) {
|
const auto basedOnDark = [&](const MTPThemeSettings &settings) {
|
||||||
|
|
|
@ -26,6 +26,7 @@ namespace {
|
||||||
|
|
||||||
constexpr auto kTopicsFirstLoad = 20;
|
constexpr auto kTopicsFirstLoad = 20;
|
||||||
constexpr auto kTopicsPerPage = 500;
|
constexpr auto kTopicsPerPage = 500;
|
||||||
|
constexpr auto kGeneralColorId = 0xA9A9A9;
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
@ -123,6 +124,7 @@ void Forum::applyReceivedTopics(
|
||||||
void Forum::applyTopicAdded(
|
void Forum::applyTopicAdded(
|
||||||
MsgId rootId,
|
MsgId rootId,
|
||||||
const QString &title,
|
const QString &title,
|
||||||
|
int32 colorId,
|
||||||
DocumentId iconId) {
|
DocumentId iconId) {
|
||||||
const auto i = _topics.find(rootId);
|
const auto i = _topics.find(rootId);
|
||||||
const auto raw = (i != end(_topics))
|
const auto raw = (i != end(_topics))
|
||||||
|
@ -132,6 +134,7 @@ void Forum::applyTopicAdded(
|
||||||
std::make_unique<ForumTopic>(_history, rootId)
|
std::make_unique<ForumTopic>(_history, rootId)
|
||||||
).first->second.get();
|
).first->second.get();
|
||||||
raw->applyTitle(title);
|
raw->applyTitle(title);
|
||||||
|
raw->applyColorId(colorId);
|
||||||
raw->applyIconId(iconId);
|
raw->applyIconId(iconId);
|
||||||
if (!creating(rootId)) {
|
if (!creating(rootId)) {
|
||||||
raw->addToChatList(FilterId(), topicsList());
|
raw->addToChatList(FilterId(), topicsList());
|
||||||
|
@ -147,10 +150,11 @@ void Forum::applyTopicRemoved(MsgId rootId) {
|
||||||
|
|
||||||
MsgId Forum::reserveCreatingId(
|
MsgId Forum::reserveCreatingId(
|
||||||
const QString &title,
|
const QString &title,
|
||||||
|
int32 colorId,
|
||||||
DocumentId iconId) {
|
DocumentId iconId) {
|
||||||
const auto result = _history->owner().nextLocalMessageId();
|
const auto result = _history->owner().nextLocalMessageId();
|
||||||
_creatingRootIds.emplace(result);
|
_creatingRootIds.emplace(result);
|
||||||
applyTopicAdded(result, title, iconId);
|
applyTopicAdded(result, title, colorId, iconId);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -200,7 +204,7 @@ ForumTopic *Forum::topicFor(MsgId rootId) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// #TODO forum lang
|
// #TODO forum lang
|
||||||
applyTopicAdded(rootId, "General! Created.", DocumentId(0));
|
applyTopicAdded(rootId, "General! Created.", kGeneralColorId, 0);
|
||||||
return _topics.find(rootId)->second.get();
|
return _topics.find(rootId)->second.get();
|
||||||
}
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
|
@ -34,6 +34,7 @@ public:
|
||||||
void applyTopicAdded(
|
void applyTopicAdded(
|
||||||
MsgId rootId,
|
MsgId rootId,
|
||||||
const QString &title,
|
const QString &title,
|
||||||
|
int32 colorId,
|
||||||
DocumentId iconId);
|
DocumentId iconId);
|
||||||
void applyTopicRemoved(MsgId rootId);
|
void applyTopicRemoved(MsgId rootId);
|
||||||
void applyTopicCreated(MsgId rootId, MsgId realId);
|
void applyTopicCreated(MsgId rootId, MsgId realId);
|
||||||
|
@ -44,6 +45,7 @@ public:
|
||||||
|
|
||||||
[[nodiscard]] MsgId reserveCreatingId(
|
[[nodiscard]] MsgId reserveCreatingId(
|
||||||
const QString &title,
|
const QString &title,
|
||||||
|
int32 colorId,
|
||||||
DocumentId iconId);
|
DocumentId iconId);
|
||||||
void discardCreatingId(MsgId rootId);
|
void discardCreatingId(MsgId rootId);
|
||||||
[[nodiscard]] bool creating(MsgId rootId) const;
|
[[nodiscard]] bool creating(MsgId rootId) const;
|
||||||
|
|
|
@ -18,11 +18,110 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "history/history.h"
|
#include "history/history.h"
|
||||||
#include "history/history_item.h"
|
#include "history/history_item.h"
|
||||||
#include "ui/painter.h"
|
#include "ui/painter.h"
|
||||||
|
#include "ui/color_int_conversion.h"
|
||||||
#include "styles/style_dialogs.h"
|
#include "styles/style_dialogs.h"
|
||||||
#include "styles/style_chat_helpers.h"
|
#include "styles/style_chat_helpers.h"
|
||||||
|
|
||||||
|
#include <QtSvg/QSvgRenderer>
|
||||||
|
|
||||||
namespace Data {
|
namespace Data {
|
||||||
|
|
||||||
|
const base::flat_map<int32, QString> &ForumTopicIcons() {
|
||||||
|
static const auto Result = base::flat_map<int32, QString>{
|
||||||
|
{ 0x6FB9F0, u"blue"_q },
|
||||||
|
{ 0xFFD67E, u"yellow"_q },
|
||||||
|
{ 0xCB86DB, u"violet"_q },
|
||||||
|
{ 0x8EEE98, u"green"_q },
|
||||||
|
{ 0xFF93B2, u"rose"_q },
|
||||||
|
{ 0xFB6F5F, u"red"_q },
|
||||||
|
};
|
||||||
|
return Result;
|
||||||
|
}
|
||||||
|
|
||||||
|
const std::vector<int32> &ForumTopicColorIds() {
|
||||||
|
static const auto Result = ForumTopicIcons(
|
||||||
|
) | ranges::views::transform([](const auto &pair) {
|
||||||
|
return pair.first;
|
||||||
|
}) | ranges::to_vector;
|
||||||
|
return Result;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QString &ForumTopicDefaultIcon() {
|
||||||
|
static const auto Result = u"gray"_q;
|
||||||
|
return Result;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QString &ForumTopicIcon(int32 colorId) {
|
||||||
|
const auto &icons = ForumTopicIcons();
|
||||||
|
const auto i = icons.find(colorId);
|
||||||
|
return (i != end(icons)) ? i->second : ForumTopicDefaultIcon();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString ForumTopicIconPath(const QString &name) {
|
||||||
|
return u":/gui/topic_icons/%1.svg"_q.arg(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
QImage ForumTopicIconBackground(int32 colorId, int size) {
|
||||||
|
const auto ratio = style::DevicePixelRatio();
|
||||||
|
auto svg = QSvgRenderer(ForumTopicIconPath(ForumTopicIcon(colorId)));
|
||||||
|
auto result = QImage(
|
||||||
|
QSize(size, size) * ratio,
|
||||||
|
QImage::Format_ARGB32_Premultiplied);
|
||||||
|
result.setDevicePixelRatio(ratio);
|
||||||
|
result.fill(Qt::transparent);
|
||||||
|
|
||||||
|
auto p = QPainter(&result);
|
||||||
|
svg.render(&p, QRect(0, 0, size, size));
|
||||||
|
p.end();
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString ExtractNonEmojiLetter(const QString &title) {
|
||||||
|
const auto begin = title.data();
|
||||||
|
const auto end = begin + title.size();
|
||||||
|
for (auto ch = begin; ch != end;) {
|
||||||
|
auto length = 0;
|
||||||
|
if (Ui::Emoji::Find(ch, end, &length)) {
|
||||||
|
ch += length;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
uint ucs4 = ch->unicode();
|
||||||
|
length = 1;
|
||||||
|
if (QChar::isHighSurrogate(ucs4) && ch + 1 != end) {
|
||||||
|
ushort low = ch[1].unicode();
|
||||||
|
if (QChar::isLowSurrogate(low)) {
|
||||||
|
ucs4 = QChar::surrogateToUcs4(ucs4, low);
|
||||||
|
length = 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!QChar::isLetterOrNumber(ucs4)) {
|
||||||
|
ch += length;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
return QString(ch, length);
|
||||||
|
}
|
||||||
|
return QString();
|
||||||
|
}
|
||||||
|
|
||||||
|
QImage ForumTopicIconFrame(
|
||||||
|
int32 colorId,
|
||||||
|
const QString &title,
|
||||||
|
const style::ForumTopicIcon &st) {
|
||||||
|
auto background = ForumTopicIconBackground(colorId, st.size);
|
||||||
|
|
||||||
|
if (const auto one = ExtractNonEmojiLetter(title); !one.isEmpty()) {
|
||||||
|
auto p = QPainter(&background);
|
||||||
|
p.setPen(Qt::white);
|
||||||
|
p.drawText(
|
||||||
|
QRect(0, st.textTop, st.size, st.font->height * 2),
|
||||||
|
one,
|
||||||
|
style::al_top);
|
||||||
|
}
|
||||||
|
|
||||||
|
return background;
|
||||||
|
}
|
||||||
|
|
||||||
ForumTopic::ForumTopic(not_null<History*> history, MsgId rootId)
|
ForumTopic::ForumTopic(not_null<History*> history, MsgId rootId)
|
||||||
: Entry(&history->owner(), Type::ForumTopic)
|
: Entry(&history->owner(), Type::ForumTopic)
|
||||||
, _history(history)
|
, _history(history)
|
||||||
|
@ -62,6 +161,7 @@ void ForumTopic::applyTopic(const MTPForumTopic &topic) {
|
||||||
} else {
|
} else {
|
||||||
applyIconId(0);
|
applyIconId(0);
|
||||||
}
|
}
|
||||||
|
applyColorId(data.vicon_color().v);
|
||||||
|
|
||||||
const auto pinned = _list->pinned();
|
const auto pinned = _list->pinned();
|
||||||
#if 0 // #TODO forum pinned
|
#if 0 // #TODO forum pinned
|
||||||
|
@ -218,19 +318,29 @@ void ForumTopic::paintUserpic(
|
||||||
std::shared_ptr<Data::CloudImageView> &view,
|
std::shared_ptr<Data::CloudImageView> &view,
|
||||||
const Dialogs::Ui::PaintContext &context) const {
|
const Dialogs::Ui::PaintContext &context) const {
|
||||||
const auto &st = context.st;
|
const auto &st = context.st;
|
||||||
|
const auto position = QPoint(st->padding.left(), st->padding.top());
|
||||||
if (_icon) {
|
if (_icon) {
|
||||||
_icon->paint(p, {
|
_icon->paint(p, {
|
||||||
.preview = st::windowBgOver->c,
|
.preview = st::windowBgOver->c,
|
||||||
.now = context.now,
|
.now = context.now,
|
||||||
.position = QPoint(st->padding.left(), st->padding.top()),
|
.position = position,
|
||||||
.paused = context.paused,
|
.paused = context.paused,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// #TODO forum
|
validateDefaultIcon();
|
||||||
st::stickersPremium.paint(
|
const auto size = st::defaultForumTopicIcon.size;
|
||||||
p,
|
const auto esize = st::emojiSize;
|
||||||
QPoint(st->padding.left(), st->padding.top()),
|
const auto shift = (esize - size) / 2;
|
||||||
st->padding.left() * 2 + st::stickersPremium.width());
|
p.drawImage(position + QPoint(shift, shift), _defaultIcon);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ForumTopic::validateDefaultIcon() const {
|
||||||
|
if (_defaultIcon.isNull()) {
|
||||||
|
_defaultIcon = ForumTopicIconFrame(
|
||||||
|
_colorId,
|
||||||
|
_title,
|
||||||
|
st::defaultForumTopicIcon);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -291,6 +401,7 @@ void ForumTopic::applyTitle(const QString &title) {
|
||||||
}
|
}
|
||||||
_title = isGeneral() ? "General! Topic." : title; // #TODO forum lang
|
_title = isGeneral() ? "General! Topic." : title; // #TODO forum lang
|
||||||
++_titleVersion;
|
++_titleVersion;
|
||||||
|
_defaultIcon = QImage();
|
||||||
indexTitleParts();
|
indexTitleParts();
|
||||||
updateChatListEntry();
|
updateChatListEntry();
|
||||||
}
|
}
|
||||||
|
@ -308,10 +419,21 @@ void ForumTopic::applyIconId(DocumentId iconId) {
|
||||||
[=] { updateChatListEntry(); },
|
[=] { updateChatListEntry(); },
|
||||||
Data::CustomEmojiManager::SizeTag::Normal)
|
Data::CustomEmojiManager::SizeTag::Normal)
|
||||||
: nullptr;
|
: nullptr;
|
||||||
|
if (iconId) {
|
||||||
|
_defaultIcon = QImage();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
updateChatListEntry();
|
updateChatListEntry();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int32 ForumTopic::colorId() const {
|
||||||
|
return _colorId;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ForumTopic::applyColorId(int32 colorId) {
|
||||||
|
_colorId = colorId;
|
||||||
|
}
|
||||||
|
|
||||||
void ForumTopic::applyItemAdded(not_null<HistoryItem*> item) {
|
void ForumTopic::applyItemAdded(not_null<HistoryItem*> item) {
|
||||||
setLastMessage(item);
|
setLastMessage(item);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
|
|
||||||
class ChannelData;
|
class ChannelData;
|
||||||
|
|
||||||
|
namespace style {
|
||||||
|
struct ForumTopicIcon;
|
||||||
|
} // namespace style
|
||||||
|
|
||||||
namespace Dialogs {
|
namespace Dialogs {
|
||||||
class MainList;
|
class MainList;
|
||||||
} // namespace Dialogs
|
} // namespace Dialogs
|
||||||
|
@ -25,6 +29,16 @@ namespace Data {
|
||||||
class Session;
|
class Session;
|
||||||
class Forum;
|
class Forum;
|
||||||
|
|
||||||
|
[[nodiscard]] const base::flat_map<int32, QString> &ForumTopicIcons();
|
||||||
|
[[nodiscard]] const std::vector<int32> &ForumTopicColorIds();
|
||||||
|
[[nodiscard]] const QString &ForumTopicIcon(int32 colorId);
|
||||||
|
[[nodiscard]] QString ForumTopicIconPath(const QString &name);
|
||||||
|
[[nodiscard]] QImage ForumTopicIconBackground(int32 colorId, int size);
|
||||||
|
[[nodiscard]] QImage ForumTopicIconFrame(
|
||||||
|
int32 colorId,
|
||||||
|
const QString &title,
|
||||||
|
const style::ForumTopicIcon &st);
|
||||||
|
|
||||||
class ForumTopic final : public Dialogs::Entry {
|
class ForumTopic final : public Dialogs::Entry {
|
||||||
public:
|
public:
|
||||||
static constexpr auto kGeneralId = 1;
|
static constexpr auto kGeneralId = 1;
|
||||||
|
@ -72,6 +86,8 @@ public:
|
||||||
void applyTitle(const QString &title);
|
void applyTitle(const QString &title);
|
||||||
[[nodiscard]] DocumentId iconId() const;
|
[[nodiscard]] DocumentId iconId() const;
|
||||||
void applyIconId(DocumentId iconId);
|
void applyIconId(DocumentId iconId);
|
||||||
|
[[nodiscard]] int32 colorId() const;
|
||||||
|
void applyColorId(int32 colorId);
|
||||||
void applyItemAdded(not_null<HistoryItem*> item);
|
void applyItemAdded(not_null<HistoryItem*> item);
|
||||||
void applyItemRemoved(MsgId id);
|
void applyItemRemoved(MsgId id);
|
||||||
|
|
||||||
|
@ -95,6 +111,7 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void indexTitleParts();
|
void indexTitleParts();
|
||||||
|
void validateDefaultIcon() const;
|
||||||
void applyTopicTopMessage(MsgId topMessageId);
|
void applyTopicTopMessage(MsgId topMessageId);
|
||||||
void applyTopicFields(
|
void applyTopicFields(
|
||||||
int unreadCount,
|
int unreadCount,
|
||||||
|
@ -119,8 +136,10 @@ private:
|
||||||
base::flat_set<QString> _titleWords;
|
base::flat_set<QString> _titleWords;
|
||||||
base::flat_set<QChar> _titleFirstLetters;
|
base::flat_set<QChar> _titleFirstLetters;
|
||||||
int _titleVersion = 0;
|
int _titleVersion = 0;
|
||||||
|
int32 _colorId = 0;
|
||||||
|
|
||||||
std::unique_ptr<Ui::Text::CustomEmoji> _icon;
|
std::unique_ptr<Ui::Text::CustomEmoji> _icon;
|
||||||
|
mutable QImage _defaultIcon; // on-demand
|
||||||
|
|
||||||
std::optional<MsgId> _inboxReadBefore;
|
std::optional<MsgId> _inboxReadBefore;
|
||||||
std::optional<MsgId> _outboxReadBefore;
|
std::optional<MsgId> _outboxReadBefore;
|
||||||
|
|
|
@ -860,18 +860,15 @@ void Histories::sendCreateTopicRequest(
|
||||||
const auto api = &session().api();
|
const auto api = &session().api();
|
||||||
using Flag = MTPchannels_CreateForumTopic::Flag;
|
using Flag = MTPchannels_CreateForumTopic::Flag;
|
||||||
api->request(MTPchannels_CreateForumTopic(
|
api->request(MTPchannels_CreateForumTopic(
|
||||||
MTP_flags(topic->iconId() ? Flag::f_icon_emoji_id : Flag(0)),
|
MTP_flags(Flag::f_icon_color
|
||||||
|
| (topic->iconId() ? Flag::f_icon_emoji_id : Flag(0))),
|
||||||
history->peer->asChannel()->inputChannel,
|
history->peer->asChannel()->inputChannel,
|
||||||
MTP_string(topic->title()),
|
MTP_string(topic->title()),
|
||||||
|
MTP_int(topic->colorId()),
|
||||||
MTP_long(topic->iconId()),
|
MTP_long(topic->iconId()),
|
||||||
MTP_long(randomId),
|
MTP_long(randomId),
|
||||||
MTPInputPeer() // send_as
|
MTPInputPeer() // send_as
|
||||||
)).done([=](const MTPUpdates &result) {
|
)).done([=](const MTPUpdates &result) {
|
||||||
//AssertIsDebug();
|
|
||||||
//const auto id = result.c_updates().vupdates().v.front().c_updateMessageID().vrandom_id().v;
|
|
||||||
//session().data().registerMessageRandomId(
|
|
||||||
// id,
|
|
||||||
// { history->peer->id, rootId });
|
|
||||||
api->applyUpdates(result, randomId);
|
api->applyUpdates(result, randomId);
|
||||||
}).fail([=](const MTP::Error &error) {
|
}).fail([=](const MTP::Error &error) {
|
||||||
api->sendMessageFail(error, history->peer, randomId);
|
api->sendMessageFail(error, history->peer, randomId);
|
||||||
|
@ -952,14 +949,14 @@ void Histories::checkTopicCreated(FullMsgId rootId, MsgId realId) {
|
||||||
const auto history = _owner->history(rootId.peer);
|
const auto history = _owner->history(rootId.peer);
|
||||||
for (auto &entry : scheduled) {
|
for (auto &entry : scheduled) {
|
||||||
_creatingTopicRequests.erase(entry.requestId);
|
_creatingTopicRequests.erase(entry.requestId);
|
||||||
//AssertIsDebug();
|
AssertIsDebug();
|
||||||
sendPreparedMessage(
|
//sendPreparedMessage(
|
||||||
history,
|
// history,
|
||||||
realId,
|
// realId,
|
||||||
entry.randomId,
|
// entry.randomId,
|
||||||
std::move(entry.message),
|
// std::move(entry.message),
|
||||||
std::move(entry.done),
|
// std::move(entry.done),
|
||||||
std::move(entry.fail));
|
// std::move(entry.fail));
|
||||||
}
|
}
|
||||||
for (const auto &item : history->clientSideMessages()) {
|
for (const auto &item : history->clientSideMessages()) {
|
||||||
const auto replace = [&](MsgId nowId) {
|
const auto replace = [&](MsgId nowId) {
|
||||||
|
|
|
@ -260,7 +260,7 @@ void RepliesList::injectRootMessage(not_null<Viewer*> viewer) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const auto root = lookupRoot();
|
const auto root = lookupRoot();
|
||||||
if (!root) {
|
if (!root || root->topicRootId() != Data::ForumTopic::kGeneralId) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
injectRootDivider(root, slice);
|
injectRootDivider(root, slice);
|
||||||
|
|
|
@ -307,6 +307,20 @@ void Session::clear() {
|
||||||
// Optimization: clear notifications before destroying items.
|
// Optimization: clear notifications before destroying items.
|
||||||
Core::App().notifications().clearFromSession(_session);
|
Core::App().notifications().clearFromSession(_session);
|
||||||
|
|
||||||
|
// We must clear all forums before clearing customEmojiManager.
|
||||||
|
// Because in Data::ForumTopic an Ui::Text::CustomEmoji is cached.
|
||||||
|
auto forums = base::flat_set<not_null<ChannelData*>>();
|
||||||
|
for (const auto &[peerId, peer] : _peers) {
|
||||||
|
if (const auto channel = peer->asChannel()) {
|
||||||
|
if (channel->isForum()) {
|
||||||
|
forums.emplace(channel);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (const auto &channel : forums) {
|
||||||
|
channel->setFlags(channel->flags() & ~ChannelDataFlag::Forum);
|
||||||
|
}
|
||||||
|
|
||||||
_sendActionManager->clear();
|
_sendActionManager->clear();
|
||||||
|
|
||||||
_histories->unloadAll();
|
_histories->unloadAll();
|
||||||
|
@ -1244,21 +1258,7 @@ void Session::setupUserIsContactViewer() {
|
||||||
}, _lifetime);
|
}, _lifetime);
|
||||||
}
|
}
|
||||||
|
|
||||||
Session::~Session() {
|
Session::~Session() = default;
|
||||||
// We must clear all forums before clearing customEmojiManager.
|
|
||||||
// Because in Data::ForumTopic an Ui::Text::CustomEmoji is cached.
|
|
||||||
auto forums = base::flat_set<not_null<ChannelData*>>();
|
|
||||||
for (const auto &[peerId, peer] : _peers) {
|
|
||||||
if (const auto channel = peer->asChannel()) {
|
|
||||||
if (channel->isForum()) {
|
|
||||||
forums.emplace(channel);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (const auto &channel : forums) {
|
|
||||||
channel->setFlags(channel->flags() & ~ChannelDataFlag::Forum);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename Method>
|
template <typename Method>
|
||||||
void Session::enumerateItemViews(
|
void Session::enumerateItemViews(
|
||||||
|
|
|
@ -12,9 +12,23 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "data/data_session.h"
|
#include "data/data_session.h"
|
||||||
#include "storage/serialize_common.h"
|
#include "storage/serialize_common.h"
|
||||||
#include "ui/chat/chat_theme.h"
|
#include "ui/chat/chat_theme.h"
|
||||||
|
#include "ui/color_int_conversion.h"
|
||||||
#include "core/application.h"
|
#include "core/application.h"
|
||||||
#include "main/main_session.h"
|
#include "main/main_session.h"
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
|
||||||
|
QColor ColorFromSerialized(MTPint serialized) {
|
||||||
|
return ColorFromSerialized(serialized.v);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::optional<QColor> MaybeColorFromSerialized(
|
||||||
|
const tl::conditional<MTPint> &mtp) {
|
||||||
|
return mtp ? ColorFromSerialized(*mtp) : std::optional<QColor>();
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace Ui
|
||||||
|
|
||||||
namespace Data {
|
namespace Data {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
@ -38,6 +52,8 @@ constexpr auto kIncorrectDefaultBackground = FromLegacyBackgroundId(105);
|
||||||
constexpr auto kVersionTag = qint32(0x7FFFFFFF);
|
constexpr auto kVersionTag = qint32(0x7FFFFFFF);
|
||||||
constexpr auto kVersion = 1;
|
constexpr auto kVersion = 1;
|
||||||
|
|
||||||
|
using Ui::MaybeColorFromSerialized;
|
||||||
|
|
||||||
[[nodiscard]] quint32 SerializeColor(const QColor &color) {
|
[[nodiscard]] quint32 SerializeColor(const QColor &color) {
|
||||||
return (quint32(std::clamp(color.red(), 0, 255)) << 16)
|
return (quint32(std::clamp(color.red(), 0, 255)) << 16)
|
||||||
| (quint32(std::clamp(color.green(), 0, 255)) << 8)
|
| (quint32(std::clamp(color.green(), 0, 255)) << 8)
|
||||||
|
@ -57,7 +73,8 @@ constexpr auto kVersion = 1;
|
||||||
}
|
}
|
||||||
result.reserve(4);
|
result.reserve(4);
|
||||||
result.push_back(*c1);
|
result.push_back(*c1);
|
||||||
const auto c2 = MaybeColorFromSerialized(data.vsecond_background_color());
|
const auto c2 = MaybeColorFromSerialized(
|
||||||
|
data.vsecond_background_color());
|
||||||
if (!c2) {
|
if (!c2) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -67,7 +84,8 @@ constexpr auto kVersion = 1;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
result.push_back(*c3);
|
result.push_back(*c3);
|
||||||
const auto c4 = MaybeColorFromSerialized(data.vfourth_background_color());
|
const auto c4 = MaybeColorFromSerialized(
|
||||||
|
data.vfourth_background_color());
|
||||||
if (!c4) {
|
if (!c4) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -712,29 +730,6 @@ QImage GenerateDitheredGradient(const Data::WallPaper &paper) {
|
||||||
paper.gradientRotation());
|
paper.gradientRotation());
|
||||||
}
|
}
|
||||||
|
|
||||||
QColor ColorFromSerialized(quint32 serialized) {
|
|
||||||
return QColor(
|
|
||||||
int((serialized >> 16) & 0xFFU),
|
|
||||||
int((serialized >> 8) & 0xFFU),
|
|
||||||
int(serialized & 0xFFU));
|
|
||||||
}
|
|
||||||
|
|
||||||
QColor ColorFromSerialized(MTPint serialized) {
|
|
||||||
return ColorFromSerialized(serialized.v);
|
|
||||||
}
|
|
||||||
|
|
||||||
std::optional<QColor> MaybeColorFromSerialized(
|
|
||||||
quint32 serialized) {
|
|
||||||
return (serialized == quint32(-1))
|
|
||||||
? std::nullopt
|
|
||||||
: std::make_optional(ColorFromSerialized(serialized));
|
|
||||||
}
|
|
||||||
|
|
||||||
std::optional<QColor> MaybeColorFromSerialized(
|
|
||||||
const tl::conditional<MTPint> &mtp) {
|
|
||||||
return mtp ? std::make_optional(ColorFromSerialized(*mtp)) : std::nullopt;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace details {
|
namespace details {
|
||||||
|
|
||||||
WallPaper UninitializedWallPaper() {
|
WallPaper UninitializedWallPaper() {
|
||||||
|
|
|
@ -15,6 +15,14 @@ namespace Main {
|
||||||
class Session;
|
class Session;
|
||||||
} // namespace Main
|
} // namespace Main
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
|
||||||
|
[[nodiscard]] QColor ColorFromSerialized(MTPint serialized);
|
||||||
|
[[nodiscard]] std::optional<QColor> MaybeColorFromSerialized(
|
||||||
|
const tl::conditional<MTPint> &mtp);
|
||||||
|
|
||||||
|
} // namespace Ui
|
||||||
|
|
||||||
namespace Data {
|
namespace Data {
|
||||||
|
|
||||||
struct FileOrigin;
|
struct FileOrigin;
|
||||||
|
@ -126,13 +134,6 @@ private:
|
||||||
|
|
||||||
[[nodiscard]] QImage GenerateDitheredGradient(const WallPaper &paper);
|
[[nodiscard]] QImage GenerateDitheredGradient(const WallPaper &paper);
|
||||||
|
|
||||||
[[nodiscard]] QColor ColorFromSerialized(quint32 serialized);
|
|
||||||
[[nodiscard]] QColor ColorFromSerialized(MTPint serialized);
|
|
||||||
[[nodiscard]] std::optional<QColor> MaybeColorFromSerialized(
|
|
||||||
quint32 serialized);
|
|
||||||
[[nodiscard]] std::optional<QColor> MaybeColorFromSerialized(
|
|
||||||
const tl::conditional<MTPint> &mtp);
|
|
||||||
|
|
||||||
namespace details {
|
namespace details {
|
||||||
|
|
||||||
[[nodiscard]] WallPaper UninitializedWallPaper();
|
[[nodiscard]] WallPaper UninitializedWallPaper();
|
||||||
|
|
|
@ -19,6 +19,23 @@ DialogRow {
|
||||||
textTop: pixels;
|
textTop: pixels;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ForumTopicIcon {
|
||||||
|
size: pixels;
|
||||||
|
font: font;
|
||||||
|
textTop: pixels;
|
||||||
|
}
|
||||||
|
|
||||||
|
defaultForumTopicIcon: ForumTopicIcon {
|
||||||
|
size: 21px;
|
||||||
|
font: font(bold 12px);
|
||||||
|
textTop: 3px;
|
||||||
|
}
|
||||||
|
largeForumTopicIcon: ForumTopicIcon {
|
||||||
|
size: 26px;
|
||||||
|
font: font(bold 13px);
|
||||||
|
textTop: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
dialogsUnreadFont: font(12px bold);
|
dialogsUnreadFont: font(12px bold);
|
||||||
dialogsUnreadHeight: 19px;
|
dialogsUnreadHeight: 19px;
|
||||||
dialogsUnreadPadding: 5px;
|
dialogsUnreadPadding: 5px;
|
||||||
|
|
|
@ -1156,13 +1156,14 @@ ServiceAction ParseServiceAction(
|
||||||
auto content = ActionTopicCreate();
|
auto content = ActionTopicCreate();
|
||||||
content.title = ParseString(data.vtitle());
|
content.title = ParseString(data.vtitle());
|
||||||
result.content = content;
|
result.content = content;
|
||||||
}, [&](const MTPDmessageActionTopicEditTitle &data) {
|
}, [&](const MTPDmessageActionTopicEdit &data) {
|
||||||
auto content = ActionTopicEditTitle();
|
auto content = ActionTopicEdit();
|
||||||
content.title = ParseString(data.vtitle());
|
if (const auto title = data.vtitle()) {
|
||||||
result.content = content;
|
content.title = ParseString(*title);
|
||||||
}, [&](const MTPDmessageActionTopicEditIcon &data) {
|
}
|
||||||
auto content = ActionTopicEditIcon();
|
if (const auto icon = data.vicon_emoji_id()) {
|
||||||
content.emojiDocumentId = data.vemoji_document_id().v;
|
content.iconEmojiId = icon->v;
|
||||||
|
}
|
||||||
result.content = content;
|
result.content = content;
|
||||||
}, [](const MTPDmessageActionEmpty &data) {});
|
}, [](const MTPDmessageActionEmpty &data) {});
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -503,12 +503,9 @@ struct ActionTopicCreate {
|
||||||
Utf8String title;
|
Utf8String title;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ActionTopicEditTitle {
|
struct ActionTopicEdit {
|
||||||
Utf8String title;
|
Utf8String title;
|
||||||
};
|
std::optional<uint64> iconEmojiId = 0;
|
||||||
|
|
||||||
struct ActionTopicEditIcon {
|
|
||||||
uint64 emojiDocumentId = 0;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ServiceAction {
|
struct ServiceAction {
|
||||||
|
@ -545,8 +542,7 @@ struct ServiceAction {
|
||||||
ActionWebViewDataSent,
|
ActionWebViewDataSent,
|
||||||
ActionGiftPremium,
|
ActionGiftPremium,
|
||||||
ActionTopicCreate,
|
ActionTopicCreate,
|
||||||
ActionTopicEditTitle,
|
ActionTopicEdit> content;
|
||||||
ActionTopicEditIcon> content;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
ServiceAction ParseServiceAction(
|
ServiceAction ParseServiceAction(
|
||||||
|
|
|
@ -1150,16 +1150,19 @@ auto HtmlWriter::Wrap::pushMessage(
|
||||||
+ " created topic «"
|
+ " created topic «"
|
||||||
+ SerializeString(data.title)
|
+ SerializeString(data.title)
|
||||||
+ "»";
|
+ "»";
|
||||||
}, [&](const ActionTopicEditTitle &data) {
|
}, [&](const ActionTopicEdit &data) {
|
||||||
return serviceFrom
|
auto parts = QList<QByteArray>();
|
||||||
+ " changed topic title to «"
|
if (!data.title.isEmpty()) {
|
||||||
+ SerializeString(data.title)
|
parts.push_back("title to «"
|
||||||
+ "»";
|
+ SerializeString(data.title)
|
||||||
}, [&](const ActionTopicEditIcon &data) {
|
+ "»");
|
||||||
return serviceFrom
|
}
|
||||||
+ " changed topic icon to «"
|
if (data.iconEmojiId) {
|
||||||
+ QString::number(data.emojiDocumentId).toUtf8()
|
parts.push_back("icon to «"
|
||||||
+ "»";
|
+ QString::number(*data.iconEmojiId).toUtf8()
|
||||||
|
+ "»");
|
||||||
|
}
|
||||||
|
return serviceFrom + " changed topic " + parts.join(',');
|
||||||
}, [](v::null_t) { return QByteArray(); });
|
}, [](v::null_t) { return QByteArray(); });
|
||||||
|
|
||||||
if (!serviceText.isEmpty()) {
|
if (!serviceText.isEmpty()) {
|
||||||
|
|
|
@ -564,14 +564,15 @@ QByteArray SerializeMessage(
|
||||||
pushActor();
|
pushActor();
|
||||||
pushAction("topic_created");
|
pushAction("topic_created");
|
||||||
push("title", data.title);
|
push("title", data.title);
|
||||||
}, [&](const ActionTopicEditTitle &data) {
|
}, [&](const ActionTopicEdit &data) {
|
||||||
pushActor();
|
pushActor();
|
||||||
pushAction("topic_title_edit");
|
pushAction("topic_edit");
|
||||||
push("title", data.title);
|
if (!data.title.isEmpty()) {
|
||||||
}, [&](const ActionTopicEditIcon &data) {
|
push("new_title", data.title);
|
||||||
pushActor();
|
}
|
||||||
pushAction("topic_icon_edit");
|
if (data.iconEmojiId) {
|
||||||
push("emoji_document_id", data.emojiDocumentId);
|
push("new_icon_emoji_id", *data.iconEmojiId);
|
||||||
|
}
|
||||||
}, [](v::null_t) {});
|
}, [](v::null_t) {});
|
||||||
|
|
||||||
if (v::is_null(message.action.content)) {
|
if (v::is_null(message.action.content)) {
|
||||||
|
|
|
@ -1080,18 +1080,18 @@ void History::applyServiceChanges(
|
||||||
forum->applyTopicAdded(
|
forum->applyTopicAdded(
|
||||||
item->id,
|
item->id,
|
||||||
qs(data.vtitle()),
|
qs(data.vtitle()),
|
||||||
|
data.vicon_color().v,
|
||||||
data.vicon_emoji_id().value_or(DocumentId()));
|
data.vicon_emoji_id().value_or(DocumentId()));
|
||||||
}
|
}
|
||||||
}, [&](const MTPDmessageActionTopicEditTitle &data) {
|
}, [&](const MTPDmessageActionTopicEdit &data) {
|
||||||
if (const auto forum = peer->forum()) {
|
if (const auto forum = peer->forum()) {
|
||||||
if (const auto topic = forum->topicFor(item)) {
|
if (const auto topic = forum->topicFor(item)) {
|
||||||
topic->applyTitle(qs(data.vtitle()));
|
if (const auto &title = data.vtitle()) {
|
||||||
}
|
topic->applyTitle(qs(*title));
|
||||||
}
|
}
|
||||||
}, [&](const MTPDmessageActionTopicEditIcon &data) {
|
if (const auto icon = data.vicon_emoji_id()) {
|
||||||
if (const auto forum = peer->forum()) {
|
topic->applyIconId(icon->v);
|
||||||
if (const auto topic = forum->topicFor(item)) {
|
}
|
||||||
topic->applyIconId(data.vemoji_document_id().v);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, [](const auto &) {
|
}, [](const auto &) {
|
||||||
|
|
|
@ -643,26 +643,24 @@ void HistoryService::setMessageByAction(const MTPmessageAction &action) {
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
||||||
auto prepareTopicEditTitle = [&](const MTPDmessageActionTopicEditTitle &action) {
|
auto prepareTopicEdit = [&](const MTPDmessageActionTopicEdit &action) {
|
||||||
auto result = PreparedText{};
|
auto result = PreparedText{};
|
||||||
// #TODO forum lang
|
// #TODO forum lang
|
||||||
result.text = { "topic edited: " + qs(action.vtitle()) };
|
result.text = { "topic edited: " }; // #TODO forum lang
|
||||||
return result;
|
if (const auto icon = action.vicon_emoji_id()) {
|
||||||
};
|
result.text.append(TextWithEntities{
|
||||||
|
"@",
|
||||||
auto prepareTopicEditIcon = [&](const MTPDmessageActionTopicEditIcon &action) {
|
{ EntityInText(
|
||||||
auto result = PreparedText{};
|
EntityType::CustomEmoji,
|
||||||
result.text = { "topic icon: " }; // #TODO forum lang
|
0,
|
||||||
result.text.append(TextWithEntities{
|
1,
|
||||||
"@",
|
Data::SerializeCustomEmojiId({ .id = icon->v }))
|
||||||
{ EntityInText(
|
},
|
||||||
EntityType::CustomEmoji,
|
});
|
||||||
0,
|
}
|
||||||
1,
|
if (const auto &title = action.vtitle()) {
|
||||||
Data::SerializeCustomEmojiId({
|
result.text.append(qs(*title));
|
||||||
.id = action.vemoji_document_id().v })) },
|
}
|
||||||
});
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -737,10 +735,8 @@ void HistoryService::setMessageByAction(const MTPmessageAction &action) {
|
||||||
return prepareGiftPremium(data);
|
return prepareGiftPremium(data);
|
||||||
}, [&](const MTPDmessageActionTopicCreate &data) {
|
}, [&](const MTPDmessageActionTopicCreate &data) {
|
||||||
return prepareTopicCreate(data);
|
return prepareTopicCreate(data);
|
||||||
}, [&](const MTPDmessageActionTopicEditTitle &data) {
|
}, [&](const MTPDmessageActionTopicEdit &data) {
|
||||||
return prepareTopicEditTitle(data);
|
return prepareTopicEdit(data);
|
||||||
}, [&](const MTPDmessageActionTopicEditIcon &data) {
|
|
||||||
return prepareTopicEditIcon(data);
|
|
||||||
}, [&](const MTPDmessageActionWebViewDataSentMe &data) {
|
}, [&](const MTPDmessageActionWebViewDataSentMe &data) {
|
||||||
LOG(("API Error: messageActionWebViewDataSentMe received."));
|
LOG(("API Error: messageActionWebViewDataSentMe received."));
|
||||||
return PreparedText{
|
return PreparedText{
|
||||||
|
@ -1312,8 +1308,10 @@ MsgId HistoryService::replyToTop() const {
|
||||||
|
|
||||||
MsgId HistoryService::topicRootId() const {
|
MsgId HistoryService::topicRootId() const {
|
||||||
if (const auto data = GetDependentData()
|
if (const auto data = GetDependentData()
|
||||||
; data && data->topicPost) {
|
; data && data->topicPost && data->topId) {
|
||||||
return data->topId;
|
return data->topId;
|
||||||
|
} else if (const auto topic = Get<HistoryServiceTopicInfo>()) {
|
||||||
|
return id;
|
||||||
}
|
}
|
||||||
return Data::ForumTopic::kGeneralId;
|
return Data::ForumTopic::kGeneralId;
|
||||||
}
|
}
|
||||||
|
@ -1455,9 +1453,9 @@ void HistoryService::createFromMtp(const MTPDmessageService &message) {
|
||||||
if (type == mtpc_messageActionPinMessage) {
|
if (type == mtpc_messageActionPinMessage) {
|
||||||
UpdateComponents(HistoryServicePinned::Bit());
|
UpdateComponents(HistoryServicePinned::Bit());
|
||||||
} else if (type == mtpc_messageActionTopicCreate
|
} else if (type == mtpc_messageActionTopicCreate
|
||||||
|| type == mtpc_messageActionTopicEditTitle
|
|| type == mtpc_messageActionTopicEdit) {
|
||||||
|| type == mtpc_messageActionTopicEditIcon) {
|
|
||||||
UpdateComponents(HistoryServiceTopicInfo::Bit());
|
UpdateComponents(HistoryServiceTopicInfo::Bit());
|
||||||
|
Get<HistoryServiceTopicInfo>()->topicPost = true;
|
||||||
} else if (type == mtpc_messageActionSetChatTheme) {
|
} else if (type == mtpc_messageActionSetChatTheme) {
|
||||||
setupChatThemeChange();
|
setupChatThemeChange();
|
||||||
} else if (type == mtpc_messageActionSetMessagesTTL) {
|
} else if (type == mtpc_messageActionSetMessagesTTL) {
|
||||||
|
@ -1548,6 +1546,8 @@ void HistoryService::createFromMtp(const MTPDmessageService &message) {
|
||||||
dependent->msgId = data.vreply_to_msg_id().v;
|
dependent->msgId = data.vreply_to_msg_id().v;
|
||||||
dependent->topId = data.vreply_to_top_id().value_or(
|
dependent->topId = data.vreply_to_top_id().value_or(
|
||||||
data.vreply_to_msg_id().v);
|
data.vreply_to_msg_id().v);
|
||||||
|
dependent->topicPost = data.is_forum_topic()
|
||||||
|
|| Has<HistoryServiceTopicInfo>();
|
||||||
if (!updateDependent()) {
|
if (!updateDependent()) {
|
||||||
RequestDependentMessageData(
|
RequestDependentMessageData(
|
||||||
this,
|
this,
|
||||||
|
|
|
@ -756,10 +756,12 @@ bool Element::computeIsAttachToPrevious(not_null<Element*> previous) {
|
||||||
const auto item = data();
|
const auto item = data();
|
||||||
if (!Has<DateBadge>() && !Has<UnreadBar>()) {
|
if (!Has<DateBadge>() && !Has<UnreadBar>()) {
|
||||||
const auto prev = previous->data();
|
const auto prev = previous->data();
|
||||||
|
const auto previousMarkup = prev->inlineReplyMarkup();
|
||||||
const auto possible = (std::abs(prev->date() - item->date())
|
const auto possible = (std::abs(prev->date() - item->date())
|
||||||
< kAttachMessageToPreviousSecondsDelta)
|
< kAttachMessageToPreviousSecondsDelta)
|
||||||
&& mayBeAttached(this)
|
&& mayBeAttached(this)
|
||||||
&& mayBeAttached(previous);
|
&& mayBeAttached(previous)
|
||||||
|
&& (!previousMarkup || previousMarkup->hiddenBy(prev->media()));
|
||||||
if (possible) {
|
if (possible) {
|
||||||
const auto forwarded = item->Get<HistoryMessageForwarded>();
|
const auto forwarded = item->Get<HistoryMessageForwarded>();
|
||||||
const auto prevForwarded = prev->Get<HistoryMessageForwarded>();
|
const auto prevForwarded = prev->Get<HistoryMessageForwarded>();
|
||||||
|
|
25
Telegram/SourceFiles/ui/color_int_conversion.cpp
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
/*
|
||||||
|
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
|
||||||
|
*/
|
||||||
|
#include "ui/color_int_conversion.h"
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
|
||||||
|
QColor ColorFromSerialized(quint32 serialized) {
|
||||||
|
return QColor(
|
||||||
|
int((serialized >> 16) & 0xFFU),
|
||||||
|
int((serialized >> 8) & 0xFFU),
|
||||||
|
int(serialized & 0xFFU));
|
||||||
|
}
|
||||||
|
|
||||||
|
std::optional<QColor> MaybeColorFromSerialized(quint32 serialized) {
|
||||||
|
return (serialized == quint32(-1))
|
||||||
|
? std::nullopt
|
||||||
|
: std::make_optional(ColorFromSerialized(serialized));
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace Ui
|
16
Telegram/SourceFiles/ui/color_int_conversion.h
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
/*
|
||||||
|
This file is part of Telegram Desktop,
|
||||||
|
the official desktop application for the Telegram messaging service.
|
||||||
|
|
||||||
|
For license and copyright information please follow this link:
|
||||||
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
|
*/
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
|
||||||
|
[[nodiscard]] QColor ColorFromSerialized(quint32 serialized);
|
||||||
|
[[nodiscard]] std::optional<QColor> MaybeColorFromSerialized(
|
||||||
|
quint32 serialized);
|
||||||
|
|
||||||
|
} // namespace Ui
|
|
@ -266,6 +266,8 @@ PRIVATE
|
||||||
ui/cached_round_corners.h
|
ui/cached_round_corners.h
|
||||||
ui/color_contrast.cpp
|
ui/color_contrast.cpp
|
||||||
ui/color_contrast.h
|
ui/color_contrast.h
|
||||||
|
ui/color_int_conversion.cpp
|
||||||
|
ui/color_int_conversion.h
|
||||||
ui/grouped_layout.cpp
|
ui/grouped_layout.cpp
|
||||||
ui/grouped_layout.h
|
ui/grouped_layout.h
|
||||||
ui/widgets/fields/special_fields.cpp
|
ui/widgets/fields/special_fields.cpp
|
||||||
|
|