Changeset View
Changeset View
Standalone View
Standalone View
kcmkwin/kwindecoration/package/contents/ui/Options.qml
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | * Copyright (c) 2019 Valerio Pilo <vpilo@coldshock.net> | ||||
3 | * | ||||
4 | * This program is free software; you can redistribute it and/or | ||||
5 | * modify it under the terms of the GNU General Public License as | ||||
6 | * published by the Free Software Foundation; either version 2 of | ||||
7 | * the License or (at your option) version 3 or any later version | ||||
8 | * accepted by the membership of KDE e.V. (or its successor approved | ||||
9 | * by the membership of KDE e.V.), which shall act as a proxy | ||||
10 | * defined in Section 14 of version 3 of the license. | ||||
11 | * | ||||
12 | * This program is distributed in the hope that it will be useful, | ||||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
15 | * GNU General Public License for more details. | ||||
16 | * | ||||
17 | * You should have received a copy of the GNU General Public License | ||||
18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||||
19 | */ | ||||
20 | | ||||
21 | import QtQuick 2.7 | ||||
22 | import QtQuick.Layouts 1.3 | ||||
23 | import QtQuick.Controls 2.4 as Controls | ||||
24 | import org.kde.kirigami 2.4 as Kirigami | ||||
25 | import org.kde.plasma.core 2.0 as PlasmaCore | ||||
26 | import org.kde.kwin.private.kdecoration 1.0 as KDecoration | ||||
27 | | ||||
28 | Kirigami.FormLayout { | ||||
29 | Layout.fillWidth: true | ||||
30 | | ||||
31 | RowLayout { | ||||
32 | Controls.Label { | ||||
33 | Layout.alignment: Qt.AlignRight | ||||
34 | text: i18ndc("kcm_kwindecoration", "combobox label", "Window border size") | ||||
35 | } | ||||
36 | | ||||
37 | Controls.ComboBox { | ||||
38 | id: borderSizeComboBox | ||||
39 | Kirigami.FormData.label: i18ndc("kcm_kwindecoration", "section title", "Decorations customizations:") | ||||
40 | model: kcm.borderSizesModel | ||||
41 | currentIndex: kcm.borderSize | ||||
42 | onActivated: { | ||||
43 | kcm.borderSize = currentIndex | ||||
44 | } | ||||
45 | } | ||||
46 | } | ||||
47 | | ||||
48 | Controls.CheckBox { | ||||
49 | id: closeOnDoubleClickOnMenuCheckBox | ||||
50 | text: i18ndc("kcm_kwindecoration", "checkbox label", "Close windows by double clicking the menu button") | ||||
51 | checked: kcm.closeOnDoubleClickOnMenu | ||||
52 | onCheckedChanged: { | ||||
53 | kcm.closeOnDoubleClickOnMenu = checked | ||||
54 | } | ||||
55 | } | ||||
56 | Controls.Label { | ||||
57 | id: closeOnDoubleClickOnMenuLabel | ||||
58 | opacity: kcm.closeOnDoubleClickOnMenu | ||||
59 | text: i18ndc("kcm_kwindecoration", "popup tip", "Close by double clicking:\nTo open the menu, keep the button pressed until it appears.") | ||||
60 | font.italic: true | ||||
61 | } | ||||
62 | | ||||
63 | Connections { | ||||
64 | target: kcm | ||||
65 | onBorderSizeChanged: { | ||||
66 | borderSizeComboBox.currentIndex = kcm.borderSize | ||||
67 | } | ||||
68 | onCloseOnDoubleClickOnMenuChanged: { | ||||
69 | closeOnDoubleClickOnMenuCheckBox.checked = kcm.closeOnDoubleClickOnMenu | ||||
70 | closeOnDoubleClickOnMenuLabel.opacity = kcm.closeOnDoubleClickOnMenu | ||||
71 | } | ||||
72 | } | ||||
73 | } |