From 93b1e8ec19b480b4ecc02a714db5a4c3b34e04ff Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Mon, 10 Jan 2022 20:11:43 +0100 Subject: [PATCH] Port away from PC2.Highlight Signed-off-by: Carl Schwan --- .../package/contents/ui/DashboardRepresentation.qml | 4 ++-- applets/kicker/package/contents/ui/ItemGridView.qml | 3 +-- applets/kicker/package/contents/ui/ItemListView.qml | 3 +-- .../package/contents/ui/ToolTipInstance.qml | 10 ++++------ applets/window-list/contents/ui/main.qml | 12 ++++++------ 5 files changed, 14 insertions(+), 18 deletions(-) diff --git a/applets/kicker/package/contents/ui/DashboardRepresentation.qml b/applets/kicker/package/contents/ui/DashboardRepresentation.qml index 146051042..59548686f 100644 --- a/applets/kicker/package/contents/ui/DashboardRepresentation.qml +++ b/applets/kicker/package/contents/ui/DashboardRepresentation.qml @@ -11,7 +11,7 @@ import QtQml 2.15 import org.kde.kquickcontrolsaddons 2.0 import org.kde.kwindowsystem 1.0 -import org.kde.plasma.components 2.0 as PlasmaComponents +import org.kde.plasma.components 2.0 as PlasmaComponents // For Menu import org.kde.plasma.core 2.1 as PlasmaCore import org.kde.plasma.extras 2.0 as PlasmaExtras import org.kde.plasma.private.shell 2.0 @@ -967,7 +967,7 @@ Kicker.DashboardWindow { } } - highlight: PlasmaComponents.Highlight { + highlight: PlasmaExtras.Highlight { anchors { top: filterList.currentItem ? filterList.currentItem.top : undefined left: filterList.currentItem ? filterList.currentItem.left : undefined diff --git a/applets/kicker/package/contents/ui/ItemGridView.qml b/applets/kicker/package/contents/ui/ItemGridView.qml index fcb2cb5a5..870c198f9 100644 --- a/applets/kicker/package/contents/ui/ItemGridView.qml +++ b/applets/kicker/package/contents/ui/ItemGridView.qml @@ -8,7 +8,6 @@ import QtQuick 2.15 import org.kde.draganddrop 2.0 import org.kde.kquickcontrolsaddons 2.0 -import org.kde.plasma.components 2.0 as PlasmaComponents import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.extras 2.0 as PlasmaExtras @@ -236,7 +235,7 @@ FocusScope { highlight: Item { property bool isDropPlaceHolder: "dropPlaceholderIndex" in itemGrid.model && itemGrid.currentIndex === itemGrid.model.dropPlaceholderIndex - PlasmaComponents.Highlight { + PlasmaExtras.Highlight { visible: gridView.currentItem && !isDropPlaceHolder anchors.fill: parent diff --git a/applets/kicker/package/contents/ui/ItemListView.qml b/applets/kicker/package/contents/ui/ItemListView.qml index d9390174e..29ff51da0 100644 --- a/applets/kicker/package/contents/ui/ItemListView.qml +++ b/applets/kicker/package/contents/ui/ItemListView.qml @@ -7,7 +7,6 @@ import QtQuick 2.15 import org.kde.kquickcontrolsaddons 2.0 -import org.kde.plasma.components 2.0 as PlasmaComponents import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.extras 2.0 as PlasmaExtras @@ -140,7 +139,7 @@ FocusScope { } } - highlight: PlasmaComponents.Highlight { + highlight: PlasmaExtras.Highlight { visible: listView.currentItem && !listView.currentItem.isSeparator } diff --git a/applets/taskmanager/package/contents/ui/ToolTipInstance.qml b/applets/taskmanager/package/contents/ui/ToolTipInstance.qml index d1f3545e7..311bc1298 100644 --- a/applets/taskmanager/package/contents/ui/ToolTipInstance.qml +++ b/applets/taskmanager/package/contents/ui/ToolTipInstance.qml @@ -13,8 +13,6 @@ import QtQuick.Layouts 1.1 import QtGraphicalEffects 1.0 import org.kde.plasma.core 2.0 as PlasmaCore -// for Highlight -import org.kde.plasma.components 2.0 as PlasmaComponents import org.kde.plasma.components 3.0 as PlasmaComponents3 import org.kde.plasma.extras 2.0 as PlasmaExtras @@ -91,7 +89,7 @@ ColumnLayout { textFormat: Text.PlainText } // window title - PlasmaComponents.Label { + PlasmaComponents3.Label { readonly property string title: generateTitle() id: winTitle maximumLineCount: 1 @@ -103,7 +101,7 @@ ColumnLayout { textFormat: Text.PlainText } // subtext - PlasmaComponents.Label { + PlasmaComponents3.Label { id: subtext maximumLineCount: 1 Layout.fillWidth: true @@ -157,11 +155,11 @@ ColumnLayout { // TODO: this causes XCB error message when being visible the first time readonly property var winId: toolTipDelegate.isWin && toolTipDelegate.windows[flatIndex] !== undefined ? toolTipDelegate.windows[flatIndex] : 0 - // There's no PlasmaComponents3 version - PlasmaComponents.Highlight { + PlasmaExtras.Highlight { anchors.fill: hoverHandler visible: hoverHandler.item ? hoverHandler.item.containsMouse : false pressed: hoverHandler.item ? hoverHandler.item.containsPress : false + hovered: true } Loader { diff --git a/applets/window-list/contents/ui/main.qml b/applets/window-list/contents/ui/main.qml index b645e3bba..1343811b4 100644 --- a/applets/window-list/contents/ui/main.qml +++ b/applets/window-list/contents/ui/main.qml @@ -8,7 +8,7 @@ import QtQuick.Layouts 1.1 import org.kde.plasma.plasmoid 2.0 import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.plasma.components 2.0 as PlasmaComponents +import org.kde.plasma.components 3.0 as PlasmaComponents3 import org.kde.plasma.extras 2.0 as PlasmaExtras import org.kde.taskmanager 0.1 as TaskManager @@ -100,7 +100,7 @@ FocusScope { spacing: 0 keyNavigationWraps: true - highlight: PlasmaComponents.Highlight {} + highlight: PlasmaExtras.Highlight {} highlightMoveDuration: 0 onOverflowingChanged: { @@ -117,7 +117,7 @@ FocusScope { section.property: virtualDesktopInfo.numberOfDesktops ? "VirtualDesktop" : undefined section.criteria: ViewSection.FullString - section.delegate: PlasmaComponents.Label { + section.delegate: PlasmaComponents3.Label { height: root.itemHeight width: root.width @@ -184,7 +184,7 @@ FocusScope { source: model.decoration } - PlasmaComponents.Label { + PlasmaComponents3.Label { id: label width: (parent.width - icon.width - parent.spacing - (underPin ? root.width - windowPin.x : 0)) @@ -218,7 +218,7 @@ FocusScope { } } - PlasmaComponents.ToolButton { + PlasmaComponents3.ToolButton { id: windowPin anchors.top: parent.top @@ -228,7 +228,7 @@ FocusScope { width: Math.round(PlasmaCore.Units.gridUnit * 1.25) height: width - iconSource: "window-pin" + icon.name: "window-pin" visible: plasmoid.compactRepresentationItem && plasmoid.compactRepresentationItem.visible -- GitLab