From 45b34a824b2403fb6fa0fdf9ece2639e6c8bb74a Mon Sep 17 00:00:00 2001 From: Lana Black Date: Wed, 8 Jan 2025 18:59:00 +0000 Subject: [PATCH] Misc fixes in QML. --- .../contents/ui/applet/ItemWrapper.qml | 3 ++- .../contents/ui/debugger/DebugWindow.qml | 11 +++++---- .../contents/ui/editmode/ConfigOverlay.qml | 24 ++++++++++--------- containment/package/contents/ui/main.qml | 9 +++---- declarativeimports/components/Slider.qml | 3 ++- .../components/private/SwitchStyle.qml | 11 +++++---- plasmoid/package/contents/ui/main.qml | 6 ++--- .../contents/ui/previews/ToolTipDelegate2.qml | 3 +-- .../contents/ui/previews/ToolTipInstance.qml | 3 ++- .../configuration/LatteDockConfiguration.qml | 2 +- 10 files changed, 41 insertions(+), 34 deletions(-) diff --git a/containment/package/contents/ui/applet/ItemWrapper.qml b/containment/package/contents/ui/applet/ItemWrapper.qml index 25b624d06..d6311a481 100644 --- a/containment/package/contents/ui/applet/ItemWrapper.qml +++ b/containment/package/contents/ui/applet/ItemWrapper.qml @@ -11,6 +11,7 @@ import Qt5Compat.GraphicalEffects import org.kde.plasma.plasmoid 2.0 import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 3.0 as PlasmaComponents +import org.kde.plasma.extras 2.0 as PlasmaExtras import org.kde.latte.core 0.2 as LatteCore import org.kde.latte.components 1.0 as LatteComponents @@ -383,7 +384,7 @@ Item{ } } - sourceComponent: PlasmaComponents.Highlight { + sourceComponent: PlasmaExtras.Highlight { id: visualIndicatorRectangle opacity: 0 diff --git a/containment/package/contents/ui/debugger/DebugWindow.qml b/containment/package/contents/ui/debugger/DebugWindow.qml index e2100d23e..6b077e09e 100644 --- a/containment/package/contents/ui/debugger/DebugWindow.qml +++ b/containment/package/contents/ui/debugger/DebugWindow.qml @@ -8,6 +8,7 @@ import QtQuick 2.1 import QtQuick.Window 2.2 import org.kde.plasma.core 2.0 as PlasmaCore +import org.kde.plasma.components 3.0 as PlasmaComponents import org.kde.plasma.extras 2.0 as PlasmaExtras import org.kde.latte.core 0.2 as LatteCore @@ -20,14 +21,14 @@ Window{ property string space:" : " - PlasmaExtras.ScrollArea { - id: scrollArea + PlasmaComponents.ScrollView { + id: scrollView anchors.fill: parent - verticalScrollBarPolicy: Qt.ScrollBarAsNeeded - horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff + //verticalScrollBarPolicy: Qt.ScrollBarAsNeeded + //horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff - flickableItem.flickableDirection: Flickable.VerticalFlick + //flickableItem.flickableDirection: Flickable.VerticalFlick Grid{ id:mainGrid diff --git a/containment/package/contents/ui/editmode/ConfigOverlay.qml b/containment/package/contents/ui/editmode/ConfigOverlay.qml index 9137fc41d..6d278c3e8 100644 --- a/containment/package/contents/ui/editmode/ConfigOverlay.qml +++ b/containment/package/contents/ui/editmode/ConfigOverlay.qml @@ -8,6 +8,7 @@ import QtQuick 2.7 import QtQuick.Layouts 1.0 import Qt5Compat.GraphicalEffects +import org.kde.kirigami 2.5 as Kirigami import org.kde.plasma.plasmoid 2.0 import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 3.0 as PlasmaComponents @@ -303,7 +304,7 @@ MouseArea { opacity: 0.35 } - PlasmaCore.IconItem { + Kirigami.Icon { source: "transform-move" width: Math.min(144, root.metrics.iconSize) height: width @@ -443,10 +444,11 @@ MouseArea { PlasmaComponents.ToolButton { id: configureButton anchors.verticalCenter: parent.verticalCenter - iconSource: "configure" - tooltip: i18n("Configure applet") + icon.name: "configure" + // XXX: Tooltips are gone now? Investigate. + // tooltip: i18n("Configure applet") onClicked: { - tooltip.visible = false; + // tooltip.visible = false; currentApplet.applet.action("configure").trigger(); } } @@ -465,8 +467,8 @@ MouseArea { PlasmaComponents.ToolButton{ id: colorizingButton checkable: true - iconSource: "color-picker" - tooltip: i18n("Enable painting for this applet") + icon.name: "color-picker" + // tooltip: i18n("Enable painting for this applet") onClicked: { fastLayoutManager.setOption(currentApplet.applet.id, "userBlocksColorizing", !checked); @@ -476,8 +478,8 @@ MouseArea { PlasmaComponents.ToolButton{ id: lockButton checkable: true - iconSource: checked ? "lock" : "unlock" - tooltip: i18n("Disable parabolic effect for this applet") + icon.name: checked ? "lock" : "unlock" + // tooltip: i18n("Disable parabolic effect for this applet") onClicked: { fastLayoutManager.setOption(currentApplet.applet.id, "lockZoom", checked); @@ -487,10 +489,10 @@ MouseArea { PlasmaComponents.ToolButton { id: closeButton anchors.verticalCenter: parent.verticalCenter - iconSource: "delete" - tooltip: i18n("Remove applet") + icon.name: "delete" + // tooltip: i18n("Remove applet") onClicked: { - tooltip.visible = false; + // tooltip.visible = false; if(currentApplet && currentApplet.applet) currentApplet.applet.action("remove").trigger(); } diff --git a/containment/package/contents/ui/main.qml b/containment/package/contents/ui/main.qml index 3b6d232b3..138244b97 100644 --- a/containment/package/contents/ui/main.qml +++ b/containment/package/contents/ui/main.qml @@ -9,6 +9,7 @@ import QtQuick.Layouts 1.1 import QtQuick.Window 2.2 import Qt5Compat.GraphicalEffects +import org.kde.kirigami 2.20 as Kirigami import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 3.0 as PlasmaComponents import org.kde.kquickcontrolsaddons 2.0 @@ -29,7 +30,7 @@ import "layouts" as Layouts import "./background" as Background import "./debugger" as Debugger -Item { +ContainmentItem { id: root objectName: "containmentViewLayout" @@ -744,9 +745,9 @@ Item { ///////////////END components - PlasmaCore.ColorScope{ - id: colorScopePalette - } + //Kirigami.ColorSet{ + // id: colorScopePalette + //} LatteContainment.LayoutManager{ id:fastLayoutManager diff --git a/declarativeimports/components/Slider.qml b/declarativeimports/components/Slider.qml index a169eb88d..3eb066031 100644 --- a/declarativeimports/components/Slider.qml +++ b/declarativeimports/components/Slider.qml @@ -6,6 +6,7 @@ import QtQuick 2.7 import QtQuick.Templates 2.0 as T import org.kde.ksvg 1.0 as KSvg +import org.kde.kirigami 2.20 as Kirigami import org.kde.plasma.core 2.0 as PlasmaCore import "private" as Private @@ -33,7 +34,7 @@ T.Slider { KSvg.Svg { id: grooveSvg imagePath: "widgets/slider" - colorGroup: PlasmaCore.ColorScope.colorGroup + colorGroup: Kirigami.Theme.colorSet } KSvg.FrameSvgItem { diff --git a/declarativeimports/components/private/SwitchStyle.qml b/declarativeimports/components/private/SwitchStyle.qml index 35e486db9..3a44318db 100644 --- a/declarativeimports/components/private/SwitchStyle.qml +++ b/declarativeimports/components/private/SwitchStyle.qml @@ -6,6 +6,7 @@ import QtQuick 2.2 import QtQuick.Controls.Styles 1.2 as QtQuickControlStyle import QtQuick.Controls 1.2 +import org.kde.kirigami 2.20 as Kirigami import org.kde.plasma.core 2.0 as PlasmaCore QtQuickControlStyle.SwitchStyle { @@ -15,7 +16,7 @@ QtQuickControlStyle.SwitchStyle { PlasmaCore.Svg { id: switchSvg imagePath: "widgets/switch" - colorGroup: PlasmaCore.ColorScope.colorGroup + colorGroup: Kirigami.Theme.colorSet } property bool themeHasSwitch: false @@ -91,7 +92,7 @@ QtQuickControlStyle.SwitchStyle { imagePath: "widgets/slider" prefix: "groove" opacity: control.checked ? 0 : 1 - colorGroup: PlasmaCore.ColorScope.colorGroup + colorGroup: Kirigami.Theme.colorSet visible: opacity > 0 Behavior on opacity { @@ -105,7 +106,7 @@ QtQuickControlStyle.SwitchStyle { imagePath: "widgets/slider" prefix: "groove-highlight" opacity: control.checked ? 1 : 0 - colorGroup: PlasmaCore.ColorScope.colorGroup + colorGroup: Kirigami.Theme.colorSet visible: opacity > 0 Behavior on opacity { @@ -125,7 +126,7 @@ QtQuickControlStyle.SwitchStyle { imagePath: "widgets/switch" prefix: "groove" opacity: control.checked ? 0 : 1 - colorGroup: PlasmaCore.ColorScope.colorGroup + colorGroup: Kirigami.Theme.colorSet visible: opacity > 0 Component.onCompleted: styleRoot.themeHasSwitch = fromCurrentTheme; @@ -142,7 +143,7 @@ QtQuickControlStyle.SwitchStyle { imagePath: "widgets/switch" prefix: "groove-highlight" opacity: control.checked ? 1 : 0 - colorGroup: PlasmaCore.ColorScope.colorGroup + colorGroup: Kirigami.Theme.colorSet visible: opacity > 0 Behavior on opacity { diff --git a/plasmoid/package/contents/ui/main.qml b/plasmoid/package/contents/ui/main.qml index 44f6299ae..0dccc65e1 100644 --- a/plasmoid/package/contents/ui/main.qml +++ b/plasmoid/package/contents/ui/main.qml @@ -276,9 +276,9 @@ PlasmoidItem { } ///// - PlasmaCore.ColorScope{ - id: colorScopePalette - } + //Kirigami.ColorSet { + // id: colorScopePalette + //} ///UPDATE function updateListViewParent() { diff --git a/plasmoid/package/contents/ui/previews/ToolTipDelegate2.qml b/plasmoid/package/contents/ui/previews/ToolTipDelegate2.qml index b4bbe2d90..f7407bd39 100644 --- a/plasmoid/package/contents/ui/previews/ToolTipDelegate2.qml +++ b/plasmoid/package/contents/ui/previews/ToolTipDelegate2.qml @@ -16,12 +16,11 @@ import org.kde.draganddrop 2.0 import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 3.0 as PlasmaComponents -import org.kde.plasma.extras 2.0 as PlasmaExtras import org.kde.kquickcontrolsaddons 2.0 as KQuickControlsAddons import org.kde.taskmanager 0.1 as TaskManager -PlasmaExtras.ScrollArea { +PlasmaComponents.ScrollView { id: mainToolTip property Item parentTask: null property var rootIndex: [] diff --git a/plasmoid/package/contents/ui/previews/ToolTipInstance.qml b/plasmoid/package/contents/ui/previews/ToolTipInstance.qml index 91e12349d..0738daded 100644 --- a/plasmoid/package/contents/ui/previews/ToolTipInstance.qml +++ b/plasmoid/package/contents/ui/previews/ToolTipInstance.qml @@ -12,6 +12,7 @@ import QtQuick.Layouts 1.1 import Qt5Compat.GraphicalEffects import QtQml.Models 2.2 +import org.kde.kirigami 2.5 as Kirigami import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 3.0 as PlasmaComponents import org.kde.plasma.extras 2.0 as PlasmaExtras @@ -89,7 +90,7 @@ Column { anchors.horizontalCenter: parent.horizontalCenter // launcher icon - PlasmaCore.IconItem { + Kirigami.Icon { Layout.preferredWidth: units.iconSizes.medium Layout.preferredHeight: units.iconSizes.medium source: icon diff --git a/shell/package/contents/configuration/LatteDockConfiguration.qml b/shell/package/contents/configuration/LatteDockConfiguration.qml index e6981be20..9d677b903 100644 --- a/shell/package/contents/configuration/LatteDockConfiguration.qml +++ b/shell/package/contents/configuration/LatteDockConfiguration.qml @@ -385,7 +385,7 @@ Loader { border.color: dialog.borderColor } - PlasmaExtras.ScrollArea { + PlasmaComponents.ScrollView { id: scrollArea anchors.fill: parent