From 1963340d4f2dfa38064f890ec6fc63a46cf77c03 Mon Sep 17 00:00:00 2001 From: Devin Lin Date: Mon, 24 Jul 2023 22:24:10 -0400 Subject: [PATCH] Switch some uses of IconItem to Kirigami.Icon, and fix some theme porting --- .../quicksettings/QuickSettingsDrawer.qml | 4 +++- .../quicksettings/QuickSettingsPanel.qml | 4 +++- .../mobileshell/qml/components/StartupFeedback.qml | 4 +--- .../qml/navigationpanel/NavigationPanelButton.qml | 1 - components/mobileshell/qml/statusbar/ClockText.qml | 2 ++ components/mobileshell/qml/statusbar/StatusBar.qml | 12 +++--------- components/mobileshell/qml/statusbar/TaskWidget.qml | 8 +++----- .../qml/statusbar/indicators/BluetoothIndicator.qml | 4 +--- .../qml/statusbar/indicators/InternetIndicator.qml | 6 ++---- .../statusbar/indicators/SignalStrengthIndicator.qml | 5 ++--- .../qml/statusbar/indicators/VolumeIndicator.qml | 7 ++----- containments/panel/package/contents/ui/main.qml | 4 +++- .../package/contents/ui/NavigationPanelComponent.qml | 5 ++++- initialstart/qml/Wizard.qml | 1 - kwin/mobiletaskswitcher/qml/TaskSwitcher.qml | 2 +- 15 files changed, 30 insertions(+), 39 deletions(-) diff --git a/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsDrawer.qml b/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsDrawer.qml index a600ed48..a6a75b50 100644 --- a/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsDrawer.qml +++ b/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsDrawer.qml @@ -80,7 +80,9 @@ Components.BaseItem { Layout.fillWidth: true Layout.preferredHeight: Components.Constants.topPanelHeight + Kirigami.Units.gridUnit * 0.8 - colorGroup: Kirigami.Theme.Window + Kirigami.Theme.colorSet: Kirigami.Theme.Window + Kirigami.Theme.inherit: false + backgroundColor: "transparent" showSecondRow: true showDropShadow: false diff --git a/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsPanel.qml b/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsPanel.qml index a6c023e1..5ef5a965 100644 --- a/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsPanel.qml +++ b/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsPanel.qml @@ -63,7 +63,9 @@ Components.BaseItem { Layout.preferredHeight: Kirigami.Units.gridUnit * 1.5 Layout.maximumHeight: Kirigami.Units.gridUnit * 1.5 - colorGroup: Kirigami.Theme.Window + Kirigami.Theme.colorSet: Kirigami.Theme.Window + Kirigami.Theme.inherit: false + backgroundColor: "transparent" showSecondRow: false showDropShadow: false diff --git a/components/mobileshell/qml/components/StartupFeedback.qml b/components/mobileshell/qml/components/StartupFeedback.qml index 2b709712..b1ea49fe 100644 --- a/components/mobileshell/qml/components/StartupFeedback.qml +++ b/components/mobileshell/qml/components/StartupFeedback.qml @@ -6,7 +6,6 @@ import QtQuick import QtQuick.Effects import QtQuick.Layouts import QtQuick.Window -import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.kirigami as Kirigami @@ -183,10 +182,9 @@ MouseArea { // use mousearea to ensure clicks don't go behind width: Kirigami.Units.iconSizes.enormous height: width - PlasmaCore.IconItem { + Kirigami.Icon { id: icon anchors.fill: parent - colorGroup: Kirigami.Theme.ComplementaryColorGroup } MultiEffect { diff --git a/components/mobileshell/qml/navigationpanel/NavigationPanelButton.qml b/components/mobileshell/qml/navigationpanel/NavigationPanelButton.qml index 9bf682a3..db15328f 100644 --- a/components/mobileshell/qml/navigationpanel/NavigationPanelButton.qml +++ b/components/mobileshell/qml/navigationpanel/NavigationPanelButton.qml @@ -70,6 +70,5 @@ Controls.AbstractButton { fill: parent margins: Math.round((side - side * iconSizeFactor * 0.6) / 2) } - colorSet: Kirigami.Theme.colorSet } } diff --git a/components/mobileshell/qml/statusbar/ClockText.qml b/components/mobileshell/qml/statusbar/ClockText.qml index 463b6b95..b8fa908f 100644 --- a/components/mobileshell/qml/statusbar/ClockText.qml +++ b/components/mobileshell/qml/statusbar/ClockText.qml @@ -12,6 +12,8 @@ import org.kde.plasma.plasma5support 2.0 as P5Support import org.kde.plasma.components 3.0 as PlasmaComponents import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.kirigami as Kirigami + import "indicators" as Indicators PlasmaComponents.Label { diff --git a/components/mobileshell/qml/statusbar/StatusBar.qml b/components/mobileshell/qml/statusbar/StatusBar.qml index 2c036d0b..8127e76e 100644 --- a/components/mobileshell/qml/statusbar/StatusBar.qml +++ b/components/mobileshell/qml/statusbar/StatusBar.qml @@ -12,7 +12,7 @@ import QtQuick.Effects import QtQuick.Controls as Controls import QtQml.Models -import org.kde.kirigami 2.20 as Kirigami +import org.kde.kirigami as Kirigami import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.plasma5support 2.0 as P5Support @@ -25,11 +25,6 @@ import "../components" as Components Item { id: root - /** - * The color group used for status bar elements. - */ - required property var colorGroup - /** * Whether to show a drop shadow under the status bar. */ @@ -55,7 +50,7 @@ Item { */ property bool disableSystemTray: false - property alias colorScopeColor: icons.backgroundColor + property color colorScopeColor: Kirigami.Theme.backgroundColor readonly property real textPixelSize: 11 readonly property real smallerTextPixelSize: 9 @@ -102,8 +97,6 @@ Item { Item { id: icons z: 1 - Kirigami.Theme.colorSet: root.Kirigami.Theme.colorSet - Kirigami.Theme.inherit: false anchors.fill: parent Controls.Control { @@ -115,6 +108,7 @@ Item { anchors.fill: parent background: Rectangle { + id: panelBackground color: backgroundColor } diff --git a/components/mobileshell/qml/statusbar/TaskWidget.qml b/components/mobileshell/qml/statusbar/TaskWidget.qml index c38836c2..59dd7616 100644 --- a/components/mobileshell/qml/statusbar/TaskWidget.qml +++ b/components/mobileshell/qml/statusbar/TaskWidget.qml @@ -4,9 +4,8 @@ * SPDX-License-Identifier: LGPL-2.0-or-later */ -import QtQuick 2.1 -import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.kirigami 2.20 as Kirigami +import QtQuick +import org.kde.kirigami as Kirigami Item { id: taskIcon @@ -23,13 +22,12 @@ Item { } } - PlasmaCore.IconItem { + Kirigami.Icon { id: icon source: IconName ? IconName : Icon width: Math.min(parent.width, parent.height) height: width anchors.centerIn: parent - colorSet: Kirigami.Theme.colorSet } MouseArea { diff --git a/components/mobileshell/qml/statusbar/indicators/BluetoothIndicator.qml b/components/mobileshell/qml/statusbar/indicators/BluetoothIndicator.qml index 8fe8119d..91f344da 100644 --- a/components/mobileshell/qml/statusbar/indicators/BluetoothIndicator.qml +++ b/components/mobileshell/qml/statusbar/indicators/BluetoothIndicator.qml @@ -9,19 +9,17 @@ import QtQuick import QtQuick.Layouts -import org.kde.plasma.core as PlasmaCore import org.kde.kirigami 2.20 as Kirigami import org.kde.bluezqt as BluezQt import "../../dataproviders" as DataProviders -PlasmaCore.IconItem { +Kirigami.Icon { id: connectionIcon readonly property var provider: DataProviders.BluetoothInfo {} source: "network-bluetooth" // provider.icon - colorSet: Kirigami.Theme.colorSet visible: provider.isVisible } diff --git a/components/mobileshell/qml/statusbar/indicators/InternetIndicator.qml b/components/mobileshell/qml/statusbar/indicators/InternetIndicator.qml index af635401..7883048a 100644 --- a/components/mobileshell/qml/statusbar/indicators/InternetIndicator.qml +++ b/components/mobileshell/qml/statusbar/indicators/InternetIndicator.qml @@ -8,12 +8,11 @@ import QtQuick import QtQuick.Layouts -import org.kde.plasma.core as PlasmaCore import org.kde.plasma.components 3.0 as PlasmaComponents import org.kde.plasma.networkmanagement 0.2 as PlasmaNM -import org.kde.kirigami 2.20 as Kirigami +import org.kde.kirigami as Kirigami -PlasmaCore.IconItem { +Kirigami.Icon { id: connectionIcon // data @@ -40,7 +39,6 @@ PlasmaCore.IconItem { // implementation source: icon - colorSet: Kirigami.Theme.colorSet PlasmaComponents.BusyIndicator { id: connectingIndicator diff --git a/components/mobileshell/qml/statusbar/indicators/SignalStrengthIndicator.qml b/components/mobileshell/qml/statusbar/indicators/SignalStrengthIndicator.qml index af6ad5c6..149a037a 100644 --- a/components/mobileshell/qml/statusbar/indicators/SignalStrengthIndicator.qml +++ b/components/mobileshell/qml/statusbar/indicators/SignalStrengthIndicator.qml @@ -10,7 +10,7 @@ import QtQuick.Layouts import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 3.0 as PlasmaComponents -import org.kde.kirigami 2.20 as Kirigami +import org.kde.kirigami as Kirigami import "../../dataproviders" as DataProviders @@ -28,9 +28,8 @@ Item { width: strengthIcon.width + label.width Layout.minimumWidth: strengthIcon.width + label.width - PlasmaCore.IconItem { + Kirigami.Icon { id: strengthIcon - colorSet: Kirigami.Theme.colorSet anchors.left: parent.left anchors.verticalCenter: parent.verticalCenter width: height diff --git a/components/mobileshell/qml/statusbar/indicators/VolumeIndicator.qml b/components/mobileshell/qml/statusbar/indicators/VolumeIndicator.qml index 0e9890d1..3f20c6f0 100644 --- a/components/mobileshell/qml/statusbar/indicators/VolumeIndicator.qml +++ b/components/mobileshell/qml/statusbar/indicators/VolumeIndicator.qml @@ -9,19 +9,16 @@ import QtQuick import QtQuick.Layouts -import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.private.volume 0.1 -import org.kde.kirigami 2.20 as Kirigami +import org.kde.kirigami as Kirigami import "../../dataproviders" as DataProviders -PlasmaCore.IconItem { +Kirigami.Icon { id: paIcon readonly property var provider: DataProviders.AudioInfo {} source: provider.icon - colorSet: Kirigami.Theme.colorSet - visible: provider.isVisible } diff --git a/containments/panel/package/contents/ui/main.qml b/containments/panel/package/contents/ui/main.qml index bf8975e3..aa92bbe1 100644 --- a/containments/panel/package/contents/ui/main.qml +++ b/containments/panel/package/contents/ui/main.qml @@ -77,8 +77,10 @@ ContainmentItem { id: topPanel anchors.fill: parent + Kirigami.Theme.colorSet: root.showingApp ? Kirigami.Theme.Header : Kirigami.Theme.Complementary + Kirigami.Theme.inherit: false + showDropShadow: !root.showingApp - colorGroup: root.showingApp ? Kirigami.Theme.HeaderColorGroup : Kirigami.Theme.ComplementaryColorGroup backgroundColor: !root.showingApp ? "transparent" : root.backgroundColor } diff --git a/containments/taskpanel/package/contents/ui/NavigationPanelComponent.qml b/containments/taskpanel/package/contents/ui/NavigationPanelComponent.qml index 21703f8d..a4bab351 100644 --- a/containments/taskpanel/package/contents/ui/NavigationPanelComponent.qml +++ b/containments/taskpanel/package/contents/ui/NavigationPanelComponent.qml @@ -6,6 +6,7 @@ import QtQuick.Layouts import QtQuick.Window import org.kde.plasma.plasmoid +import org.kde.plasma.core as PlasmaCore import org.kde.plasma.workspace.keyboardlayout as Keyboards import org.kde.plasma.private.mobileshell as MobileShell @@ -13,6 +14,8 @@ import org.kde.plasma.private.mobileshell.state as MobileShellState import org.kde.taskmanager as TaskManager import org.kde.plasma.private.mobileshell.windowplugin as WindowPlugin +import org.kde.kirigami as Kirigami + MobileShell.NavigationPanel { id: root required property bool opaqueBar @@ -22,7 +25,7 @@ MobileShell.NavigationPanel { // - translucent if the task switcher is open // - transparent if on the homescreen backgroundColor: (Keyboards.KWinVirtualKeyboard.visible || opaqueBar) ? Kirigami.Theme.backgroundColor : "transparent"; - foregroundColorGroup: opaqueBar ? Kirigami.Theme.Window : Kirigami.Theme.ComplementaryColorGroup + foregroundColorGroup: opaqueBar ? PlasmaCore.Theme.NormalColorGroup : PlasmaCore.Theme.ComplementaryColorGroup shadow: !opaqueBar TaskManager.VirtualDesktopInfo { diff --git a/initialstart/qml/Wizard.qml b/initialstart/qml/Wizard.qml index c1db3031..dee25de7 100644 --- a/initialstart/qml/Wizard.qml +++ b/initialstart/qml/Wizard.qml @@ -122,7 +122,6 @@ Kirigami.Page { height: Kirigami.Units.gridUnit * 1.25 - colorGroup: Kirigami.Theme.ComplementaryColorGroup backgroundColor: "transparent" showSecondRow: false diff --git a/kwin/mobiletaskswitcher/qml/TaskSwitcher.qml b/kwin/mobiletaskswitcher/qml/TaskSwitcher.qml index 200c831d..6e63483d 100644 --- a/kwin/mobiletaskswitcher/qml/TaskSwitcher.qml +++ b/kwin/mobiletaskswitcher/qml/TaskSwitcher.qml @@ -161,7 +161,7 @@ FocusScope { z: 1 visible: ShellSettings.Settings.navigationPanelEnabled backgroundColor: Qt.rgba(0, 0, 0, 0.1) - foregroundColorGroup: Kirigami.Theme.ComplementaryColorGroup + foregroundColorGroup: PlasmaCore.Theme.ComplementaryColorGroup shadow: false leftAction: MobileShell.NavigationPanelAction {