Warning, /utilities/krecorder/src/contents/ui/settings/SettingsWindow.qml is written in an unsupported language. File is not indexed.
0001 // SPDX-FileCopyrightText: 2022 Devin Lin <espidev@gmail.com>
0002 // SPDX-License-Identifier: GPL-3.0-or-later
0003
0004 import QtQuick
0005 import QtQuick.Controls as Controls
0006 import QtQuick.Layouts
0007
0008 import org.kde.kirigami as Kirigami
0009
0010 // A settings window is used on desktop when the app is widescreen.
0011 Kirigami.ApplicationWindow {
0012 id: root
0013 title: i18n("Settings")
0014 flags: Qt.WindowStaysOnTopHint
0015
0016 height: Kirigami.Units.gridUnit * 25
0017 width: Kirigami.Units.gridUnit * 35
0018
0019 Kirigami.Theme.inherit: false
0020 Kirigami.Theme.colorSet: Kirigami.Theme.Window
0021
0022 pageStack.globalToolBar.style: Kirigami.ApplicationHeaderStyle.ToolBar;
0023 pageStack.globalToolBar.showNavigationButtons: Kirigami.ApplicationHeaderStyle.ShowBackButton;
0024 pageStack.columnView.columnResizeMode: Kirigami.ColumnView.SingleColumn
0025
0026 // pop pages when not in use
0027 Connections {
0028 target: applicationWindow().pageStack
0029 function onCurrentIndexChanged() {
0030 // wait for animation to finish before popping pages
0031 closePageTimer.restart();
0032 }
0033 }
0034
0035 Timer {
0036 id: closePageTimer
0037 interval: 300
0038 onTriggered: {
0039 let currentIndex = applicationWindow().pageStack.currentIndex;
0040 while (applicationWindow().pageStack.depth > (currentIndex + 1) && currentIndex >= 0) {
0041 applicationWindow().pageStack.pop();
0042 }
0043 }
0044 }
0045
0046 pageStack.initialPage: Kirigami.ScrollablePage {
0047 topPadding: 0
0048 leftPadding: 0
0049 rightPadding: 0
0050
0051 globalToolBarStyle: Kirigami.ApplicationHeaderStyle.None
0052
0053 ColumnLayout {
0054 Kirigami.Separator { Layout.fillWidth: true }
0055
0056 SettingsComponent {
0057 Layout.topMargin: Kirigami.Units.gridUnit
0058 Layout.fillWidth: true
0059 onCloseRequested: dialog.close()
0060 }
0061 }
0062 }
0063 }