mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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;
|
channelEarnBalanceMinorLabelSkip: 6px;
|
||||||
|
channelEarnFadeDuration: 60;
|
||||||
|
|
||||||
channelEarnLearnDescription: FlatLabel(defaultFlatLabel) {
|
channelEarnLearnDescription: FlatLabel(defaultFlatLabel) {
|
||||||
maxHeight: 0px;
|
maxHeight: 0px;
|
||||||
|
|
|
@ -26,6 +26,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "statistics/chart_widget.h"
|
#include "statistics/chart_widget.h"
|
||||||
#include "ui/controls/userpic_button.h"
|
#include "ui/controls/userpic_button.h"
|
||||||
#include "ui/effects/animation_value_f.h"
|
#include "ui/effects/animation_value_f.h"
|
||||||
|
#include "ui/effects/fade_animation.h"
|
||||||
#include "ui/layers/generic_box.h"
|
#include "ui/layers/generic_box.h"
|
||||||
#include "ui/painter.h"
|
#include "ui/painter.h"
|
||||||
#include "ui/rect.h"
|
#include "ui/rect.h"
|
||||||
|
@ -852,6 +853,8 @@ void InnerWidget::fill() {
|
||||||
const auto center = Ui::CreateChild<Ui::FlatLabel>(
|
const auto center = Ui::CreateChild<Ui::FlatLabel>(
|
||||||
line,
|
line,
|
||||||
st::defaultFlatLabel);
|
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>(
|
const auto right = Ui::CreateChild<Ui::FlatLabel>(
|
||||||
line,
|
line,
|
||||||
st::defaultFlatLabel);
|
st::defaultFlatLabel);
|
||||||
|
@ -902,8 +905,9 @@ void InnerWidget::fill() {
|
||||||
EmojiCurrency(session),
|
EmojiCurrency(session),
|
||||||
Ui::Text::RichLangValue),
|
Ui::Text::RichLangValue),
|
||||||
makeContext(center));
|
makeContext(center));
|
||||||
|
fade->fadeIn(st::channelEarnFadeDuration);
|
||||||
} else {
|
} else {
|
||||||
center->setText({});
|
fade->fadeOut(st::channelEarnFadeDuration);
|
||||||
}
|
}
|
||||||
center->setTextColorOverride(activeColor);
|
center->setTextColorOverride(activeColor);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue