1/* 2 * Kaidan - A user-friendly XMPP client for every device! 3 * 4 * Copyright (C) 2016-2021 Kaidan developers and contributors 5 * (see the LICENSE file for a full list of copyright authors) 6 * 7 * Kaidan is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * In addition, as a special exception, the author of Kaidan gives 13 * permission to link the code of its release with the OpenSSL 14 * project's "OpenSSL" library (or with modified versions of it that 15 * use the same license as the "OpenSSL" library), and distribute the 16 * linked executables. You must obey the GNU General Public License in 17 * all respects for all of the code used other than "OpenSSL". If you 18 * modify this file, you may extend this exception to your version of 19 * the file, but you are not obligated to do so. If you do not wish to 20 * do so, delete this exception statement from your version. 21 * 22 * Kaidan is distributed in the hope that it will be useful, 23 * but WITHOUT ANY WARRANTY; without even the implied warranty of 24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 25 * GNU General Public License for more details. 26 * 27 * You should have received a copy of the GNU General Public License 28 * along with Kaidan. If not, see <http://www.gnu.org/licenses/>. 29 */ 30 31import QtQuick 2.14 32import QtQuick.Controls 2.14 as Controls 33import QtQuick.Layouts 1.14 34import org.kde.kirigami 2.12 as Kirigami 35 36/** 37 * This sheet is used on desktop systems instead of a new layer. It doesn't 38 * fill the complete width, so it looks a bit nicer on large screens. 39 */ 40Kirigami.OverlaySheet { 41 id: settingsSheet 42 43 header: RowLayout { 44 anchors.fill: parent 45 spacing: 1 46 Controls.ToolButton { 47 id: backButton 48 enabled: stack.currentItem !== stack.initialItem 49 icon.name: "draw-arrow-back" 50 onClicked: stack.pop() 51 } 52 Kirigami.Heading { 53 Layout.fillWidth: true 54 Layout.alignment: Qt.AlignVCenter 55 text: stack.currentItem.title 56 } 57 } 58 59 ColumnLayout { 60 Controls.StackView { 61 Layout.fillHeight: true 62 Layout.fillWidth: true 63 64 id: stack 65 Layout.preferredHeight: currentItem.height 66 initialItem: SettingsContent {} 67 clip: true 68 } 69 70 Layout.preferredWidth: Layout.maximumWidth 71 Layout.maximumWidth: 600 72 id: settingsPage 73 } 74} 75