mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 06:07:06 +02:00
Use graphics for permissions expand arrow.
This commit is contained in:
parent
ebfddc1a68
commit
29379fac35
5 changed files with 18 additions and 12 deletions
BIN
Telegram/Resources/icons/info/edit/expand_arrow_small.png
Normal file
BIN
Telegram/Resources/icons/info/edit/expand_arrow_small.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 294 B |
BIN
Telegram/Resources/icons/info/edit/expand_arrow_small@2x.png
Normal file
BIN
Telegram/Resources/icons/info/edit/expand_arrow_small@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 413 B |
BIN
Telegram/Resources/icons/info/edit/expand_arrow_small@3x.png
Normal file
BIN
Telegram/Resources/icons/info/edit/expand_arrow_small@3x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 567 B |
|
@ -248,20 +248,24 @@ not_null<Ui::SettingsButton*> SendMediaToggle(
|
|||
label->setAttribute(Qt::WA_TransparentForMouseEvents);
|
||||
const auto arrow = Ui::CreateChild<Ui::RpWidget>(button);
|
||||
{
|
||||
const auto size = st::mainMenuToggleSize * 4;
|
||||
arrow->resize(size, size);
|
||||
const auto &icon = st::permissionsExpandIcon;
|
||||
arrow->resize(icon.size());
|
||||
arrow->paintRequest(
|
||||
) | rpl::start_with_next([=] {
|
||||
) | rpl::start_with_next([=, &icon] {
|
||||
auto p = QPainter(arrow);
|
||||
const auto path = Ui::ToggleUpDownArrowPath(
|
||||
size / 2.,
|
||||
size / 2.,
|
||||
size / 4.,
|
||||
st::mainMenuToggleFourStrokes,
|
||||
state->animation.value(wrap->toggled() ? 1. : 0.));
|
||||
|
||||
auto hq = PainterHighQualityEnabler(p);
|
||||
p.fillPath(path, st::rightsButton.textFg);
|
||||
const auto center = QPointF(
|
||||
icon.width() / 2.,
|
||||
icon.height() / 2.);
|
||||
const auto progress = state->animation.value(
|
||||
wrap->toggled() ? 1. : 0.);
|
||||
auto hq = std::optional<PainterHighQualityEnabler>();
|
||||
if (progress > 0.) {
|
||||
hq.emplace(p);
|
||||
p.translate(center);
|
||||
p.rotate(progress * 180.);
|
||||
p.translate(-center);
|
||||
}
|
||||
icon.paint(p, 0, 0, arrow->width());
|
||||
}, arrow->lifetime());
|
||||
}
|
||||
button->sizeValue(
|
||||
|
|
|
@ -890,3 +890,5 @@ reportReasonButton: SettingsButton(infoProfileButton) {
|
|||
style: boxTextStyle;
|
||||
padding: margins(62px, 7px, 8px, 7px);
|
||||
}
|
||||
|
||||
permissionsExpandIcon: icon{{ "info/edit/expand_arrow_small", windowBoldFg }};
|
||||
|
|
Loading…
Add table
Reference in a new issue