Changeset View
Changeset View
Standalone View
Standalone View
applet/contents/ui/ConfigGeneral.qml
Show All 12 Lines | 1 | /* | |||
---|---|---|---|---|---|
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | GNU General Public License for more details. | 15 | GNU General Public License for more details. | ||
16 | 16 | | |||
17 | You should have received a copy of the GNU General Public License | 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/>. | 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | import QtQuick 2.0 | 21 | import QtQuick 2.5 | ||
22 | import QtQuick.Layouts 1.0 | 22 | import QtQuick.Layouts 1.3 | ||
23 | import QtQuick.Controls 1.0 | 23 | import QtQuick.Controls 2.5 as QQC2 | ||
24 | | ||||
25 | import org.kde.kirigami 2.5 as Kirigami | ||||
24 | 26 | | |||
25 | import org.kde.plasma.private.volume 0.1 | 27 | import org.kde.plasma.private.volume 0.1 | ||
26 | 28 | | |||
27 | Item { | 29 | Kirigami.FormLayout { | ||
28 | property alias cfg_maximumVolume: maximumVolume.value | 30 | property alias cfg_maximumVolume: maximumVolume.value | ||
29 | property alias cfg_volumeStep: volumeStep.value | 31 | property alias cfg_volumeStep: volumeStep.value | ||
30 | property alias cfg_volumeFeedback: volumeFeedback.checked | 32 | property alias cfg_volumeFeedback: volumeFeedback.checked | ||
31 | property alias cfg_outputChangeOsd: outputChangeOsd.checked | 33 | property alias cfg_outputChangeOsd: outputChangeOsd.checked | ||
32 | 34 | | |||
33 | ColumnLayout { | 35 | VolumeFeedback { | ||
34 | Layout.fillWidth: true | 36 | id: feedback | ||
37 | } | ||||
35 | 38 | | |||
36 | GroupBox { | | |||
37 | Layout.fillWidth: true | | |||
38 | flat: true | | |||
39 | title: i18n("Volume") | | |||
40 | 39 | | |||
41 | GridLayout { | 40 | QQC2.SpinBox { | ||
42 | columns: 2 | 41 | id: maximumVolume | ||
43 | Layout.fillWidth: true | | |||
44 | 42 | | |||
45 | Label { | 43 | Kirigami.FormData.label: i18n("Maximum volume:") | ||
46 | Layout.alignment: Qt.AlignRight | | |||
47 | text: i18n("Maximum volume:") | | |||
48 | } | | |||
49 | 44 | | |||
50 | SpinBox { | 45 | from: 100 | ||
51 | id: maximumVolume | 46 | to: 150 | ||
52 | minimumValue: 100 | | |||
53 | maximumValue: 150 | | |||
54 | stepSize: 1 | 47 | stepSize: 1 | ||
55 | suffix: i18n("%") | 48 | textFromValue: function(value) { | ||
49 | return value + "%"; | ||||
56 | } | 50 | } | ||
57 | | ||||
58 | Label { | | |||
59 | Layout.alignment: Qt.AlignRight | | |||
60 | text: i18n("Volume step:") | | |||
61 | } | 51 | } | ||
62 | 52 | | |||
63 | SpinBox { | 53 | QQC2.SpinBox { | ||
64 | id: volumeStep | 54 | id: volumeStep | ||
65 | minimumValue: 1 | 55 | implicitWidth: maximumVolume.width | ||
66 | maximumValue: 100 | 56 | | ||
57 | Kirigami.FormData.label: i18n("Volume step:") | ||||
58 | | ||||
59 | from: 1 | ||||
60 | to: 100 | ||||
67 | stepSize: 1 | 61 | stepSize: 1 | ||
68 | suffix: i18n("%") | 62 | textFromValue: function(value) { | ||
63 | return value + "%"; | ||||
69 | } | 64 | } | ||
70 | } | 65 | } | ||
66 | | ||||
67 | | ||||
68 | Item { | ||||
69 | Kirigami.FormData.isSection: true | ||||
71 | } | 70 | } | ||
72 | 71 | | |||
73 | GroupBox { | | |||
74 | Layout.fillWidth: true | | |||
75 | flat: true | | |||
76 | title: i18n("Behavior") | | |||
77 | 72 | | |||
78 | ColumnLayout { | 73 | QQC2.CheckBox { | ||
79 | CheckBox { | | |||
80 | id: volumeFeedback | 74 | id: volumeFeedback | ||
81 | text: i18n("Volume feedback") | 75 | | ||
76 | Kirigami.FormData.label: i18n("Provide visual feedback:") | ||||
77 | | ||||
78 | text: i18n("When volume changes") | ||||
82 | enabled: feedback.valid | 79 | enabled: feedback.valid | ||
83 | } | 80 | } | ||
84 | 81 | | |||
85 | CheckBox { | 82 | QQC2.CheckBox { | ||
86 | id: outputChangeOsd | 83 | id: outputChangeOsd | ||
87 | text: i18n("Visual feedback when default output device changes") | 84 | text: i18n("When default output device changes") | ||
88 | } | | |||
89 | } | | |||
90 | } | | |||
91 | } | | |||
92 | | ||||
93 | VolumeFeedback { | | |||
94 | id: feedback | | |||
95 | } | 85 | } | ||
96 | } | 86 | } |