Warning, /plasma/kdeplasma-addons/applets/quicklaunch/package/contents/ui/ConfigGeneral.qml is written in an unsupported language. File is not indexed.

0001 /*
0002  *  SPDX-FileCopyrightText: 2015 David Rosca <nowrep@gmail.com>
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.5
0008 import QtQuick.Layouts 1.3
0009 import QtQuick.Controls 2.5 as QQC2
0010 
0011 import org.kde.plasma.core as PlasmaCore
0012 import org.kde.kirigami 2.20 as Kirigami
0013 import org.kde.kcmutils as KCM
0014 
0015 KCM.SimpleKCM {
0016     readonly property bool vertical: plasmoid.formFactor == PlasmaCore.Types.Vertical || (plasmoid.formFactor == PlasmaCore.Types.Planar && plasmoid.height > plasmoid.width)
0017 
0018     property alias cfg_maxSectionCount: maxSectionCount.value
0019     property alias cfg_showLauncherNames: showLauncherNames.checked
0020     property alias cfg_enablePopup: enablePopup.checked
0021     property alias cfg_title: title.text
0022 
0023     Kirigami.FormLayout {
0024         QQC2.SpinBox {
0025             id: maxSectionCount
0026 
0027             Kirigami.FormData.label: vertical ? i18nc("@label:spinbox", "Maximum columns:") : i18nc("@label:spinbox", "Maximum rows:")
0028 
0029             from: 1
0030         }
0031 
0032         Item {
0033             Kirigami.FormData.isSection: true
0034         }
0035 
0036         QQC2.CheckBox {
0037             id: showLauncherNames
0038 
0039             Kirigami.FormData.label: i18nc("@title:group", "Appearance:")
0040 
0041             text: i18nc("@option:check", "Show launcher names")
0042         }
0043 
0044         QQC2.CheckBox {
0045             id: enablePopup
0046             text: i18nc("@option:check", "Enable popup")
0047         }
0048 
0049 
0050         Item {
0051             Kirigami.FormData.isSection: true
0052         }
0053 
0054 
0055         RowLayout {
0056             Kirigami.FormData.label: i18nc("@title:group", "Title:")
0057             Layout.fillWidth: true
0058 
0059             visible: plasmoid.formFactor == PlasmaCore.Types.Planar
0060 
0061             QQC2.CheckBox {
0062                 id: showTitle
0063                 checked: title.length
0064                 text: i18nc("@option:check", "Show:")
0065 
0066                 onClicked: {
0067                     if (checked) {
0068                         title.forceActiveFocus();
0069                     } else {
0070                         title.text = "";
0071                     }
0072                 }
0073             }
0074 
0075             Kirigami.ActionTextField {
0076                 id: title
0077                 enabled: showTitle.checked
0078 
0079                 Layout.fillWidth: true
0080                 placeholderText: i18nc("@info:placeholder", "Custom title")
0081 
0082                 rightActions: [
0083                     Kirigami.Action {
0084                         icon.name: "edit-clear"
0085                         visible: title.text.length !== 0
0086                         onTriggered: title.text = "";
0087                     }
0088                 ]
0089             }
0090         }
0091     }
0092 }