mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-07-27 07:52:57 +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::combine(
|
||||||
rpl::single(anim::Disabled()) | rpl::then(anim::Disables()),
|
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) {
|
) | rpl::start_with_next([=](bool animDisabled, bool deactivated) {
|
||||||
const auto hide = !(!animDisabled && !deactivated);
|
const auto hide = !(!animDisabled && !deactivated);
|
||||||
|
|
||||||
|
|
|
@ -223,7 +223,7 @@ GroupPanel::GroupPanel(not_null<GroupCall*> call)
|
||||||
, _settings(widget(), st::groupCallSettings)
|
, _settings(widget(), st::groupCallSettings)
|
||||||
, _mute(std::make_unique<Ui::CallMuteButton>(
|
, _mute(std::make_unique<Ui::CallMuteButton>(
|
||||||
widget(),
|
widget(),
|
||||||
Core::App().appDeactivates(),
|
Core::App().appDeactivatedValue(),
|
||||||
Ui::CallMuteButtonState{
|
Ui::CallMuteButtonState{
|
||||||
.text = tr::lng_group_call_connecting(tr::now),
|
.text = tr::lng_group_call_connecting(tr::now),
|
||||||
.type = Ui::CallMuteButtonType::Connecting,
|
.type = Ui::CallMuteButtonType::Connecting,
|
||||||
|
|
|
@ -247,7 +247,7 @@ void Application::run() {
|
||||||
|
|
||||||
QCoreApplication::instance()->installEventFilter(this);
|
QCoreApplication::instance()->installEventFilter(this);
|
||||||
|
|
||||||
appDeactivates(
|
appDeactivatedValue(
|
||||||
) | rpl::start_with_next([=](bool deactivated) {
|
) | rpl::start_with_next([=](bool deactivated) {
|
||||||
if (deactivated) {
|
if (deactivated) {
|
||||||
handleAppDeactivated();
|
handleAppDeactivated();
|
||||||
|
@ -652,11 +652,16 @@ void Application::handleAppDeactivated() {
|
||||||
Ui::Tooltip::Hide();
|
Ui::Tooltip::Hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
rpl::producer<bool> Application::appDeactivates() const {
|
rpl::producer<bool> Application::appDeactivatedValue() const {
|
||||||
return base::qt_signal_producer(
|
const auto &app =
|
||||||
static_cast<QGuiApplication*>(QCoreApplication::instance()),
|
static_cast<QGuiApplication*>(QCoreApplication::instance());
|
||||||
|
return rpl::single(
|
||||||
|
app->applicationState()
|
||||||
|
) | rpl::then(
|
||||||
|
base::qt_signal_producer(
|
||||||
|
app,
|
||||||
&QGuiApplication::applicationStateChanged
|
&QGuiApplication::applicationStateChanged
|
||||||
) | rpl::map([=](Qt::ApplicationState state) {
|
)) | rpl::map([=](Qt::ApplicationState state) {
|
||||||
return (state != Qt::ApplicationActive);
|
return (state != Qt::ApplicationActive);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -271,7 +271,7 @@ public:
|
||||||
|
|
||||||
void handleAppActivated();
|
void handleAppActivated();
|
||||||
void handleAppDeactivated();
|
void handleAppDeactivated();
|
||||||
[[nodiscard]] rpl::producer<bool> appDeactivates() const;
|
[[nodiscard]] rpl::producer<bool> appDeactivatedValue() const;
|
||||||
|
|
||||||
void switchDebugMode();
|
void switchDebugMode();
|
||||||
void switchFreeType();
|
void switchFreeType();
|
||||||
|
|
Loading…
Add table
Reference in a new issue