From 3ff1700f92b2d193ba41f3e4ae8c84dbb5dac4bc Mon Sep 17 00:00:00 2001 From: Keyitdev <70140437+Keyitdev@users.noreply.github.com> Date: Wed, 11 Sep 2024 16:08:29 +0200 Subject: [PATCH] Port: Ported to qt6 part 2. Removed qt5-graphicaleffects. Replaced gaussian blur effect and removed drop shadow effect. --- Components/Input.qml | 10 ---------- Components/SessionButton.qml | 10 ---------- Components/UserList.qml | 10 ---------- Main.qml | 12 +++++++----- README.md | 4 +--- theme.conf | 17 ++++++----------- 6 files changed, 14 insertions(+), 49 deletions(-) diff --git a/Components/Input.qml b/Components/Input.qml index 3327383..5220ccd 100644 --- a/Components/Input.qml +++ b/Components/Input.qml @@ -6,7 +6,6 @@ import QtQuick 2.15 import QtQuick.Layouts 1.15 import QtQuick.Controls 2.15 -import Qt5Compat.GraphicalEffects Column { id: inputContainer @@ -153,15 +152,6 @@ Column { radius: config.RoundCorners / 2 color: root.palette.window layer.enabled: true - layer.effect: DropShadow { - transparentBorder: true - horizontalOffset: 0 - verticalOffset: 10 * config.InterfaceShadowSize - radius: 20 * config.InterfaceShadowSize - samples: 41 * config.InterfaceShadowSize - cached: true - color: Qt.hsla(0,0,0,config.InterfaceShadowOpacity) - } } enter: Transition { diff --git a/Components/SessionButton.qml b/Components/SessionButton.qml index d6b753b..23e3957 100644 --- a/Components/SessionButton.qml +++ b/Components/SessionButton.qml @@ -5,7 +5,6 @@ import QtQuick 2.15 import QtQuick.Controls 2.15 -import Qt5Compat.GraphicalEffects Item { id: sessionButton @@ -109,15 +108,6 @@ Item { radius: config.RoundCorners / 2 color: config.BackgroundColor layer.enabled: true - layer.effect: DropShadow { - transparentBorder: true - horizontalOffset: 0 - verticalOffset: 0 - radius: 20 * config.InterfaceShadowSize - samples: 41 * config.InterfaceShadowSize - cached: true - color: Qt.hsla(0,0,0,config.InterfaceShadowOpacity) - } } enter: Transition { diff --git a/Components/UserList.qml b/Components/UserList.qml index 8c4bca1..07567ec 100644 --- a/Components/UserList.qml +++ b/Components/UserList.qml @@ -5,7 +5,6 @@ import QtQuick 2.15 import QtQuick.Controls 2.15 -import Qt5Compat.GraphicalEffects Item { id: usernameField @@ -89,15 +88,6 @@ Item { radius: 10 color: root.palette.window layer.enabled: true - layer.effect: DropShadow { - transparentBorder: true - horizontalOffset: 0 - verticalOffset: 0 - radius: 100 - samples: 201 - cached: true - color: "#88000000" - } } enter: Transition { diff --git a/Main.qml b/Main.qml index 4b34315..261b4d1 100644 --- a/Main.qml +++ b/Main.qml @@ -6,7 +6,8 @@ import QtQuick 2.15 import QtQuick.Layouts 1.15 import QtQuick.Controls 2.15 -import Qt5Compat.GraphicalEffects +import QtQuick.Effects + import "Components" Pane { @@ -240,15 +241,16 @@ Pane { visible: config.FullBlur == "true" || config.PartialBlur == "true" ? true : false } - GaussianBlur { + MultiEffect { id: blur height: parent.height width: config.FullBlur == "true" ? parent.width : form.width source: config.FullBlur == "true" ? backgroundImage : blurMask - radius: config.BlurRadius - samples: config.BlurRadius * 2 + 1 - cached: true + blurEnabled: true + autoPaddingEnabled: false + blur: config.Blur == "" ? 2.0 : config.Blur + blurMax: config.BlurMax == "" ? 48 : config.BlurMax anchors.centerIn: config.FullBlur == "true" ? parent : form visible: config.FullBlur == "true" || config.PartialBlur == "true" ? true : false } diff --git a/README.md b/README.md index a856e56..211f718 100644 --- a/README.md +++ b/README.md @@ -18,10 +18,8 @@ Here are some examples: ### Dependencies ```sh -qt6-5compat qt6-declarative qt6-svg sddm +qt6-declarative qt6-svg sddm ``` -> qt6-declarative replaces qt6-quickcontrols2 -> https://archlinux.org/packages/extra/x86_64/qt6-declarative/ ### Install diff --git a/theme.conf b/theme.conf index c698810..63abefb 100644 --- a/theme.conf +++ b/theme.conf @@ -16,14 +16,15 @@ ScreenHeight="1080" ## [Blur Settings] - +## https://doc.qt.io/qt-6/qml-qtquick-effects-multieffect.html FullBlur="false" +## If you use FullBlur I recommend setting BlurMax to 64 and Blur to 1.0. PartialBlur="true" ## Enable or disable the blur effect; if HaveFormBackground is set to true then PartialBlur will trigger the BackgroundColor of the form element to be partially transparent and blend with the blur. - -BlurRadius="80" -## Set the strength of the blur effect. Anything above 100 is pretty strong and might slow down the rendering time. 0 is like setting false for any blur. - +BlurMax="" +## Default: 48. Meaningful range of this value is from 2 (subtle blur) to 64 (high blur). Higher values still work (up to 144 when Blur is set to 1.0), it is heavily connected with Blur. +Blur="" +## Default: 2.0. Meaningful range of this value is from 0.0 to 3.0. It is heavily connected with Blur. ## [Design Customizations] @@ -62,12 +63,6 @@ IconColor="#ffffff" OverrideLoginButtonTextColor="" ## The text of the login button may become difficult to read depending on your color choices. Use this option to set it independently for legibility. -InterfaceShadowSize="6" -## Integer used as multiplier. Size of the shadow behind the user and session selection background. Decrease or increase if it looks bad on your background. Initial render can be slow no values above 5-7. - -InterfaceShadowOpacity="0.6" -## Double between 0 and 1. Alpha channel of the shadow behind the user and session selection background. Decrease or increase if it looks bad on your background. - RoundCorners="20" ## Integer in pixels. Radius of the input fields and the login button. Empty for square. Can cause bad antialiasing of the fields.