2018-11-29 15:57:35 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2018 Eike Hein <hein@kde.org>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library 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
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public License
|
|
|
|
* along with this library; see the file COPYING.LIB. If not, write to
|
|
|
|
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
import QtQuick 2.1
|
|
|
|
import QtQuick.Layouts 1.1
|
|
|
|
import QtQuick.Controls 2.4 as QtControls
|
|
|
|
import org.kde.kirigami 2.5 as Kirigami
|
|
|
|
import org.kde.plasma.core 2.1 as PlasmaCore
|
|
|
|
import org.kde.kcm 1.2
|
|
|
|
|
|
|
|
ScrollViewKCM {
|
|
|
|
id: root
|
|
|
|
|
|
|
|
ConfigModule.quickHelp: i18n("Virtual Desktops")
|
|
|
|
|
|
|
|
Connections {
|
|
|
|
target: kcm.desktopsModel
|
|
|
|
|
|
|
|
onReadyChanged: {
|
|
|
|
rowsSpinBox.value = kcm.desktopsModel.rows;
|
|
|
|
}
|
|
|
|
|
|
|
|
onRowsChanged: {
|
|
|
|
rowsSpinBox.value = kcm.desktopsModel.rows;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: desktopsListItemComponent
|
|
|
|
|
|
|
|
Kirigami.SwipeListItem {
|
|
|
|
id: listItem
|
|
|
|
|
|
|
|
contentItem: RowLayout {
|
|
|
|
QtControls.TextField {
|
|
|
|
id: nameField
|
|
|
|
|
|
|
|
background: null
|
|
|
|
leftPadding: Kirigami.Units.largeSpacing
|
|
|
|
topPadding: 0
|
|
|
|
bottomPadding: 0
|
|
|
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
|
|
|
Layout.alignment: Qt.AlignVCenter
|
|
|
|
|
|
|
|
text: model.display
|
|
|
|
|
|
|
|
readOnly: true
|
|
|
|
|
|
|
|
onEditingFinished: {
|
|
|
|
readOnly = true;
|
|
|
|
Qt.callLater(kcm.desktopsModel.setDesktopName, model.Id, text);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
actions: [
|
|
|
|
Kirigami.Action {
|
|
|
|
enabled: !model.IsMissing
|
|
|
|
iconName: "edit-rename"
|
|
|
|
tooltip: i18nc("@info:tooltip", "Rename")
|
|
|
|
onTriggered: {
|
|
|
|
nameField.readOnly = false;
|
|
|
|
nameField.selectAll();
|
|
|
|
nameField.forceActiveFocus();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
Kirigami.Action {
|
|
|
|
enabled: !model.IsMissing
|
|
|
|
iconName: "list-remove"
|
|
|
|
tooltip: i18nc("@info:tooltip", "Remove")
|
|
|
|
onTriggered: kcm.desktopsModel.removeDesktop(model.Id)
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
header: ColumnLayout {
|
|
|
|
id: messagesLayout
|
|
|
|
|
|
|
|
spacing: Kirigami.Units.largeSpacing
|
|
|
|
|
|
|
|
Kirigami.InlineMessage {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
|
|
|
type: Kirigami.MessageType.Error
|
|
|
|
|
|
|
|
text: kcm.desktopsModel.error
|
|
|
|
|
|
|
|
visible: kcm.desktopsModel.error != ""
|
|
|
|
}
|
|
|
|
|
|
|
|
Kirigami.InlineMessage {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
|
|
|
type: Kirigami.MessageType.Information
|
|
|
|
|
|
|
|
text: i18n("Virtual desktops have been changed outside this settings application. Saving now will overwrite the changes.")
|
|
|
|
|
|
|
|
visible: kcm.desktopsModel.serverModified
|
|
|
|
}
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
QtControls.Label {
|
|
|
|
text: i18n("Rows:")
|
|
|
|
}
|
|
|
|
|
|
|
|
QtControls.SpinBox {
|
|
|
|
id: rowsSpinBox
|
|
|
|
|
|
|
|
from: 1
|
|
|
|
to: 20
|
|
|
|
|
|
|
|
onValueModified: kcm.desktopsModel.rows = value
|
|
|
|
}
|
|
|
|
|
|
|
|
Item { // Spacer
|
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
|
|
|
|
|
|
|
QtControls.Button {
|
|
|
|
Layout.alignment: Qt.AlignRight
|
|
|
|
|
|
|
|
text: i18nc("@action:button", "Add")
|
|
|
|
icon.name: "list-add"
|
|
|
|
|
|
|
|
onClicked: kcm.desktopsModel.createDesktop(i18n("New Desktop"))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
view: ListView {
|
|
|
|
id: desktopsList
|
|
|
|
|
|
|
|
model: kcm.desktopsModel.ready ? kcm.desktopsModel : null
|
|
|
|
|
|
|
|
section.property: "DesktopRow"
|
|
|
|
section.delegate: Kirigami.AbstractListItem {
|
|
|
|
width: desktopsList.width
|
|
|
|
|
|
|
|
backgroundColor: Kirigami.Theme.backgroundColor
|
|
|
|
|
|
|
|
hoverEnabled: false
|
|
|
|
supportsMouseEvents: false
|
|
|
|
|
|
|
|
Kirigami.Theme.inherit: false
|
|
|
|
Kirigami.Theme.colorSet: Kirigami.Theme.Window
|
|
|
|
|
|
|
|
QtControls.Label {
|
|
|
|
text: i18n("Row %1", section)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
delegate: Kirigami.DelegateRecycler {
|
|
|
|
width: desktopsList.width
|
|
|
|
|
|
|
|
sourceComponent: desktopsListItemComponent
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-16 15:16:40 +00:00
|
|
|
footer: Kirigami.FormLayout {
|
|
|
|
Connections {
|
|
|
|
target: kcm
|
2018-11-29 15:57:35 +00:00
|
|
|
|
2019-01-16 15:16:40 +00:00
|
|
|
onNavWrapsChanged: navWraps.checked = kcm.navWraps
|
2018-11-29 15:57:35 +00:00
|
|
|
|
2019-01-16 15:16:40 +00:00
|
|
|
onOsdEnabledChanged: osdEnabled.checked = kcm.osdEnabled
|
|
|
|
onOsdDurationChanged: osdDuration.value = kcm.osdDuration
|
|
|
|
onOsdTextOnlyChanged: osdTextOnly.checked = !kcm.osdTextOnly
|
|
|
|
}
|
2018-11-29 15:57:35 +00:00
|
|
|
|
2019-01-16 15:16:40 +00:00
|
|
|
QtControls.CheckBox {
|
|
|
|
id: navWraps
|
2018-11-29 15:57:35 +00:00
|
|
|
|
2019-01-16 15:16:40 +00:00
|
|
|
Kirigami.FormData.label: i18n("Options:")
|
2018-11-29 15:57:35 +00:00
|
|
|
|
2019-01-16 15:16:40 +00:00
|
|
|
text: i18n("Navigation wraps around")
|
2018-11-29 15:57:35 +00:00
|
|
|
|
2019-01-16 15:16:40 +00:00
|
|
|
checked: kcm.navWraps
|
2018-11-29 15:57:35 +00:00
|
|
|
|
2019-01-16 15:16:40 +00:00
|
|
|
onCheckedChanged: kcm.navWraps = checked
|
|
|
|
}
|
[kcmkwin/desktop] Add animation option back
Summary:
The "new" animation option no longer uses hard coded effects, which
means one could install a third party virtual desktop switching animation,
for example from store.kde.org, and it will be displayed in the KCM.
Test Plan: {F6503565}
Reviewers: #kwin, #vdg, ngraham, davidedmundson
Reviewed By: #kwin, #vdg, ngraham, davidedmundson
Subscribers: davidedmundson, hein, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17766
2018-12-22 23:12:51 +00:00
|
|
|
|
2019-01-16 15:16:40 +00:00
|
|
|
RowLayout {
|
|
|
|
Layout.fillWidth: true
|
[kcmkwin/desktop] Add animation option back
Summary:
The "new" animation option no longer uses hard coded effects, which
means one could install a third party virtual desktop switching animation,
for example from store.kde.org, and it will be displayed in the KCM.
Test Plan: {F6503565}
Reviewers: #kwin, #vdg, ngraham, davidedmundson
Reviewed By: #kwin, #vdg, ngraham, davidedmundson
Subscribers: davidedmundson, hein, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17766
2018-12-22 23:12:51 +00:00
|
|
|
|
2019-01-16 15:16:40 +00:00
|
|
|
QtControls.CheckBox {
|
|
|
|
id: animationEnabled
|
[kcmkwin/desktop] Add animation option back
Summary:
The "new" animation option no longer uses hard coded effects, which
means one could install a third party virtual desktop switching animation,
for example from store.kde.org, and it will be displayed in the KCM.
Test Plan: {F6503565}
Reviewers: #kwin, #vdg, ngraham, davidedmundson
Reviewed By: #kwin, #vdg, ngraham, davidedmundson
Subscribers: davidedmundson, hein, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17766
2018-12-22 23:12:51 +00:00
|
|
|
|
2019-01-16 15:16:40 +00:00
|
|
|
text: i18n("Show animation when switching:")
|
[kcmkwin/desktop] Add animation option back
Summary:
The "new" animation option no longer uses hard coded effects, which
means one could install a third party virtual desktop switching animation,
for example from store.kde.org, and it will be displayed in the KCM.
Test Plan: {F6503565}
Reviewers: #kwin, #vdg, ngraham, davidedmundson
Reviewed By: #kwin, #vdg, ngraham, davidedmundson
Subscribers: davidedmundson, hein, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17766
2018-12-22 23:12:51 +00:00
|
|
|
|
2019-01-16 15:16:40 +00:00
|
|
|
checked: kcm.animationsModel.enabled
|
[kcmkwin/desktop] Add animation option back
Summary:
The "new" animation option no longer uses hard coded effects, which
means one could install a third party virtual desktop switching animation,
for example from store.kde.org, and it will be displayed in the KCM.
Test Plan: {F6503565}
Reviewers: #kwin, #vdg, ngraham, davidedmundson
Reviewed By: #kwin, #vdg, ngraham, davidedmundson
Subscribers: davidedmundson, hein, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17766
2018-12-22 23:12:51 +00:00
|
|
|
|
2019-01-16 15:16:40 +00:00
|
|
|
onCheckedChanged: kcm.animationsModel.enabled = checked
|
|
|
|
}
|
[kcmkwin/desktop] Add animation option back
Summary:
The "new" animation option no longer uses hard coded effects, which
means one could install a third party virtual desktop switching animation,
for example from store.kde.org, and it will be displayed in the KCM.
Test Plan: {F6503565}
Reviewers: #kwin, #vdg, ngraham, davidedmundson
Reviewed By: #kwin, #vdg, ngraham, davidedmundson
Subscribers: davidedmundson, hein, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17766
2018-12-22 23:12:51 +00:00
|
|
|
|
2019-01-16 15:16:40 +00:00
|
|
|
QtControls.ComboBox {
|
|
|
|
enabled: animationEnabled.checked
|
[kcmkwin/desktop] Add animation option back
Summary:
The "new" animation option no longer uses hard coded effects, which
means one could install a third party virtual desktop switching animation,
for example from store.kde.org, and it will be displayed in the KCM.
Test Plan: {F6503565}
Reviewers: #kwin, #vdg, ngraham, davidedmundson
Reviewed By: #kwin, #vdg, ngraham, davidedmundson
Subscribers: davidedmundson, hein, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17766
2018-12-22 23:12:51 +00:00
|
|
|
|
2019-01-16 15:16:40 +00:00
|
|
|
model: kcm.animationsModel
|
|
|
|
textRole: "NameRole"
|
|
|
|
currentIndex: kcm.animationsModel.currentIndex
|
|
|
|
onActivated: kcm.animationsModel.currentIndex = currentIndex
|
|
|
|
}
|
[kcmkwin/desktop] Add animation option back
Summary:
The "new" animation option no longer uses hard coded effects, which
means one could install a third party virtual desktop switching animation,
for example from store.kde.org, and it will be displayed in the KCM.
Test Plan: {F6503565}
Reviewers: #kwin, #vdg, ngraham, davidedmundson
Reviewed By: #kwin, #vdg, ngraham, davidedmundson
Subscribers: davidedmundson, hein, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17766
2018-12-22 23:12:51 +00:00
|
|
|
|
2019-01-16 15:16:40 +00:00
|
|
|
QtControls.Button {
|
|
|
|
enabled: animationEnabled.checked && kcm.animationsModel.currentConfigurable
|
[kcmkwin/desktop] Add animation option back
Summary:
The "new" animation option no longer uses hard coded effects, which
means one could install a third party virtual desktop switching animation,
for example from store.kde.org, and it will be displayed in the KCM.
Test Plan: {F6503565}
Reviewers: #kwin, #vdg, ngraham, davidedmundson
Reviewed By: #kwin, #vdg, ngraham, davidedmundson
Subscribers: davidedmundson, hein, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17766
2018-12-22 23:12:51 +00:00
|
|
|
|
2019-01-16 15:16:40 +00:00
|
|
|
icon.name: "configure"
|
[kcmkwin/desktop] Add animation option back
Summary:
The "new" animation option no longer uses hard coded effects, which
means one could install a third party virtual desktop switching animation,
for example from store.kde.org, and it will be displayed in the KCM.
Test Plan: {F6503565}
Reviewers: #kwin, #vdg, ngraham, davidedmundson
Reviewed By: #kwin, #vdg, ngraham, davidedmundson
Subscribers: davidedmundson, hein, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17766
2018-12-22 23:12:51 +00:00
|
|
|
|
2019-01-16 15:16:40 +00:00
|
|
|
onClicked: kcm.configureAnimation()
|
|
|
|
}
|
[kcmkwin/desktop] Add animation option back
Summary:
The "new" animation option no longer uses hard coded effects, which
means one could install a third party virtual desktop switching animation,
for example from store.kde.org, and it will be displayed in the KCM.
Test Plan: {F6503565}
Reviewers: #kwin, #vdg, ngraham, davidedmundson
Reviewed By: #kwin, #vdg, ngraham, davidedmundson
Subscribers: davidedmundson, hein, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17766
2018-12-22 23:12:51 +00:00
|
|
|
|
2019-01-16 15:16:40 +00:00
|
|
|
QtControls.Button {
|
|
|
|
enabled: animationEnabled.checked
|
[kcmkwin/desktop] Add animation option back
Summary:
The "new" animation option no longer uses hard coded effects, which
means one could install a third party virtual desktop switching animation,
for example from store.kde.org, and it will be displayed in the KCM.
Test Plan: {F6503565}
Reviewers: #kwin, #vdg, ngraham, davidedmundson
Reviewed By: #kwin, #vdg, ngraham, davidedmundson
Subscribers: davidedmundson, hein, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17766
2018-12-22 23:12:51 +00:00
|
|
|
|
2019-01-16 15:16:40 +00:00
|
|
|
icon.name: "dialog-information"
|
[kcmkwin/desktop] Add animation option back
Summary:
The "new" animation option no longer uses hard coded effects, which
means one could install a third party virtual desktop switching animation,
for example from store.kde.org, and it will be displayed in the KCM.
Test Plan: {F6503565}
Reviewers: #kwin, #vdg, ngraham, davidedmundson
Reviewed By: #kwin, #vdg, ngraham, davidedmundson
Subscribers: davidedmundson, hein, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17766
2018-12-22 23:12:51 +00:00
|
|
|
|
2019-01-16 15:16:40 +00:00
|
|
|
onClicked: kcm.showAboutAnimation()
|
[kcmkwin/desktop] Add animation option back
Summary:
The "new" animation option no longer uses hard coded effects, which
means one could install a third party virtual desktop switching animation,
for example from store.kde.org, and it will be displayed in the KCM.
Test Plan: {F6503565}
Reviewers: #kwin, #vdg, ngraham, davidedmundson
Reviewed By: #kwin, #vdg, ngraham, davidedmundson
Subscribers: davidedmundson, hein, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D17766
2018-12-22 23:12:51 +00:00
|
|
|
}
|
|
|
|
|
2019-01-16 15:16:40 +00:00
|
|
|
Item {
|
2018-11-29 15:57:35 +00:00
|
|
|
Layout.fillWidth: true
|
2019-01-16 15:16:40 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
Layout.fillWidth: true
|
2018-11-29 15:57:35 +00:00
|
|
|
|
2019-01-16 15:16:40 +00:00
|
|
|
QtControls.CheckBox {
|
|
|
|
id: osdEnabled
|
2018-11-29 15:57:35 +00:00
|
|
|
|
2019-01-16 15:16:40 +00:00
|
|
|
text: i18n("Show on-screen display when switching:")
|
2018-11-29 15:57:35 +00:00
|
|
|
|
2019-01-16 15:16:40 +00:00
|
|
|
checked: kcm.osdEnabled
|
2018-11-29 15:57:35 +00:00
|
|
|
|
2019-01-16 15:16:40 +00:00
|
|
|
onToggled: kcm.osdEnabled = checked
|
|
|
|
}
|
2018-11-29 15:57:35 +00:00
|
|
|
|
2019-01-16 15:16:40 +00:00
|
|
|
QtControls.SpinBox {
|
|
|
|
id: osdDuration
|
2018-11-29 15:57:35 +00:00
|
|
|
|
2019-01-16 15:16:40 +00:00
|
|
|
enabled: osdEnabled.checked
|
2018-12-23 12:16:22 +00:00
|
|
|
|
2019-01-16 15:16:40 +00:00
|
|
|
from: 0
|
|
|
|
to: 10000
|
|
|
|
stepSize: 100
|
2018-11-29 15:57:35 +00:00
|
|
|
|
2019-01-16 15:16:40 +00:00
|
|
|
textFromValue: function(value, locale) { return i18n("%1 ms", value)}
|
2018-11-29 15:57:35 +00:00
|
|
|
|
2019-01-16 15:16:40 +00:00
|
|
|
value: kcm.osdDuration
|
2018-11-29 15:57:35 +00:00
|
|
|
|
2019-01-16 15:16:40 +00:00
|
|
|
onValueChanged: kcm.osdDuration = value
|
2018-11-29 15:57:35 +00:00
|
|
|
}
|
2019-01-16 15:16:40 +00:00
|
|
|
}
|
2018-11-29 15:57:35 +00:00
|
|
|
|
2019-01-16 15:16:40 +00:00
|
|
|
RowLayout {
|
|
|
|
Layout.fillWidth: true
|
2018-11-29 15:57:35 +00:00
|
|
|
|
2019-01-16 15:16:40 +00:00
|
|
|
Item {
|
|
|
|
width: units.largeSpacing
|
|
|
|
}
|
2018-11-29 15:57:35 +00:00
|
|
|
|
2019-01-16 15:16:40 +00:00
|
|
|
QtControls.CheckBox {
|
|
|
|
id: osdTextOnly
|
2018-11-29 15:57:35 +00:00
|
|
|
|
2019-01-16 15:16:40 +00:00
|
|
|
enabled: osdEnabled.checked
|
2018-11-29 15:57:35 +00:00
|
|
|
|
2019-01-16 15:16:40 +00:00
|
|
|
text: i18n("Show desktop layout indicators")
|
2018-11-29 15:57:35 +00:00
|
|
|
|
2019-01-16 15:16:40 +00:00
|
|
|
checked: !kcm.osdTextOnly
|
2018-11-29 15:57:35 +00:00
|
|
|
|
2019-01-16 15:16:40 +00:00
|
|
|
onToggled: kcm.osdTextOnly = !checked
|
2018-11-29 15:57:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|