From 380060b8ec9e2897c0dc946d573084b362760310 Mon Sep 17 00:00:00 2001 From: Devin Lin Date: Fri, 12 May 2023 19:43:49 -0400 Subject: [PATCH] homescreens/halcyon: Port from QtGraphicalEffects to MultiEffect --- .../halcyon/package/contents/ui/Clock.qml | 18 +++------ .../contents/ui/FavoritesAppDelegate.qml | 39 ++++++++----------- .../package/contents/ui/FavoritesGrid.qml | 9 +---- .../package/contents/ui/FolderGrid.qml | 28 +++++-------- .../package/contents/ui/GridAppDelegate.qml | 7 ++-- 5 files changed, 37 insertions(+), 64 deletions(-) diff --git a/containments/homescreens/halcyon/package/contents/ui/Clock.qml b/containments/homescreens/halcyon/package/contents/ui/Clock.qml index 846858cd..24c39611 100644 --- a/containments/homescreens/halcyon/package/contents/ui/Clock.qml +++ b/containments/homescreens/halcyon/package/contents/ui/Clock.qml @@ -4,7 +4,6 @@ import QtQuick import QtQuick.Layouts import QtQuick.Controls -import Qt5Compat.GraphicalEffects import org.kde.plasma.core as PlasmaCore import org.kde.plasma.plasma5support 2.0 as P5Support @@ -28,15 +27,12 @@ ColumnLayout { Layout.fillWidth: true horizontalAlignment: Text.AlignLeft + font.weight: Font.Bold // this font weight may switch to regular on distros that don't have a light variant font.pointSize: 28 + layer.enabled: true - layer.effect: DropShadow { - verticalOffset: 1 - radius: 4 - samples: 6 - color: Qt.rgba(0, 0, 0, 0.5) - } + layer.effect: MobileShell.TextDropShadow {} } Label { @@ -50,13 +46,9 @@ ColumnLayout { styleColor: softwareRendering ? ColorScope.backgroundColor : "transparent" // no outline, doesn't matter font.pointSize: 12 + layer.enabled: true - layer.effect: DropShadow { - verticalOffset: 1 - radius: 4 - samples: 6 - color: Qt.rgba(0, 0, 0, 0.5) - } + layer.effect: MobileShell.TextDropShadow {} } P5Support.DataSource { diff --git a/containments/homescreens/halcyon/package/contents/ui/FavoritesAppDelegate.qml b/containments/homescreens/halcyon/package/contents/ui/FavoritesAppDelegate.qml index 0dcdca1c..c9720fdb 100644 --- a/containments/homescreens/halcyon/package/contents/ui/FavoritesAppDelegate.qml +++ b/containments/homescreens/halcyon/package/contents/ui/FavoritesAppDelegate.qml @@ -4,7 +4,7 @@ import QtQuick import QtQuick.Layouts import QtQuick.Controls as Controls -import Qt5Compat.GraphicalEffects +import QtQuick.Effects import org.kde.plasma.core as PlasmaCore import org.kde.plasma.components 3.0 as PlasmaComponents @@ -235,12 +235,7 @@ Item { color: "white" layer.enabled: true - layer.effect: DropShadow { - verticalOffset: 1 - radius: 4 - samples: 6 - color: Qt.rgba(0, 0, 0, 0.5) - } + layer.effect: MobileShell.TextDropShadow {} } Kirigami.Icon { @@ -254,11 +249,11 @@ Item { visible: delegate.isFolder layer.enabled: true - layer.effect: DropShadow { - verticalOffset: 1 - radius: 4 - samples: 6 - color: Qt.rgba(0, 0, 0, 0.5) + layer.effect: MultiEffect { + shadowEnabled: true + shadowVerticalOffset: 1 + blurMax: 8 + shadowOpacity: 0.7 } } } @@ -302,11 +297,11 @@ Item { } layer.enabled: true - layer.effect: DropShadow { - verticalOffset: 1 - radius: 4 - samples: 6 - color: Qt.rgba(0, 0, 0, 0.5) + layer.effect: MultiEffect { + shadowEnabled: true + shadowVerticalOffset: 1 + blurMax: 16 + shadowOpacity: 0.5 } } } @@ -348,11 +343,11 @@ Item { source: modelData.icon layer.enabled: true - layer.effect: DropShadow { - verticalOffset: 1 - radius: 4 - samples: 3 - color: Qt.rgba(0, 0, 0, 0.5) + layer.effect: MultiEffect { + shadowEnabled: true + shadowVerticalOffset: 1 + blurMax: 16 + shadowOpacity: 0.6 } } } diff --git a/containments/homescreens/halcyon/package/contents/ui/FavoritesGrid.qml b/containments/homescreens/halcyon/package/contents/ui/FavoritesGrid.qml index c90b87fd..cf3740c1 100644 --- a/containments/homescreens/halcyon/package/contents/ui/FavoritesGrid.qml +++ b/containments/homescreens/halcyon/package/contents/ui/FavoritesGrid.qml @@ -5,7 +5,6 @@ import QtQuick import QtQuick.Controls as QQC2 import QtQuick.Layouts import QtQml.Models -import Qt5Compat.GraphicalEffects import org.kde.plasma.core as PlasmaCore import org.kde.plasma.extras as PlasmaExtras @@ -272,13 +271,7 @@ MobileShell.GridView { anchors.rightMargin: root.rightMargin layer.enabled: true - layer.effect: DropShadow { - verticalOffset: 1 - radius: 4 - samples: 6 - color: Qt.rgba(0, 0, 0, 0.5) - cached: true - } + layer.effect: MobileShell.TextDropShadow {} Kirigami.Icon { id: icon diff --git a/containments/homescreens/halcyon/package/contents/ui/FolderGrid.qml b/containments/homescreens/halcyon/package/contents/ui/FolderGrid.qml index 9013c68a..c9eaf223 100644 --- a/containments/homescreens/halcyon/package/contents/ui/FolderGrid.qml +++ b/containments/homescreens/halcyon/package/contents/ui/FolderGrid.qml @@ -4,8 +4,8 @@ import QtQuick import QtQuick.Controls as QQC2 import QtQuick.Layouts +import QtQuick.Effects import QtQml.Models -import Qt5Compat.GraphicalEffects import org.kde.plasma.core as PlasmaCore import org.kde.plasma.extras as PlasmaExtras @@ -63,13 +63,9 @@ MobileShell.GridView { font.weight: Font.Bold font.pointSize: 18 + layer.enabled: true - layer.effect: DropShadow { - verticalOffset: 1 - radius: 4 - samples: 6 - color: Qt.rgba(0, 0, 0, 0.5) - } + layer.effect: MobileShell.TextDropShadow {} onTextChanged: { if (text.includes('\n')) { @@ -100,13 +96,9 @@ MobileShell.GridView { font.weight: Font.Bold font.pointSize: 18 + layer.enabled: true - layer.effect: DropShadow { - verticalOffset: 1 - radius: 4 - samples: 6 - color: Qt.rgba(0, 0, 0, 0.5) - } + layer.effect: MobileShell.TextDropShadow {} MouseArea { anchors.fill: parent @@ -146,11 +138,11 @@ MobileShell.GridView { source: 'arrow-left' layer.enabled: true - layer.effect: DropShadow { - verticalOffset: 1 - radius: 4 - samples: 6 - color: Qt.rgba(0, 0, 0, 0.5) + layer.effect: MultiEffect { + shadowEnabled: true + shadowVerticalOffset: 1 + blurMax: 8 + shadowOpacity: 0.6 } } } diff --git a/containments/homescreens/halcyon/package/contents/ui/GridAppDelegate.qml b/containments/homescreens/halcyon/package/contents/ui/GridAppDelegate.qml index 6bd7aa21..079656f3 100644 --- a/containments/homescreens/halcyon/package/contents/ui/GridAppDelegate.qml +++ b/containments/homescreens/halcyon/package/contents/ui/GridAppDelegate.qml @@ -6,8 +6,8 @@ import QtQuick import QtQuick.Layouts +import QtQuick.Effects import QtQuick.Controls as Controls -import Qt5Compat.GraphicalEffects import org.kde.plasma.core as PlasmaCore import org.kde.plasma.components 3.0 as PlasmaComponents @@ -163,8 +163,9 @@ MouseArea { // darken effect when hovered/pressed layer { enabled: delegate.pressed - effect: ColorOverlay { - color: Qt.rgba(0, 0, 0, 0.3) + effect: MultiEffect { + colorization: 1.0 + colorizationColor: Qt.rgba(0, 0, 0, 0.3) } }