ConfigBehavior.qml 5.85 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/***************************************************************************
 *   Copyright (C) 2013 by Eike Hein <hein@kde.org>                        *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA .        *
 ***************************************************************************/

import QtQuick 2.0
import QtQuick.Controls 1.4 as QQC1
import QtQuick.Controls 2.5
import QtQuick.Layouts 1.12
import org.kde.kirigami 2.4 as Kirigami

import org.kde.plasma.core 2.0 as PlasmaCore

Item {
    width: childrenRect.width
    height: childrenRect.height

    property alias cfg_groupingStrategy: groupingStrategy.currentIndex
    property alias cfg_groupPopups: groupPopups.checked
    property alias cfg_onlyGroupWhenFull: onlyGroupWhenFull.checked
    property alias cfg_sortingStrategy: sortingStrategy.currentIndex
    property alias cfg_separateLaunchers: separateLaunchers.checked
    property alias cfg_middleClickAction: middleClickAction.currentIndex
    property alias cfg_wheelEnabled: wheelEnabled.checked
    property alias cfg_showOnlyCurrentScreen: showOnlyCurrentScreen.checked
    property alias cfg_showOnlyCurrentDesktop: showOnlyCurrentDesktop.checked
    property alias cfg_showOnlyCurrentActivity: showOnlyCurrentActivity.checked
    property alias cfg_showOnlyMinimized: showOnlyMinimized.checked

    Kirigami.FormLayout {
        anchors.left: parent.left
        anchors.right: parent.right

        // TODO: port to QQC2 version once we've fixed https://bugs.kde.org/show_bug.cgi?id=403153
        QQC1.ComboBox {
            id: groupingStrategy
            Kirigami.FormData.label: i18n("Group:")
            Layout.fillWidth: true
            model: [i18n("Do not group"), i18n("By program name")]
        }

        CheckBox {
            id: groupPopups
Laurent Montel's avatar
Laurent Montel committed
58
            visible: (plasmoid.pluginName !== "org.kde.plasma.icontasks")
59
60
61
62
63
            text: i18n("Open groups in popups")
            enabled: groupingStrategy.currentIndex > 0
        }

        RowLayout {
Laurent Montel's avatar
Laurent Montel committed
64
            visible: (plasmoid.pluginName !== "org.kde.plasma.icontasks")
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79

            // Indent the option as it depends on the previous one
            Item {
                width: units.largeSpacing
            }

            CheckBox {
                id: onlyGroupWhenFull
                text: i18n("Group only when the Task Manager is full")
                enabled: groupingStrategy.currentIndex > 0 && groupPopups.checked
            }
        }

        Item {
            Kirigami.FormData.isSection: true
Laurent Montel's avatar
Laurent Montel committed
80
            visible: (plasmoid.pluginName !== "org.kde.plasma.icontasks")
81
82
83
84
85
        }

        // TODO: port to QQC2 version once we've fixed https://bugs.kde.org/show_bug.cgi?id=403153
        QQC1.ComboBox {
            id: sortingStrategy
Laurent Montel's avatar
Laurent Montel committed
86
            visible: (plasmoid.pluginName !== "org.kde.plasma.icontasks")
87
88
89
90
91
92
93
            Kirigami.FormData.label: i18n("Sort:")
            Layout.fillWidth: true
            model: [i18n("Do not sort"), i18n("Manually"), i18n("Alphabetically"), i18n("By desktop"), i18n("By activity")]
        }

        CheckBox {
            id: separateLaunchers
Laurent Montel's avatar
Laurent Montel committed
94
            visible: (plasmoid.pluginName !== "org.kde.plasma.icontasks")
95
96
97
98
99
100
            text: i18n("Keep launchers separate")
            enabled: sortingStrategy.currentIndex == 1
        }

        Item {
            Kirigami.FormData.isSection: true
Laurent Montel's avatar
Laurent Montel committed
101
            visible: (plasmoid.pluginName !== "org.kde.plasma.icontasks")
102
103
104
105
106
107
108
109
110
111
112
113
        }

        // TODO: port to QQC2 version once we've fixed https://bugs.kde.org/show_bug.cgi?id=403153
        QQC1.ComboBox {
            id: middleClickAction
            Kirigami.FormData.label: i18n("On middle-click:")
            Layout.fillWidth: true
            model: [
                i18nc("The click action", "None"),
                i18n("Close window or group"),
                i18n("New instance"),
                i18n("Minimize/Restore window or group"),
114
115
                i18nc("When clicking it would toggle grouping windows of a specific app", "Group/Ungroup"),
                i18n("Bring to the current virtual desktop")
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
            ]
        }

        CheckBox {
            id: wheelEnabled
            text: i18n("Cycle through tasks with mouse wheel")
        }

        Item {
            Kirigami.FormData.isSection: true
        }

        CheckBox {
            id: showOnlyCurrentScreen
            Kirigami.FormData.label: i18n("Filter:")
            text: i18n("Show only tasks from the current screen")
        }

        CheckBox {
            id: showOnlyCurrentDesktop
            text: i18n("Show only tasks from the current desktop")
        }

        CheckBox {
            id: showOnlyCurrentActivity
            text: i18n("Show only tasks from the current activity")
        }

        CheckBox {
            id: showOnlyMinimized
            text: i18n("Show only tasks that are minimized")
        }
    }
}