Warning, /plasma/kscreenlocker/kcm/ui/Appearance.qml is written in an unsupported language. File is not indexed.

0001 /*
0002 SPDX-FileCopyrightText: 2020 David Redondo <kde@david-redondo.de>
0003 
0004 SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005 */
0006 
0007 import QtQuick 2.15
0008 import QtQuick.Controls 2.15 as QQC2
0009 import QtQuick.Layouts 1.15
0010 
0011 import org.kde.kcmutils as KCM
0012 import org.kde.kirigami 2.20 as Kirigami
0013 
0014 Kirigami.Page {
0015     // The following two must be set for correct alignment with wallpaper config
0016     id: appearanceRoot
0017     property alias parentLayout: parentLayout
0018     // Plugins expect these two properties
0019     property var wallpaper: kcm.wallpaperIntegration
0020     property var configDialog: kcm
0021 
0022     title: i18nc("@title", "Appearance")
0023 
0024     padding: 6  // Layout_ChildMarginWidth from Breeze
0025 
0026     ColumnLayout {
0027         anchors.fill: parent
0028 
0029         LnfConfig {
0030             sourceFile: kcm.lnfConfigFile
0031             onConfigurationChanged: kcm.updateState()
0032         }
0033 
0034         Kirigami.FormLayout {
0035             id: parentLayout // Don't change needed for correct alignment with lnf and wallpaper config
0036 
0037             QQC2.ComboBox {
0038                 Kirigami.FormData.label: i18n("Wallpaper type:")
0039                 model: kcm.availableWallpaperPlugins()
0040                 textRole: "name"
0041                 valueRole: "id"
0042                 currentIndex: model.findIndex(wallpaper => wallpaper["id"] === kcm.settings.wallpaperPluginId)
0043                 displayText: model[currentIndex]["name"]
0044 
0045                 onActivated: {
0046                     kcm.settings.wallpaperPluginId = model[index]["id"]
0047                 }
0048 
0049                 KCM.SettingStateBinding {
0050                     configObject: kcm.settings
0051                     settingName: "wallpaperPluginId"
0052                 }
0053             }
0054         }
0055 
0056         WallpaperConfig {
0057             sourceFile: kcm.wallpaperConfigFile
0058             onConfigurationChanged: kcm.updateState()
0059             onConfigurationForceChanged: kcm.forceUpdateState()
0060         }
0061     }
0062 }