mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-06 15:13:57 +02:00
Simplify run-in-background option selection.
This commit is contained in:
parent
7d74d3da3a
commit
9dc947ecb6
5 changed files with 25 additions and 43 deletions
|
@ -593,10 +593,6 @@ bool SkipTaskbarSupported() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RunInBackground() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString ExecutablePathForShortcuts() {
|
QString ExecutablePathForShortcuts() {
|
||||||
if (Core::UpdaterDisabled()) {
|
if (Core::UpdaterDisabled()) {
|
||||||
const auto &arguments = Core::Launcher::Instance().arguments();
|
const auto &arguments = Core::Launcher::Instance().arguments();
|
||||||
|
|
|
@ -31,10 +31,6 @@ inline bool SkipTaskbarSupported() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool RunInBackground() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ActivateThisProcess();
|
void ActivateThisProcess();
|
||||||
|
|
||||||
inline uint64 ActivationWindowId(not_null<QWidget*> window) {
|
inline uint64 ActivationWindowId(not_null<QWidget*> window) {
|
||||||
|
|
|
@ -44,7 +44,6 @@ void AutostartToggle(bool enabled, Fn<void(bool)> done = nullptr);
|
||||||
[[nodiscard]] bool AutostartSkip();
|
[[nodiscard]] bool AutostartSkip();
|
||||||
[[nodiscard]] bool TrayIconSupported();
|
[[nodiscard]] bool TrayIconSupported();
|
||||||
[[nodiscard]] bool SkipTaskbarSupported();
|
[[nodiscard]] bool SkipTaskbarSupported();
|
||||||
[[nodiscard]] bool RunInBackground();
|
|
||||||
void WriteCrashDumpDetails();
|
void WriteCrashDumpDetails();
|
||||||
void NewVersionLaunched(int oldVersion);
|
void NewVersionLaunched(int oldVersion);
|
||||||
[[nodiscard]] QImage DefaultApplicationIcon();
|
[[nodiscard]] QImage DefaultApplicationIcon();
|
||||||
|
|
|
@ -28,10 +28,6 @@ inline bool SkipTaskbarSupported() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool RunInBackground() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline bool PreventsQuit(Core::QuitReason reason) {
|
inline bool PreventsQuit(Core::QuitReason reason) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -575,9 +575,7 @@ void SetupSystemIntegrationContent(
|
||||||
Core::App().saveSettings();
|
Core::App().saveSettings();
|
||||||
}, roundIcon->lifetime());
|
}, roundIcon->lifetime());
|
||||||
#endif // OS_MAC_STORE
|
#endif // OS_MAC_STORE
|
||||||
#endif // Q_OS_MAC
|
#elif defined Q_OS_WIN // Q_OS_MAC
|
||||||
|
|
||||||
if (!Platform::RunInBackground()) {
|
|
||||||
using Behavior = Core::Settings::CloseBehavior;
|
using Behavior = Core::Settings::CloseBehavior;
|
||||||
const auto closeToTaskbar = addSlidingCheckbox(
|
const auto closeToTaskbar = addSlidingCheckbox(
|
||||||
tr::lng_settings_close_to_taskbar(),
|
tr::lng_settings_close_to_taskbar(),
|
||||||
|
@ -601,9 +599,7 @@ void SetupSystemIntegrationContent(
|
||||||
settings->setCloseBehavior(value);
|
settings->setCloseBehavior(value);
|
||||||
Local::writeSettings();
|
Local::writeSettings();
|
||||||
}, closeToTaskbar->lifetime());
|
}, closeToTaskbar->lifetime());
|
||||||
} else if (!Platform::IsMac()) {
|
#endif // Q_OS_MAC || Q_OS_WIN
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Platform::AutostartSupported() && controller) {
|
if (Platform::AutostartSupported() && controller) {
|
||||||
const auto minimizedToggled = [=] {
|
const auto minimizedToggled = [=] {
|
||||||
|
@ -968,9 +964,7 @@ void SetupWindowTitle(
|
||||||
void SetupWindowCloseBehavior(
|
void SetupWindowCloseBehavior(
|
||||||
not_null<Window::SessionController*> controller,
|
not_null<Window::SessionController*> controller,
|
||||||
not_null<Ui::VerticalLayout*> container) {
|
not_null<Ui::VerticalLayout*> container) {
|
||||||
if (Platform::IsMac() || !Platform::RunInBackground()) {
|
#if !defined Q_OS_WIN && !defined Q_OS_MAC
|
||||||
return;
|
|
||||||
}
|
|
||||||
const auto wrap = container->add(
|
const auto wrap = container->add(
|
||||||
object_ptr<Ui::SlideWrap<Ui::VerticalLayout>>(
|
object_ptr<Ui::SlideWrap<Ui::VerticalLayout>>(
|
||||||
container,
|
container,
|
||||||
|
@ -1023,6 +1017,7 @@ void SetupWindowCloseBehavior(
|
||||||
}) | rpl::distinct_until_changed(), anim::type::normal);
|
}) | rpl::distinct_until_changed(), anim::type::normal);
|
||||||
wrap->finishAnimating();
|
wrap->finishAnimating();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetupSystemIntegration(
|
void SetupSystemIntegration(
|
||||||
|
|
Loading…
Add table
Reference in a new issue