From ade934a9d1dae08f8421e1afc5a3738860a50c09 Mon Sep 17 00:00:00 2001 From: Nate Graham Date: Sun, 30 Jul 2023 15:03:00 -0600 Subject: [PATCH] Port to Kirigami.Icon Part of https://invent.kde.org/plasma/plasma-workspace/-/issues/82. --- .../desktopchangeosd/package/contents/ui/osd.qml | 10 +++++----- .../kdecorations/aurorae/src/qml/AppMenuButton.qml | 7 +++---- .../kdecorations/aurorae/src/qml/MenuButton.qml | 5 ++--- src/plugins/private/qml/WindowHeapDelegate.qml | 4 +--- src/qml/frames/plasma/frame_styled.qml | 3 +-- src/qml/onscreennotification/plasma/main.qml | 2 +- .../switchers/thumbnail_grid/contents/ui/main.qml | 3 +-- 7 files changed, 14 insertions(+), 20 deletions(-) diff --git a/src/plugins/desktopchangeosd/package/contents/ui/osd.qml b/src/plugins/desktopchangeosd/package/contents/ui/osd.qml index 652424a566..093d35e349 100644 --- a/src/plugins/desktopchangeosd/package/contents/ui/osd.qml +++ b/src/plugins/desktopchangeosd/package/contents/ui/osd.qml @@ -114,12 +114,12 @@ PlasmaCore.Dialog { Item { id: arrowsContainer anchors.fill: parent - PlasmaCore.IconItem { + Kirigami.Icon { anchors.fill: parent source: "go-up" visible: false } - PlasmaCore.IconItem { + Kirigami.Icon { anchors.fill: parent source: "go-down" visible: { @@ -145,7 +145,7 @@ PlasmaCore.Dialog { return false; } } - PlasmaCore.IconItem { + Kirigami.Icon { anchors.fill: parent source: "go-up" visible: { @@ -171,7 +171,7 @@ PlasmaCore.Dialog { return false; } } - PlasmaCore.IconItem { + Kirigami.Icon { anchors.fill: parent source: "go-next" visible: { @@ -205,7 +205,7 @@ PlasmaCore.Dialog { return false; } } - PlasmaCore.IconItem { + Kirigami.Icon { anchors.fill: parent source: "go-previous" visible: { diff --git a/src/plugins/kdecorations/aurorae/src/qml/AppMenuButton.qml b/src/plugins/kdecorations/aurorae/src/qml/AppMenuButton.qml index fb91acadc1..8a5e6dbe2d 100644 --- a/src/plugins/kdecorations/aurorae/src/qml/AppMenuButton.qml +++ b/src/plugins/kdecorations/aurorae/src/qml/AppMenuButton.qml @@ -4,16 +4,15 @@ SPDX-License-Identifier: GPL-2.0-or-later */ import QtQuick -import org.kde.plasma.core as PlasmaCore +import org.kde.kirigami 2.20 as Kirigami import org.kde.kwin.decoration DecorationButton { id: appMenuButton buttonType: DecorationOptions.DecorationButtonApplicationMenu visible: decoration.client.hasApplicationMenu - PlasmaCore.IconItem { - usesPlasmaTheme: false - source: decoration.client.icon + Kirigami.Icon { anchors.fill: parent + source: decoration.client.icon } } diff --git a/src/plugins/kdecorations/aurorae/src/qml/MenuButton.qml b/src/plugins/kdecorations/aurorae/src/qml/MenuButton.qml index f584c4bfb7..4b59757ffe 100644 --- a/src/plugins/kdecorations/aurorae/src/qml/MenuButton.qml +++ b/src/plugins/kdecorations/aurorae/src/qml/MenuButton.qml @@ -5,15 +5,14 @@ */ import QtQuick import org.kde.kwin.decoration -import org.kde.plasma.core as PlasmaCore +import org.kde.kirigami 2.20 as Kirigami DecorationButton { property bool closeOnDoubleClick: decorationSettings.closeOnDoubleClickOnMenu id: menuButton buttonType: DecorationOptions.DecorationButtonMenu - PlasmaCore.IconItem { + Kirigami.Icon { anchors.fill: parent - usesPlasmaTheme: false source: decoration.client.icon } DecorationOptions { diff --git a/src/plugins/private/qml/WindowHeapDelegate.qml b/src/plugins/private/qml/WindowHeapDelegate.qml index 74c405a147..f4dcdb48f3 100644 --- a/src/plugins/private/qml/WindowHeapDelegate.qml +++ b/src/plugins/private/qml/WindowHeapDelegate.qml @@ -11,7 +11,6 @@ import org.kde.kirigami 2.20 as Kirigami import org.kde.kwin as KWinComponents import org.kde.kwin.private.effects import org.kde.plasma.components 3.0 as PC3 -import org.kde.plasma.core as PlasmaCore import org.kde.kirigami 2.20 as Kirigami import org.kde.ksvg 1.0 as KSvg @@ -155,12 +154,11 @@ Item { visible: !thumb.activeHidden } - PlasmaCore.IconItem { + Kirigami.Icon { id: icon width: Kirigami.Units.iconSizes.large height: Kirigami.Units.iconSizes.large source: thumb.window.icon - usesPlasmaTheme: false anchors.horizontalCenter: thumbSource.horizontalCenter anchors.bottom: thumbSource.bottom anchors.bottomMargin: -Math.round(height / 4) diff --git a/src/qml/frames/plasma/frame_styled.qml b/src/qml/frames/plasma/frame_styled.qml index e184ae4c1d..f2f3ad8ea4 100644 --- a/src/qml/frames/plasma/frame_styled.qml +++ b/src/qml/frames/plasma/frame_styled.qml @@ -8,7 +8,6 @@ import QtQuick import QtQuick.Layouts -import org.kde.plasma.core as PlasmaCore import org.kde.kirigami 2.20 as Kirigami import org.kde.ksvg 1.0 as KSvg import org.kde.plasma.components 3.0 as PlasmaComponents @@ -39,7 +38,7 @@ Item { } spacing: Kirigami.Units.smallSpacing - PlasmaCore.IconItem { + Kirigami.Icon { id: icon Layout.preferredWidth: root.effectFrame.iconSize.width Layout.preferredHeight: root.effectFrame.iconSize.height diff --git a/src/qml/onscreennotification/plasma/main.qml b/src/qml/onscreennotification/plasma/main.qml index b3578d48aa..5f9a1a0cb2 100644 --- a/src/qml/onscreennotification/plasma/main.qml +++ b/src/qml/onscreennotification/plasma/main.qml @@ -22,7 +22,7 @@ PlasmaCore.Dialog { mainItem: RowLayout { spacing: Kirigami.Units.smallSpacing - PlasmaCore.IconItem { + Kirigami.Icon { implicitWidth: Kirigami.Units.iconSizes.medium implicitHeight: implicitWidth source: osd.iconName diff --git a/src/tabbox/switchers/thumbnail_grid/contents/ui/main.qml b/src/tabbox/switchers/thumbnail_grid/contents/ui/main.qml index a1927124dc..19a9b2f12f 100644 --- a/src/tabbox/switchers/thumbnail_grid/contents/ui/main.qml +++ b/src/tabbox/switchers/thumbnail_grid/contents/ui/main.qml @@ -151,7 +151,7 @@ KWin.TabBoxSwitcher { wId: windowId } - PlasmaCore.IconItem { + Kirigami.Icon { anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.bottom anchors.verticalCenterOffset: Math.round(-columnLayout.spacing/2) @@ -159,7 +159,6 @@ KWin.TabBoxSwitcher { height: thumbnailGridView.iconSize source: model.icon - usesPlasmaTheme: false } PlasmaComponents3.ToolButton {