Store window geometry using KConfig.WindowStateSaver

This commit is contained in:
Eamonn Rea 2024-09-17 19:09:09 +01:00 committed by Carl Schwan
parent 22a9571cfb
commit 6cab88d2d4
2 changed files with 6 additions and 1 deletions

View file

@ -43,7 +43,7 @@ ecm_setup_version(${RELEASE_SERVICE_VERSION}
ecm_set_disabled_deprecation_versions( ecm_set_disabled_deprecation_versions(
QT 6.6 QT 6.6
KF 6.0 KF 6.5
) )
# Make the version header available by linking against kdeconnectversion # Make the version header available by linking against kdeconnectversion

View file

@ -9,6 +9,7 @@ import QtQuick.Controls as QQC2
import QtQuick.Layouts import QtQuick.Layouts
import org.kde.kirigami as Kirigami import org.kde.kirigami as Kirigami
import org.kde.kdeconnect import org.kde.kdeconnect
import org.kde.config as KConfig
Kirigami.ApplicationWindow { Kirigami.ApplicationWindow {
id: root id: root
@ -19,6 +20,10 @@ Kirigami.ApplicationWindow {
pageStack.globalToolBar.canContainHandles: true pageStack.globalToolBar.canContainHandles: true
pageStack.globalToolBar.showNavigationButtons: applicationWindow().pageStack.currentIndex > 0 ? Kirigami.ApplicationHeaderStyle.ShowBackButton : 0 pageStack.globalToolBar.showNavigationButtons: applicationWindow().pageStack.currentIndex > 0 ? Kirigami.ApplicationHeaderStyle.ShowBackButton : 0
KConfig.WindowStateSaver {
configGroupName: "MainWindow"
}
globalDrawer: Kirigami.OverlayDrawer { globalDrawer: Kirigami.OverlayDrawer {
id: drawer id: drawer
edge: Qt.application.layoutDirection === Qt.RightToLeft ? Qt.RightEdge : Qt.LeftEdge edge: Qt.application.layoutDirection === Qt.RightToLeft ? Qt.RightEdge : Qt.LeftEdge