mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 14:44:00 +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;
|
||||
}
|
||||
|
||||
bool RunInBackground() {
|
||||
return true;
|
||||
}
|
||||
|
||||
QString ExecutablePathForShortcuts() {
|
||||
if (Core::UpdaterDisabled()) {
|
||||
const auto &arguments = Core::Launcher::Instance().arguments();
|
||||
|
|
|
@ -31,10 +31,6 @@ inline bool SkipTaskbarSupported() {
|
|||
return false;
|
||||
}
|
||||
|
||||
inline bool RunInBackground() {
|
||||
return true;
|
||||
}
|
||||
|
||||
void ActivateThisProcess();
|
||||
|
||||
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 TrayIconSupported();
|
||||
[[nodiscard]] bool SkipTaskbarSupported();
|
||||
[[nodiscard]] bool RunInBackground();
|
||||
void WriteCrashDumpDetails();
|
||||
void NewVersionLaunched(int oldVersion);
|
||||
[[nodiscard]] QImage DefaultApplicationIcon();
|
||||
|
|
|
@ -28,10 +28,6 @@ inline bool SkipTaskbarSupported() {
|
|||
return true;
|
||||
}
|
||||
|
||||
inline bool RunInBackground() {
|
||||
return false;
|
||||
}
|
||||
|
||||
inline bool PreventsQuit(Core::QuitReason reason) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -575,9 +575,7 @@ void SetupSystemIntegrationContent(
|
|||
Core::App().saveSettings();
|
||||
}, roundIcon->lifetime());
|
||||
#endif // OS_MAC_STORE
|
||||
#endif // Q_OS_MAC
|
||||
|
||||
if (!Platform::RunInBackground()) {
|
||||
#elif defined Q_OS_WIN // Q_OS_MAC
|
||||
using Behavior = Core::Settings::CloseBehavior;
|
||||
const auto closeToTaskbar = addSlidingCheckbox(
|
||||
tr::lng_settings_close_to_taskbar(),
|
||||
|
@ -601,9 +599,7 @@ void SetupSystemIntegrationContent(
|
|||
settings->setCloseBehavior(value);
|
||||
Local::writeSettings();
|
||||
}, closeToTaskbar->lifetime());
|
||||
} else if (!Platform::IsMac()) {
|
||||
|
||||
}
|
||||
#endif // Q_OS_MAC || Q_OS_WIN
|
||||
|
||||
if (Platform::AutostartSupported() && controller) {
|
||||
const auto minimizedToggled = [=] {
|
||||
|
@ -968,9 +964,7 @@ void SetupWindowTitle(
|
|||
void SetupWindowCloseBehavior(
|
||||
not_null<Window::SessionController*> controller,
|
||||
not_null<Ui::VerticalLayout*> container) {
|
||||
if (Platform::IsMac() || !Platform::RunInBackground()) {
|
||||
return;
|
||||
}
|
||||
#if !defined Q_OS_WIN && !defined Q_OS_MAC
|
||||
const auto wrap = container->add(
|
||||
object_ptr<Ui::SlideWrap<Ui::VerticalLayout>>(
|
||||
container,
|
||||
|
@ -1023,6 +1017,7 @@ void SetupWindowCloseBehavior(
|
|||
}) | rpl::distinct_until_changed(), anim::type::normal);
|
||||
wrap->finishAnimating();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetupSystemIntegration(
|
||||
|
|
Loading…
Add table
Reference in a new issue