aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBj√∂rn Feber <[email protected]>2018-12-11 07:46:07 -0700
committerNate Graham <[email protected]>2018-12-11 08:01:46 -0700
commit787c39cd420ac1af856765ed18f01271ece045db (patch)
treef65641c41f46e04bf6ec47ee1ac93b45d5ba32cd
parent3feb08ec711dab55d44d409e3fc36d87ac526c02 (diff)
[kcmkwin/compositing] Remove effect list item selection, fix list item size after hiding the effect video, use a real button as the play button and use the right busy indicator
Summary: Makes some improvements to the Effects KCM (details in title). {F6464106} {F6464355} Test Plan: Open the Effects KCM. Reviewers: #kwin, #vdg, ngraham, davidedmundson Reviewed By: #kwin, #vdg, ngraham, davidedmundson Subscribers: davidedmundson, ngraham, #vdg, kwin, #kwin Tags: #kwin, #vdg Differential Revision: https://phabricator.kde.org/D17416
-rw-r--r--kcmkwin/kwincompositing/qml/Effect.qml14
-rw-r--r--kcmkwin/kwincompositing/qml/EffectView.qml1
-rw-r--r--kcmkwin/kwincompositing/qml/Video.qml27
3 files changed, 10 insertions, 32 deletions
diff --git a/kcmkwin/kwincompositing/qml/Effect.qml b/kcmkwin/kwincompositing/qml/Effect.qml
index 4b03832..752e9a7 100644
--- a/kcmkwin/kwincompositing/qml/Effect.qml
+++ b/kcmkwin/kwincompositing/qml/Effect.qml
@@ -29,17 +29,10 @@ Rectangle {
id: item
width: parent.width
height: rowEffect.implicitHeight
- color: item.ListView.isCurrentItem ? effectView.backgroundActiveColor : index % 2 ? effectView.backgroundNormalColor : effectView.backgroundAlternateColor
+ color: index % 2 ? effectView.backgroundNormalColor : effectView.backgroundAlternateColor
signal changed()
property int checkedState: model.EffectStatusRole
- MouseArea {
- anchors.fill: parent
- onClicked: {
- effectView.currentIndex = index;
- }
- }
-
RowLayout {
id: rowEffect
property int maximumWidth: parent.width - 2 * spacing
@@ -125,12 +118,15 @@ Rectangle {
Loader {
id: videoItem
active: false
+ visible: false
source: "Video.qml"
function showHide() {
if (!videoItem.active) {
videoItem.active = true;
+ videoItem.visible = true;
} else {
- videoItem.item.showHide();
+ videoItem.active = false;
+ videoItem.visible = false;
}
}
onLoaded: {
diff --git a/kcmkwin/kwincompositing/qml/EffectView.qml b/kcmkwin/kwincompositing/qml/EffectView.qml
index e92a8f3..f4b081d 100644
--- a/kcmkwin/kwincompositing/qml/EffectView.qml
+++ b/kcmkwin/kwincompositing/qml/EffectView.qml
@@ -136,7 +136,6 @@ Rectangle {
}
id: effectView
property var exclusiveGroups: []
- property color backgroundActiveColor: searchModel.backgroundActiveColor
property color backgroundNormalColor: searchModel.backgroundNormalColor
property color backgroundAlternateColor: searchModel.backgroundAlternateColor
anchors.fill: parent
diff --git a/kcmkwin/kwincompositing/qml/Video.qml b/kcmkwin/kwincompositing/qml/Video.qml
index 17c4b8d..e7a4d3d 100644
--- a/kcmkwin/kwincompositing/qml/Video.qml
+++ b/kcmkwin/kwincompositing/qml/Video.qml
@@ -20,48 +20,31 @@
**************************************************************************/
import QtQuick 2.1
import QtQuick.Controls 1.1
+import QtQuick.Controls 2.0 as QQC2
import QtQuick.Layouts 1.0
import QtMultimedia 5.0 as Multimedia
-import org.kde.kquickcontrolsaddons 2.0 as QtExtra
Multimedia.Video {
id: videoItem
- function showHide() {
- replayButton.visible = false;
- if (videoItem.visible === true) {
- videoItem.stop();
- videoItem.visible = false;
- } else {
- videoItem.visible = true;
- videoItem.play();
- }
- }
autoLoad: false
visible: false
source: model.VideoRole
width: 400
height: 400
- BusyIndicator {
+ QQC2.BusyIndicator {
anchors.centerIn: parent
visible: videoItem.status == Multimedia.MediaPlayer.Loading
running: true
}
- MouseArea {
- // it's a mouse area with icon inside to not have an ugly button background
+ Button {
id: replayButton
visible: false
- anchors.fill: parent
+ anchors.centerIn: parent
+ iconName: "media-playback-start"
onClicked: {
replayButton.visible = false;
videoItem.play();
}
- QtExtra.QIconItem {
- id: replayIcon
- anchors.centerIn: parent
- width: 16
- height: 16
- icon: "media-playback-start"
- }
Connections {
target: videoItem
onStopped: {