diff --git a/kcmkwin/kwineffects/package/contents/ui/Effect.qml b/kcmkwin/kwineffects/package/contents/ui/Effect.qml --- a/kcmkwin/kwineffects/package/contents/ui/Effect.qml +++ b/kcmkwin/kwineffects/package/contents/ui/Effect.qml @@ -17,31 +17,26 @@ * */ -import QtQuick 2.1 -import QtQuick.Controls 2.5 as QtControls -import QtQuick.Layouts 1.0 -import org.kde.kirigami 2.5 as Kirigami - -Rectangle { - height: row.implicitHeight +import QtQuick 2.5 +import QtQuick.Controls 2.5 as QQC2 +import QtQuick.Layouts 1.1 - Kirigami.Theme.inherit: false - Kirigami.Theme.colorSet: Kirigami.Theme.View - color: index % 2 ? Kirigami.Theme.backgroundColor : palette.alternateBase +import org.kde.kirigami 2.5 as Kirigami - RowLayout { +Kirigami.SwipeListItem { + hoverEnabled: true + onClicked: { + view.currentIndex = index; + } + contentItem: RowLayout { id: row - - x: spacing - width: parent.width - 2 * spacing - - QtControls.RadioButton { + QQC2.RadioButton { property bool _exclusive: model.ExclusiveRole != "" property bool _toggled: false checked: model.StatusRole visible: _exclusive - QtControls.ButtonGroup.group: _exclusive ? effectsList.findButtonGroup(model.ExclusiveRole) : null + QQC2.ButtonGroup.group: _exclusive ? effectsList.findButtonGroup(model.ExclusiveRole) : null onToggled: { model.StatusRole = checked ? Qt.Checked : Qt.Unchecked; @@ -56,37 +51,37 @@ } } - QtControls.CheckBox { + QQC2.CheckBox { checkState: model.StatusRole visible: model.ExclusiveRole == "" onToggled: model.StatusRole = checkState } ColumnLayout { - QtControls.Label { + QQC2.Label { Layout.fillWidth: true font.weight: Font.Bold text: model.NameRole wrapMode: Text.Wrap } - QtControls.Label { + QQC2.Label { Layout.fillWidth: true text: model.DescriptionRole wrapMode: Text.Wrap } - QtControls.Label { + QQC2.Label { id: aboutItem Layout.fillWidth: true font.weight: Font.Bold text: i18n("Author: %1\nLicense: %2", model.AuthorNameRole, model.LicenseRole) - visible: false + visible: view.currentIndex === index wrapMode: Text.Wrap } @@ -108,33 +103,20 @@ } } } - - QtControls.Button { - icon.name: "video" + } + actions: [ + Kirigami.Action { visible: model.VideoRole.toString() !== "" - - onClicked: videoItem.showHide() - } - - QtControls.Button { + icon.name: "videoclip-amarok" + tooltip: i18nc("@info:tooltip", "Show/Hide Video") + onTriggered: videoItem.showHide() + }, + Kirigami.Action { + visible: model.ConfigurableRole enabled: model.StatusRole != Qt.Unchecked icon.name: "configure" - visible: model.ConfigurableRole - - onClicked: kcm.configure(model.ServiceNameRole, this) + tooltip: i18nc("@info:tooltip", "Configure...") + onTriggered: kcm.configure(model.ServiceNameRole, this) } - - QtControls.Button { - icon.name: "dialog-information" - - onClicked: aboutItem.visible = !aboutItem.visible; - } - } - - // Kirigami.Theme doesn't provide alternate color. - SystemPalette { - id: palette - - colorGroup: SystemPalette.Active - } + ] } diff --git a/kcmkwin/kwineffects/package/contents/ui/Video.qml b/kcmkwin/kwineffects/package/contents/ui/Video.qml --- a/kcmkwin/kwineffects/package/contents/ui/Video.qml +++ b/kcmkwin/kwineffects/package/contents/ui/Video.qml @@ -18,10 +18,10 @@ * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * **************************************************************************/ -import QtQuick 2.1 -import QtQuick.Controls 1.1 -import QtQuick.Controls 2.0 as QQC2 -import QtQuick.Layouts 1.0 + +import QtQuick 2.5 +import QtQuick.Controls 2.5 as QQC2 +import QtQuick.Layouts 1.1 import QtMultimedia 5.0 as Multimedia Multimedia.Video { @@ -35,11 +35,11 @@ visible: videoItem.status == Multimedia.MediaPlayer.Loading running: true } - Button { + QQC2.Button { id: replayButton visible: false anchors.centerIn: parent - iconName: "media-playback-start" + icon.name: "media-playback-start" onClicked: { replayButton.visible = false; videoItem.play(); diff --git a/kcmkwin/kwineffects/package/contents/ui/main.qml b/kcmkwin/kwineffects/package/contents/ui/main.qml --- a/kcmkwin/kwineffects/package/contents/ui/main.qml +++ b/kcmkwin/kwineffects/package/contents/ui/main.qml @@ -16,9 +16,10 @@ * along with this program. If not, see . */ -import QtQuick 2.1 -import QtQuick.Controls 2.5 as QtControls +import QtQuick 2.5 +import QtQuick.Controls 2.5 as QQC2 import QtQuick.Layouts 1.1 + import org.kde.kcm 1.2 import org.kde.kconfig 1.0 import org.kde.kirigami 2.8 as Kirigami @@ -28,7 +29,7 @@ ConfigModule.quickHelp: i18n("This module lets you configure desktop effects.") header: ColumnLayout { - QtControls.Label { + QQC2.Label { Layout.fillWidth: true elide: Text.ElideRight @@ -42,35 +43,37 @@ Layout.fillWidth: true } - QtControls.Button { - id: configureButton + QQC2.ToolButton { + id: filterButton - QtControls.ToolTip.visible: hovered - QtControls.ToolTip.text: i18n("Configure filter") + icon.name: "view-filter" - icon.name: "configure" + checkable: true + checked: menu.opened + onClicked: menu.popup(filterButton, filterButton.width - menu.width, filterButton.height) - onClicked: menu.opened ? menu.close() : menu.open() + QQC2.ToolTip { + text: i18n("Configure Filter") + } } - QtControls.Menu { + QQC2.Menu { id: menu - x: parent.width - width - y: configureButton.height + modal: true - QtControls.MenuItem { + QQC2.MenuItem { checkable: true checked: searchModel.excludeUnsupported - text: i18n("Exclude Desktop Effects not supported by the Compositor") + text: i18n("Exclude unsupported effects") onToggled: searchModel.excludeUnsupported = checked } - QtControls.MenuItem { + QQC2.MenuItem { checkable: true checked: searchModel.excludeInternal - text: i18n("Exclude internal Desktop Effects") + text: i18n("Exclude internal effects") onToggled: searchModel.excludeInternal = checked } @@ -83,8 +86,6 @@ property var _buttonGroups: [] - spacing: Kirigami.Units.smallSpacing - model: Private.EffectsFilterProxyModel { id: searchModel @@ -97,20 +98,19 @@ } section.property: "CategoryRole" - section.delegate: Item { + section.delegate:Kirigami.AbstractListItem { width: effectsList.width - height: sectionText.implicitHeight + 2 * Kirigami.Units.smallSpacing - QtControls.Label { - id: sectionText + backgroundColor: Kirigami.Theme.backgroundColor + Kirigami.Theme.inherit: false + Kirigami.Theme.colorSet: Kirigami.Theme.Window - anchors.fill: parent + hoverEnabled: false + supportsMouseEvents: false - color: Kirigami.Theme.disabledTextColor - font.weight: Font.Bold - horizontalAlignment: Text.AlignHCenter + Kirigami.Heading { + level: 3 text: section - verticalAlignment: Text.AlignVCenter } } @@ -122,7 +122,7 @@ } let group = Qt.createQmlObject( - 'import QtQuick 2.1;' + + 'import QtQuick 2.5;' + 'import QtQuick.Controls 2.5;' + 'ButtonGroup {}', effectsList, @@ -139,7 +139,7 @@ RowLayout { Layout.alignment: Qt.AlignRight - QtControls.Button { + QQC2.Button { icon.name: "get-hot-new-stuff" text: i18n("Get New Desktop Effects...") visible: KAuthorized.authorize("ghns")