mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-07-26 15:33:02 +02:00
Remove delay when switching subsection tabs.
This commit is contained in:
parent
265b7904a8
commit
4b25406d14
1 changed files with 7 additions and 9 deletions
|
@ -7,7 +7,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
*/
|
*/
|
||||||
#include "ui/controls/subsection_tabs_slider.h"
|
#include "ui/controls/subsection_tabs_slider.h"
|
||||||
|
|
||||||
#include "base/call_delayed.h"
|
|
||||||
#include "dialogs/dialogs_three_state_icon.h"
|
#include "dialogs/dialogs_three_state_icon.h"
|
||||||
#include "ui/effects/ripple_animation.h"
|
#include "ui/effects/ripple_animation.h"
|
||||||
#include "ui/dynamic_image.h"
|
#include "ui/dynamic_image.h"
|
||||||
|
@ -384,14 +383,13 @@ void SubsectionSlider::activate(int index) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
const auto weak = Ui::MakeWeak(_bar);
|
||||||
|
_sectionActivated.fire_copy(index);
|
||||||
|
if (weak) {
|
||||||
const auto duration = st::chatTabsSlider.duration;
|
const auto duration = st::chatTabsSlider.duration;
|
||||||
_activeFrom.start(callback, was.from, now.from, duration);
|
_activeFrom.start(callback, was.from, now.from, duration);
|
||||||
_activeSize.start(callback, was.size, now.size, duration);
|
_activeSize.start(callback, was.size, now.size, duration);
|
||||||
base::call_delayed(duration, this, [=] {
|
|
||||||
if (_active == index) {
|
|
||||||
_sectionActivated.fire_copy(index);
|
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SubsectionSlider::setActiveSectionFast(int active) {
|
void SubsectionSlider::setActiveSectionFast(int active) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue