From 7176ee528efb642f66c5b823f3f6636edaa2a8a4 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Fri, 10 Nov 2023 17:31:05 -0500 Subject: [PATCH] Fix show news setting --- launcher/ui/Main.qml | 16 ++++++++++------ launcher/ui/Settings/GeneralSettings.qml | 6 +++++- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/launcher/ui/Main.qml b/launcher/ui/Main.qml index dd79248..5740912 100644 --- a/launcher/ui/Main.qml +++ b/launcher/ui/Main.qml @@ -109,17 +109,21 @@ Kirigami.ApplicationWindow { } } - function onShowNewsChanged() { - // workaround annoying Qt layout bug - // TODO: see if this changed in Qt6 - pageStack.layers.replace(Qt.createComponent("zone.xiv.astra", "MainPage")) - } - function onCurrentProfileChanged() { checkSetup(); } } + Connections { + target: LauncherCore.settings + + function onShowNewsChanged() { + // workaround annoying Qt layout bug + // TODO: see if this changed in Qt7 + pageStack.layers.replace(Qt.createComponent("zone.xiv.astra", "MainPage")) + } + } + Component.onCompleted: checkSetup() property Item hoverLinkIndicator: QQC2.Control { diff --git a/launcher/ui/Settings/GeneralSettings.qml b/launcher/ui/Settings/GeneralSettings.qml index 1600c56..a4a6a26 100644 --- a/launcher/ui/Settings/GeneralSettings.qml +++ b/launcher/ui/Settings/GeneralSettings.qml @@ -2,6 +2,7 @@ // SPDX-License-Identifier: GPL-3.0-or-later import QtQuick +import QtQuick.Window import QtQuick.Controls as QQC2 import QtQuick.Layouts @@ -71,7 +72,10 @@ FormCard.FormCardPage { text: i18n("Enable and show news") checked: LauncherCore.settings.showNews - onCheckedChanged: LauncherCore.settings.showNews = checked + onCheckedChanged: { + LauncherCore.settings.showNews = checked; + Window.window.close(); // if we don't close the dialog it crashes! + } } FormCard.FormDelegateSeparator {