mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-30 22:25:12 +00:00
Fix transcribe animation glitch in message view refresh.
This commit is contained in:
@@ -126,11 +126,15 @@ void TranscribeButton::setOpened(bool opened, Fn<void()> update) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_opened = opened;
|
_opened = opened;
|
||||||
_openedAnimation.start(
|
if (update) {
|
||||||
std::move(update),
|
_openedAnimation.start(
|
||||||
_opened ? 0. : 1.,
|
std::move(update),
|
||||||
_opened ? 1. : 0.,
|
_opened ? 0. : 1.,
|
||||||
st::fadeWrapDuration);
|
_opened ? 1. : 0.,
|
||||||
|
st::fadeWrapDuration);
|
||||||
|
} else {
|
||||||
|
_openedAnimation.stop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ClickHandlerPtr TranscribeButton::link() {
|
ClickHandlerPtr TranscribeButton::link() {
|
||||||
|
@@ -243,7 +243,8 @@ QSize Document::countOptimalSize() {
|
|||||||
voice->transcribe = nullptr;
|
voice->transcribe = nullptr;
|
||||||
voice->transcribeText = {};
|
voice->transcribeText = {};
|
||||||
} else {
|
} else {
|
||||||
if (!voice->transcribe) {
|
const auto creating = !voice->transcribe;
|
||||||
|
if (creating) {
|
||||||
voice->transcribe = std::make_unique<TranscribeButton>(
|
voice->transcribe = std::make_unique<TranscribeButton>(
|
||||||
_realParent);
|
_realParent);
|
||||||
}
|
}
|
||||||
@@ -262,7 +263,9 @@ QSize Document::countOptimalSize() {
|
|||||||
: TextWithEntities{
|
: TextWithEntities{
|
||||||
entry.result + (entry.pending ? " [...]" : ""),
|
entry.result + (entry.pending ? " [...]" : ""),
|
||||||
};
|
};
|
||||||
voice->transcribe->setOpened(!text.empty(), update);
|
voice->transcribe->setOpened(
|
||||||
|
!text.empty(),
|
||||||
|
creating ? Fn<void()>() : update);
|
||||||
if (text.empty()) {
|
if (text.empty()) {
|
||||||
voice->transcribeText = {};
|
voice->transcribeText = {};
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user