Warning, /plasma/latte-dock/plasmoid/package/contents/ui/config/ConfigInteraction.qml is written in an unsupported language. File is not indexed.

0001 /*
0002     SPDX-FileCopyrightText: 2016 Smith AR <audoban@openmailbox.org>
0003     SPDX-FileCopyrightText: 2016 Michail Vourlakos <mvourlakos@gmail.com>
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 import QtQuick 2.0
0008 import QtQuick.Controls 1.0
0009 import QtQuick.Layouts 1.0
0010 
0011 import org.kde.plasma.core 2.0 as PlasmaCore
0012 import org.kde.plasma.components 2.0 as PlasmaComponents
0013 
0014 import org.kde.latte.private.tasks 0.1 as LatteTasks
0015 
0016 Item {
0017     width: childrenRect.width
0018     height: childrenRect.height
0019 
0020     property bool vertical: (plasmoid.formFactor == PlasmaCore.Types.Vertical)
0021 
0022     property alias cfg_wheelEnabled: wheelEnabled.checked
0023     property alias cfg_middleClickAction: middleClickAction.currentIndex
0024     property alias cfg_hoverAction: hoverActionCmb.currentIndex
0025 
0026     property alias cfg_showOnlyCurrentScreen: showOnlyCurrentScreen.checked
0027     property alias cfg_showOnlyCurrentDesktop: showOnlyCurrentDesktop.checked
0028     property alias cfg_showOnlyCurrentActivity: showOnlyCurrentActivity.checked
0029 
0030     property alias cfg_showInfoBadge: showInfoBadgeChk.checked
0031     property alias cfg_showWindowActions: windowActionsChk.checked
0032 
0033     ColumnLayout{
0034         spacing: 15
0035 
0036         GroupBox {
0037             title: ""
0038             flat: true
0039             Layout.fillWidth: true
0040 
0041             ColumnLayout {
0042                 Layout.fillWidth: true
0043 
0044                 CheckBox {
0045                     id: wheelEnabled
0046                     text: i18n("Cycle through tasks with mouse wheel")
0047                     enabled: false
0048                 }
0049 
0050                 CheckBox {
0051                     id: windowActionsChk
0052                     Layout.fillWidth: true
0053                     text: i18n("Show window actions in the context menu")
0054                 }
0055 
0056                 CheckBox {
0057                     id: showInfoBadgeChk
0058                     Layout.fillWidth: true
0059                     text: i18n("Show progress information for tasks")
0060                 }
0061 
0062                 GridLayout {
0063                     columns: 2
0064 
0065                     Label {
0066                         text: i18n("Middle Click")
0067                     }
0068 
0069                     ComboBox {
0070                         id: middleClickAction
0071                         Layout.fillWidth: true
0072                         model: [i18nc("The click action", "None"), i18n("Close Window or Group"), i18n("New Instance"), i18n("Minimize/Restore Window or Group")]
0073                     }
0074 
0075                     Label {
0076                         text: i18n("Hover")
0077                     }
0078 
0079                     ComboBox {
0080                         id: hoverActionCmb
0081                         Layout.fillWidth: true
0082                         model: [
0083                             i18nc("none action", "None"),
0084                             i18n("Preview Windows"),
0085                             i18n("Highlight Windows"),
0086                             i18n("Preview and Highlight Windows"),
0087                         ]
0088 
0089                         currentIndex: {
0090                             switch(plasmoid.configuration.hoverAction) {
0091                             case LatteTasks.Types.NoneAction:
0092                                 return 0;
0093                             case LatteTasks.Types.PreviewWindows:
0094                                 return 1;
0095                             case LatteTasks.Types.HighlightWindows:
0096                                 return 2;
0097                             case LatteTasks.Types.PreviewAndHighlightWindows:
0098                                 return 3;
0099                             }
0100 
0101                             return 0;
0102                         }
0103 
0104                         onCurrentIndexChanged: {
0105                             switch(currentIndex) {
0106                             case 0:
0107                                 plasmoid.configuration.hoverAction = LatteTasks.Types.NoneAction;
0108                                 break;
0109                             case 1:
0110                                 plasmoid.configuration.hoverAction = LatteTasks.Types.PreviewWindows;
0111                                 break;
0112                             case 2:
0113                                 plasmoid.configuration.hoverAction = LatteTasks.Types.HighlightWindows;
0114                                 break;
0115                             case 3:
0116                                 plasmoid.configuration.hoverAction = LatteTasks.Types.PreviewAndHighlightWindows;
0117                                 break;
0118                             }
0119                         }
0120                     }
0121 
0122                 }
0123             }
0124         }
0125 
0126 
0127         ColumnLayout {
0128             Layout.fillWidth: true
0129 
0130 
0131             Label {
0132                 text: i18n("Filters")
0133                // Layout.fillWidth: true
0134                 anchors.horizontalCenter: parent.horizontalCenter
0135                // anchors.centerIn: parent
0136                 font.bold: true
0137                 font.italic: true
0138             }
0139 
0140 
0141             CheckBox {
0142                 id: showOnlyCurrentScreen
0143                 text: i18n("Show only tasks from the current screen")
0144             }
0145 
0146             CheckBox {
0147                 id: showOnlyCurrentDesktop
0148                 text: i18n("Show only tasks from the current desktop")
0149             }
0150 
0151             CheckBox {
0152                 id: showOnlyCurrentActivity
0153                 text: i18n("Show only tasks from the current activity")
0154             }
0155         }
0156 
0157     }
0158 
0159 }