Warning, /plasma/latte-dock/indicators/default/package/config/config.qml is written in an unsupported language. File is not indexed.

0001 /*
0002     SPDX-FileCopyrightText: 2018 Michail Vourlakos <mvourlakos@gmail.com>
0003     SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 
0006 import QtQuick 2.7
0007 import QtQuick.Controls 1.4
0008 import QtQuick.Layouts 1.3
0009 import QtGraphicalEffects 1.0
0010 
0011 import org.kde.plasma.core 2.0 as PlasmaCore
0012 import org.kde.plasma.components 2.0 as PlasmaComponents
0013 import org.kde.plasma.components 3.0 as PlasmaComponents3
0014 import org.kde.plasma.plasmoid 2.0
0015 
0016 import org.kde.latte.components 1.0 as LatteComponents
0017 
0018 ColumnLayout {
0019     id: root
0020     Layout.fillWidth: true
0021 
0022     LatteComponents.SubHeader {
0023         text: i18nc("indicator style","Style")
0024     }
0025 
0026     RowLayout {
0027         Layout.fillWidth: true
0028         spacing: 2
0029 
0030         property int indicatorType: indicator.configuration.activeStyle
0031 
0032         readonly property int buttonsCount: 2
0033         readonly property int buttonSize: (dialog.optionsWidth - (spacing * buttonsCount-1)) / buttonsCount
0034 
0035         ExclusiveGroup {
0036             id: activeIndicatorTypeGroup
0037         }
0038 
0039         PlasmaComponents.Button {
0040             Layout.minimumWidth: parent.buttonSize
0041             Layout.maximumWidth: Layout.minimumWidth
0042             text: i18nc("line indicator","Line")
0043             checked: parent.indicatorType === indicatorType
0044             checkable: false
0045             exclusiveGroup: activeIndicatorTypeGroup
0046             tooltip: i18n("Show a line indicator for active items")
0047 
0048             readonly property int indicatorType: 0 /*Line*/
0049 
0050             onPressedChanged: {
0051                 if (pressed) {
0052                     indicator.configuration.activeStyle = indicatorType;
0053                 }
0054             }
0055         }
0056 
0057         PlasmaComponents.Button {
0058             Layout.minimumWidth: parent.buttonSize
0059             Layout.maximumWidth: Layout.minimumWidth
0060             text: i18nc("dots indicator", "Dots")
0061             checked: parent.indicatorType === indicatorType
0062             checkable: false
0063             exclusiveGroup: activeIndicatorTypeGroup
0064             tooltip: i18n("Show a dot indicator for active items")
0065 
0066             readonly property int indicatorType: 1 /*Dot*/
0067 
0068             onPressedChanged: {
0069                 if (pressed) {
0070                     indicator.configuration.activeStyle = indicatorType;
0071                 }
0072             }
0073         }
0074     }
0075 
0076     RowLayout {
0077         Layout.fillWidth: true
0078         spacing: units.smallSpacing
0079 
0080         PlasmaComponents.Label {
0081             text: i18n("Thickness")
0082             horizontalAlignment: Text.AlignLeft
0083         }
0084 
0085         LatteComponents.Slider {
0086             id: sizeSlider
0087             Layout.fillWidth: true
0088 
0089             value: Math.round(indicator.configuration.size * 100)
0090             from: 3
0091             to: 25
0092             stepSize: 1
0093             wheelEnabled: false
0094 
0095             onPressedChanged: {
0096                 if (!pressed) {
0097                     indicator.configuration.size = Number(value / 100).toFixed(2);
0098                 }
0099             }
0100         }
0101 
0102         PlasmaComponents.Label {
0103             text: i18nc("number in percentage, e.g. 85 %","%1 %", currentValue)
0104             horizontalAlignment: Text.AlignRight
0105             Layout.minimumWidth: theme.mSize(theme.defaultFont).width * 4
0106             Layout.maximumWidth: theme.mSize(theme.defaultFont).width * 4
0107 
0108             readonly property int currentValue: sizeSlider.value
0109         }
0110     }
0111 
0112     RowLayout {
0113         Layout.fillWidth: true
0114         spacing: units.smallSpacing
0115 
0116         PlasmaComponents.Label {
0117             text: i18n("Position")
0118             horizontalAlignment: Text.AlignLeft
0119         }
0120 
0121         LatteComponents.Slider {
0122             id: thickMarginSlider
0123             Layout.fillWidth: true
0124 
0125             value: Math.round(indicator.configuration.thickMargin * 100)
0126             from: 0
0127             to: 30
0128             stepSize: 1
0129             wheelEnabled: false
0130 
0131             onPressedChanged: {
0132                 if (!pressed) {
0133                     indicator.configuration.thickMargin = value / 100;
0134                 }
0135             }
0136         }
0137 
0138         PlasmaComponents.Label {
0139             text: i18nc("number in percentage, e.g. 85 %","%1 %", currentValue)
0140             horizontalAlignment: Text.AlignRight
0141             Layout.minimumWidth: theme.mSize(theme.defaultFont).width * 4
0142             Layout.maximumWidth: theme.mSize(theme.defaultFont).width * 4
0143 
0144             readonly property int currentValue: thickMarginSlider.value
0145         }
0146     }
0147 
0148     RowLayout {
0149         Layout.fillWidth: true
0150         spacing: units.smallSpacing
0151 
0152         PlasmaComponents.Label {
0153             text: i18n("Padding")
0154             horizontalAlignment: Text.AlignLeft
0155         }
0156 
0157         LatteComponents.Slider {
0158             id: lengthIntMarginSlider
0159             Layout.fillWidth: true
0160 
0161             value: Math.round(indicator.configuration.lengthPadding * 100)
0162             from: 0
0163             to: maxMargin
0164             stepSize: 1
0165             wheelEnabled: false
0166 
0167             readonly property int maxMargin: 80
0168 
0169             onPressedChanged: {
0170                 if (!pressed) {
0171                     indicator.configuration.lengthPadding = value / 100;
0172                 }
0173             }
0174         }
0175 
0176         PlasmaComponents.Label {
0177             text: i18nc("number in percentage, e.g. 85 %","%1 %", currentValue)
0178             horizontalAlignment: Text.AlignRight
0179             Layout.minimumWidth: theme.mSize(theme.defaultFont).width * 4
0180             Layout.maximumWidth: theme.mSize(theme.defaultFont).width * 4
0181 
0182             readonly property int currentValue: lengthIntMarginSlider.value
0183         }
0184     }
0185 
0186     RowLayout {
0187         Layout.fillWidth: true
0188         spacing: units.smallSpacing
0189 
0190         PlasmaComponents.Label {
0191             text: i18n("Corner Margin")
0192             horizontalAlignment: Text.AlignLeft
0193         }
0194 
0195         LatteComponents.Slider {
0196             id: backgroundCornerMarginSlider
0197             Layout.fillWidth: true
0198 
0199             value: Math.round(indicator.configuration.backgroundCornerMargin * 100)
0200             from: 0
0201             to: 100
0202             stepSize: 1
0203             wheelEnabled: false
0204 
0205             onPressedChanged: {
0206                 if (!pressed) {
0207                     indicator.configuration.backgroundCornerMargin = value / 100;
0208                 }
0209             }
0210         }
0211 
0212         PlasmaComponents.Label {
0213             text: i18nc("number in percentage, e.g. 85 %","%1 %", currentValue)
0214             horizontalAlignment: Text.AlignRight
0215             Layout.minimumWidth: theme.mSize(theme.defaultFont).width * 4
0216             Layout.maximumWidth: theme.mSize(theme.defaultFont).width * 4
0217 
0218             readonly property int currentValue: backgroundCornerMarginSlider.value
0219         }
0220     }
0221 
0222     LatteComponents.HeaderSwitch {
0223         id: glowEnabled
0224         Layout.fillWidth: true
0225         Layout.minimumHeight: implicitHeight
0226         Layout.bottomMargin: units.smallSpacing
0227 
0228         checked: indicator.configuration.glowEnabled
0229         level: 2
0230         text: i18n("Glow")
0231         tooltip: i18n("Enable/disable indicator glow")
0232 
0233         onPressed: {
0234             indicator.configuration.glowEnabled = !indicator.configuration.glowEnabled;
0235         }
0236     }
0237 
0238     RowLayout {
0239         Layout.fillWidth: true
0240         spacing: 2
0241         enabled: indicator.configuration.glowEnabled
0242 
0243         property int option: indicator.configuration.glowApplyTo
0244 
0245         readonly property int buttonsCount: 2
0246         readonly property int buttonSize: (dialog.optionsWidth - (spacing * buttonsCount-1)) / buttonsCount
0247 
0248         ExclusiveGroup {
0249             id: glowGroup
0250         }
0251 
0252         PlasmaComponents.Button {
0253             Layout.minimumWidth: parent.buttonSize
0254             Layout.maximumWidth: Layout.minimumWidth
0255             text: i18nc("glow only to active task/applet indicators","On Active")
0256             checked: parent.option === option
0257             checkable: false
0258             exclusiveGroup:  glowGroup
0259             tooltip: i18n("Add glow only to active task/applet indicator")
0260 
0261             readonly property int option: 1 /*OnActive*/
0262 
0263             onPressedChanged: {
0264                 if (pressed) {
0265                     indicator.configuration.glowApplyTo = option;
0266                 }
0267             }
0268         }
0269 
0270         PlasmaComponents.Button {
0271             Layout.minimumWidth: parent.buttonSize
0272             Layout.maximumWidth: Layout.minimumWidth
0273             text: i18nc("glow to all task/applet indicators","All")
0274             checked: parent.option === option
0275             checkable: false
0276             exclusiveGroup: glowGroup
0277             tooltip: i18n("Add glow to all task/applet indicators")
0278 
0279             readonly property int option: 2 /*All*/
0280 
0281             onPressedChanged: {
0282                 if (pressed) {
0283                     indicator.configuration.glowApplyTo = option;
0284                 }
0285             }
0286         }
0287     }
0288 
0289     RowLayout {
0290         Layout.fillWidth: true
0291         spacing: 2
0292 
0293         enabled: indicator.configuration.glowEnabled
0294 
0295         PlasmaComponents.Label {
0296             Layout.minimumWidth: implicitWidth
0297             horizontalAlignment: Text.AlignLeft
0298             Layout.rightMargin: units.smallSpacing
0299             text: i18n("Opacity")
0300         }
0301 
0302         LatteComponents.Slider {
0303             id: glowOpacitySlider
0304             Layout.fillWidth: true
0305 
0306             leftPadding: 0
0307             value: indicator.configuration.glowOpacity * 100
0308             from: 0
0309             to: 100
0310             stepSize: 5
0311             wheelEnabled: false
0312 
0313             function updateGlowOpacity() {
0314                 if (!pressed)
0315                     indicator.configuration.glowOpacity = value/100;
0316             }
0317 
0318             onPressedChanged: {
0319                 updateGlowOpacity();
0320             }
0321 
0322             Component.onCompleted: {
0323                 valueChanged.connect(updateGlowOpacity);
0324             }
0325 
0326             Component.onDestruction: {
0327                 valueChanged.disconnect(updateGlowOpacity);
0328             }
0329         }
0330 
0331         PlasmaComponents.Label {
0332             text: i18nc("number in percentage, e.g. 85 %","%1 %", glowOpacitySlider.value)
0333             horizontalAlignment: Text.AlignRight
0334             Layout.minimumWidth: theme.mSize(theme.defaultFont).width * 4
0335             Layout.maximumWidth: theme.mSize(theme.defaultFont).width * 4
0336         }
0337     }
0338 
0339     ColumnLayout {
0340         spacing: 0
0341         visible: indicator.latteTasksArePresent
0342 
0343         LatteComponents.SubHeader {
0344             enabled: indicator.configuration.glowApplyTo!==0/*None*/
0345             text: i18n("Tasks")
0346         }
0347 
0348         LatteComponents.CheckBoxesColumn {
0349             LatteComponents.CheckBox {
0350                 Layout.maximumWidth: dialog.optionsWidth
0351                 text: i18n("Different color for minimized windows")
0352                 value: indicator.configuration.minimizedTaskColoredDifferently
0353 
0354                 onClicked: {
0355                     indicator.configuration.minimizedTaskColoredDifferently = !indicator.configuration.minimizedTaskColoredDifferently;
0356                 }
0357             }
0358 
0359             LatteComponents.CheckBox {
0360                 Layout.maximumWidth: dialog.optionsWidth
0361                 text: i18n("Show an extra dot for grouped windows when active")
0362                 tooltip: i18n("Grouped windows show both a line and a dot when one of them is active and the Line Active Indicator is enabled")
0363                 enabled: indicator.configuration.activeStyle === 0 /*Line*/
0364                 value: indicator.configuration.extraDotOnActive
0365 
0366                 onClicked: {
0367                     indicator.configuration.extraDotOnActive = !indicator.configuration.extraDotOnActive;
0368                 }
0369             }
0370         }
0371     }
0372 
0373     LatteComponents.SubHeader {
0374         enabled: indicator.configuration.glowApplyTo!==0/*None*/
0375         text: i18n("Options")
0376     }
0377 
0378     LatteComponents.CheckBox {
0379         Layout.maximumWidth: dialog.optionsWidth
0380         text: i18n("Show indicators for applets")
0381         tooltip: i18n("Indicators are shown for applets")
0382         value: indicator.configuration.enabledForApplets
0383 
0384         onClicked: {
0385             indicator.configuration.enabledForApplets = !indicator.configuration.enabledForApplets;
0386         }
0387     }
0388 
0389     LatteComponents.CheckBox {
0390         Layout.maximumWidth: dialog.optionsWidth
0391         text: i18n("Reverse indicator style")
0392         value: indicator.configuration.reversed
0393 
0394         onClicked: {
0395             indicator.configuration.reversed = !indicator.configuration.reversed;
0396         }
0397     }
0398 }