mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-06 15:13:57 +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);
|
label->setAttribute(Qt::WA_TransparentForMouseEvents);
|
||||||
const auto arrow = Ui::CreateChild<Ui::RpWidget>(button);
|
const auto arrow = Ui::CreateChild<Ui::RpWidget>(button);
|
||||||
{
|
{
|
||||||
const auto size = st::mainMenuToggleSize * 4;
|
const auto &icon = st::permissionsExpandIcon;
|
||||||
arrow->resize(size, size);
|
arrow->resize(icon.size());
|
||||||
arrow->paintRequest(
|
arrow->paintRequest(
|
||||||
) | rpl::start_with_next([=] {
|
) | rpl::start_with_next([=, &icon] {
|
||||||
auto p = QPainter(arrow);
|
auto p = QPainter(arrow);
|
||||||
const auto path = Ui::ToggleUpDownArrowPath(
|
const auto center = QPointF(
|
||||||
size / 2.,
|
icon.width() / 2.,
|
||||||
size / 2.,
|
icon.height() / 2.);
|
||||||
size / 4.,
|
const auto progress = state->animation.value(
|
||||||
st::mainMenuToggleFourStrokes,
|
wrap->toggled() ? 1. : 0.);
|
||||||
state->animation.value(wrap->toggled() ? 1. : 0.));
|
auto hq = std::optional<PainterHighQualityEnabler>();
|
||||||
|
if (progress > 0.) {
|
||||||
auto hq = PainterHighQualityEnabler(p);
|
hq.emplace(p);
|
||||||
p.fillPath(path, st::rightsButton.textFg);
|
p.translate(center);
|
||||||
|
p.rotate(progress * 180.);
|
||||||
|
p.translate(-center);
|
||||||
|
}
|
||||||
|
icon.paint(p, 0, 0, arrow->width());
|
||||||
}, arrow->lifetime());
|
}, arrow->lifetime());
|
||||||
}
|
}
|
||||||
button->sizeValue(
|
button->sizeValue(
|
||||||
|
|
|
@ -890,3 +890,5 @@ reportReasonButton: SettingsButton(infoProfileButton) {
|
||||||
style: boxTextStyle;
|
style: boxTextStyle;
|
||||||
padding: margins(62px, 7px, 8px, 7px);
|
padding: margins(62px, 7px, 8px, 7px);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
permissionsExpandIcon: icon{{ "info/edit/expand_arrow_small", windowBoldFg }};
|
||||||
|
|
Loading…
Add table
Reference in a new issue