mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-07-26 23:43:06 +02:00
Replaced Application::appDeactivates with appDeactivatedValue.
This commit is contained in:
parent
628a02d99c
commit
54567a4253
4 changed files with 14 additions and 9 deletions
|
@ -521,7 +521,7 @@ MembersController::MembersController(
|
|||
|
||||
rpl::combine(
|
||||
rpl::single(anim::Disabled()) | rpl::then(anim::Disables()),
|
||||
rpl::single(false) | rpl::then(Core::App().appDeactivates())
|
||||
rpl::single(false) | rpl::then(Core::App().appDeactivatedValue())
|
||||
) | rpl::start_with_next([=](bool animDisabled, bool deactivated) {
|
||||
const auto hide = !(!animDisabled && !deactivated);
|
||||
|
||||
|
|
|
@ -223,7 +223,7 @@ GroupPanel::GroupPanel(not_null<GroupCall*> call)
|
|||
, _settings(widget(), st::groupCallSettings)
|
||||
, _mute(std::make_unique<Ui::CallMuteButton>(
|
||||
widget(),
|
||||
Core::App().appDeactivates(),
|
||||
Core::App().appDeactivatedValue(),
|
||||
Ui::CallMuteButtonState{
|
||||
.text = tr::lng_group_call_connecting(tr::now),
|
||||
.type = Ui::CallMuteButtonType::Connecting,
|
||||
|
|
|
@ -247,7 +247,7 @@ void Application::run() {
|
|||
|
||||
QCoreApplication::instance()->installEventFilter(this);
|
||||
|
||||
appDeactivates(
|
||||
appDeactivatedValue(
|
||||
) | rpl::start_with_next([=](bool deactivated) {
|
||||
if (deactivated) {
|
||||
handleAppDeactivated();
|
||||
|
@ -652,11 +652,16 @@ void Application::handleAppDeactivated() {
|
|||
Ui::Tooltip::Hide();
|
||||
}
|
||||
|
||||
rpl::producer<bool> Application::appDeactivates() const {
|
||||
return base::qt_signal_producer(
|
||||
static_cast<QGuiApplication*>(QCoreApplication::instance()),
|
||||
&QGuiApplication::applicationStateChanged
|
||||
) | rpl::map([=](Qt::ApplicationState state) {
|
||||
rpl::producer<bool> Application::appDeactivatedValue() const {
|
||||
const auto &app =
|
||||
static_cast<QGuiApplication*>(QCoreApplication::instance());
|
||||
return rpl::single(
|
||||
app->applicationState()
|
||||
) | rpl::then(
|
||||
base::qt_signal_producer(
|
||||
app,
|
||||
&QGuiApplication::applicationStateChanged
|
||||
)) | rpl::map([=](Qt::ApplicationState state) {
|
||||
return (state != Qt::ApplicationActive);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -271,7 +271,7 @@ public:
|
|||
|
||||
void handleAppActivated();
|
||||
void handleAppDeactivated();
|
||||
[[nodiscard]] rpl::producer<bool> appDeactivates() const;
|
||||
[[nodiscard]] rpl::producer<bool> appDeactivatedValue() const;
|
||||
|
||||
void switchDebugMode();
|
||||
void switchFreeType();
|
||||
|
|
Loading…
Add table
Reference in a new issue