ZaStoGram_desktop/Telegram/SourceFiles/ui/controls/button_busy.cpp
John Preston f42c9880da Share the box footer busy state, drop dead entry points
Task: 2026/09/08/retire-the-duplicated-busy-state-and-the-dead-passcode-entry-points
2026-10-08 22:23:56 +04:00

32 lines
775 B
C++

/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "ui/controls/button_busy.h"
#include "ui/widgets/buttons.h"
namespace Ui {
void SetButtonDimmed(Ui::RoundButton *button, bool dimmed) {
if (!button) {
return;
}
button->setAttribute(Qt::WA_TransparentForMouseEvents, dimmed);
button->setTextFgOverride(dimmed
? std::make_optional(anim::with_alpha(button->st().textFg->c, 0.5))
: std::nullopt);
}
void SetButtonBusy(Ui::RoundButton *button, bool busy) {
if (!button) {
return;
}
button->setDisabled(busy);
SetButtonDimmed(button, busy);
}
} // namespace Ui