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

0001 /*
0002     SPDX-FileCopyrightText: 2020 Konrad Materka <materka@gmail.com>
0003     SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 
0006 import QtQuick 2.14
0007 import QtQuick.Controls 2.14 as QQC2
0008 import QtQuick.Layouts 1.13
0009 
0010 import org.kde.plasma.plasmoid 2.0
0011 import org.kde.plasma.core as PlasmaCore
0012 
0013 import org.kde.kirigami 2.13 as Kirigami
0014 import org.kde.kcmutils as KCM
0015 
0016 KCM.SimpleKCM {
0017     property bool cfg_scaleIconsToFit
0018     property int cfg_iconSpacing
0019 
0020     Kirigami.FormLayout {
0021         Layout.fillHeight: true
0022 
0023         QQC2.RadioButton {
0024             Kirigami.FormData.label: i18nc("The arrangement of system tray icons in the Panel", "Panel icon size:")
0025             enabled: !Kirigami.Settings.tabletMode
0026             text: i18n("Small")
0027             checked: cfg_scaleIconsToFit == false && !Kirigami.Settings.tabletMode
0028             onToggled: cfg_scaleIconsToFit = !checked
0029         }
0030         QQC2.RadioButton {
0031             id: automaticRadioButton
0032             enabled: !Kirigami.Settings.tabletMode
0033             text: Plasmoid.formFactor === PlasmaCore.Types.Horizontal ? i18n("Scale with Panel height")
0034                                                                       : i18n("Scale with Panel width")
0035             checked: cfg_scaleIconsToFit == true || Kirigami.Settings.tabletMode
0036             onToggled: cfg_scaleIconsToFit = checked
0037         }
0038         QQC2.Label {
0039             visible: Kirigami.Settings.tabletMode
0040             text: i18n("Automatically enabled when in Touch Mode")
0041             textFormat: Text.PlainText
0042             font: Kirigami.Theme.smallFont
0043         }
0044 
0045         Item {
0046             Kirigami.FormData.isSection: true
0047         }
0048 
0049         QQC2.ComboBox {
0050             Kirigami.FormData.label: i18nc("@label:listbox The spacing between system tray icons in the Panel", "Panel icon spacing:")
0051             model: [
0052                 {
0053                     "label": i18nc("@item:inlistbox Icon spacing", "Small"),
0054                     "spacing": 1
0055                 },
0056                 {
0057                     "label": i18nc("@item:inlistbox Icon spacing", "Normal"),
0058                     "spacing": 2
0059                 },
0060                 {
0061                     "label": i18nc("@item:inlistbox Icon spacing", "Large"),
0062                     "spacing": 6
0063                 }
0064             ]
0065             textRole: "label"
0066             enabled: !Kirigami.Settings.tabletMode
0067 
0068             currentIndex: {
0069                 if (Kirigami.Settings.tabletMode) {
0070                     return 2; // Large
0071                 }
0072 
0073                 switch (cfg_iconSpacing) {
0074                     case 1: return 0; // Small
0075                     case 2: return 1; // Normal
0076                     case 6: return 2; // Large
0077                 }
0078             }
0079 
0080             onActivated: cfg_iconSpacing = model[currentIndex]["spacing"];
0081         }
0082         QQC2.Label {
0083             visible: Kirigami.Settings.tabletMode
0084             text: i18nc("@info:usagetip under a combobox when Touch Mode is on", "Automatically set to Large when in Touch Mode")
0085             textFormat: Text.PlainText
0086             font: Kirigami.Theme.smallFont
0087         }
0088     }
0089 }