mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-17 06:37:24 +02:00
Added fade animation to center label of slider in earn channel section.
This commit is contained in:
parent
3c266b6dc4
commit
3845a87f2e
2 changed files with 6 additions and 1 deletions
|
@ -101,6 +101,7 @@ channelEarnBalanceMinorLabel: FlatLabel(channelEarnOverviewMinorLabel) {
|
|||
}
|
||||
}
|
||||
channelEarnBalanceMinorLabelSkip: 6px;
|
||||
channelEarnFadeDuration: 60;
|
||||
|
||||
channelEarnLearnDescription: FlatLabel(defaultFlatLabel) {
|
||||
maxHeight: 0px;
|
||||
|
|
|
@ -26,6 +26,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "statistics/chart_widget.h"
|
||||
#include "ui/controls/userpic_button.h"
|
||||
#include "ui/effects/animation_value_f.h"
|
||||
#include "ui/effects/fade_animation.h"
|
||||
#include "ui/layers/generic_box.h"
|
||||
#include "ui/painter.h"
|
||||
#include "ui/rect.h"
|
||||
|
@ -852,6 +853,8 @@ void InnerWidget::fill() {
|
|||
const auto center = Ui::CreateChild<Ui::FlatLabel>(
|
||||
line,
|
||||
st::defaultFlatLabel);
|
||||
const auto fade = lifetime().make_state<Ui::FadeAnimation>(center);
|
||||
fade->setUpdatedCallback([=](float64 o) { center->setOpacity(o); });
|
||||
const auto right = Ui::CreateChild<Ui::FlatLabel>(
|
||||
line,
|
||||
st::defaultFlatLabel);
|
||||
|
@ -902,8 +905,9 @@ void InnerWidget::fill() {
|
|||
EmojiCurrency(session),
|
||||
Ui::Text::RichLangValue),
|
||||
makeContext(center));
|
||||
fade->fadeIn(st::channelEarnFadeDuration);
|
||||
} else {
|
||||
center->setText({});
|
||||
fade->fadeOut(st::channelEarnFadeDuration);
|
||||
}
|
||||
center->setTextColorOverride(activeColor);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue