replace multieffect shadows with rectangularshadow ones

This commit is contained in:
end-4
2025-05-27 09:40:26 +02:00
parent 4ea6474cb6
commit 8ede97a278
11 changed files with 293 additions and 326 deletions
@@ -55,7 +55,16 @@ Scope { // Scope
} }
} }
// Background // Background
RectangularShadow {
anchors.fill: cheatsheetBackground
radius: cheatsheetBackground.radius
blur: 1.2 * Appearance.sizes.elevationMargin
spread: 1
color: Appearance.colors.colShadow
cached: true
}
Rectangle { Rectangle {
id: cheatsheetBackground id: cheatsheetBackground
anchors.centerIn: parent anchors.centerIn: parent
@@ -65,16 +74,6 @@ Scope { // Scope
implicitWidth: cheatsheetColumnLayout.implicitWidth + padding * 2 implicitWidth: cheatsheetColumnLayout.implicitWidth + padding * 2
implicitHeight: cheatsheetColumnLayout.implicitHeight + padding * 2 implicitHeight: cheatsheetColumnLayout.implicitHeight + padding * 2
layer.enabled: true
layer.effect: MultiEffect {
source: cheatsheetBackground
anchors.fill: cheatsheetBackground
shadowEnabled: true
shadowVerticalOffset: 1
shadowColor: Appearance.colors.colShadow
shadowBlur: 0.5
}
Keys.onPressed: (event) => { // Esc to close Keys.onPressed: (event) => { // Esc to close
if (event.key === Qt.Key_Escape) { if (event.key === Qt.Key_Escape) {
cheatsheetRoot.hide() cheatsheetRoot.hide()
@@ -128,7 +128,7 @@ Singleton {
property color colTooltip: "#3C4043" // m3colors.m3inverseSurface in the specs, but the m3 website actually uses this color property color colTooltip: "#3C4043" // m3colors.m3inverseSurface in the specs, but the m3 website actually uses this color
property color colOnTooltip: "#F8F9FA" // m3colors.m3inverseOnSurface in the specs, but the m3 website actually uses this color property color colOnTooltip: "#F8F9FA" // m3colors.m3inverseOnSurface in the specs, but the m3 website actually uses this color
property color colScrim: ColorUtils.transparentize(m3colors.m3scrim, 0.5) property color colScrim: ColorUtils.transparentize(m3colors.m3scrim, 0.5)
property color colShadow: ColorUtils.transparentize(m3colors.m3shadow, 0.75) property color colShadow: ColorUtils.transparentize(m3colors.m3shadow, 0.85)
} }
rounding: QtObject { rounding: QtObject {
@@ -106,7 +106,14 @@ Item { // Notification group area
} }
RectangularShadow {
visible: popup
anchors.fill: background
radius: background.radius
blur: 1.2 * Appearance.sizes.elevationMargin
spread: 1
color: Appearance.colors.colShadow
}
Rectangle { // Background of the notification Rectangle { // Background of the notification
id: background id: background
anchors.left: parent.left anchors.left: parent.left
@@ -134,16 +141,6 @@ Item { // Notification group area
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this) animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
} }
layer.enabled: true
layer.effect: MultiEffect {
source: background
anchors.fill: background
shadowEnabled: popup
shadowColor: Appearance.colors.colShadow
shadowVerticalOffset: 1
shadowBlur: 0.5
}
RowLayout { // Left column for icon, right column for content RowLayout { // Left column for icon, right column for content
id: row id: row
anchors.top: parent.top anchors.top: parent.top
@@ -74,12 +74,6 @@ Item { // Player instance
id: coverArtDownloader id: coverArtDownloader
property string targetFile: playerController.artUrl property string targetFile: playerController.artUrl
command: [ "bash", "-c", `[ -f ${artFilePath} ] || curl -sSL '${targetFile}' -o '${artFilePath}'` ] command: [ "bash", "-c", `[ -f ${artFilePath} ] || curl -sSL '${targetFile}' -o '${artFilePath}'` ]
stdout: SplitParser {
onRead: data => {
// console.log("Color quantizer output:", data)
playerController.artDominantColor = "#" + data
}
}
onExited: (exitCode, exitStatus) => { onExited: (exitCode, exitStatus) => {
colorQuantizer.targetFile = playerController.artUrl // Yes this binding break is intentional colorQuantizer.targetFile = playerController.artUrl // Yes this binding break is intentional
colorQuantizer.running = true colorQuantizer.running = true
@@ -93,7 +87,6 @@ Item { // Player instance
command: [ "sh", "-c", `magick '${targetFile}' -scale 1x1\\! -format '%[fx:int(255*r+.5)],%[fx:int(255*g+.5)],%[fx:int(255*b+.5)]' info: | sed 's/,/\\n/g' | xargs -L 1 printf '%02x' ; echo` ] command: [ "sh", "-c", `magick '${targetFile}' -scale 1x1\\! -format '%[fx:int(255*r+.5)],%[fx:int(255*g+.5)],%[fx:int(255*b+.5)]' info: | sed 's/,/\\n/g' | xargs -L 1 printf '%02x' ; echo` ]
stdout: SplitParser { stdout: SplitParser {
onRead: data => { onRead: data => {
// console.log("Color quantizer output:", data)
playerController.artDominantColor = "#" + data playerController.artDominantColor = "#" + data
} }
} }
@@ -115,26 +108,19 @@ Item { // Player instance
property color colOnSecondaryContainer: ColorUtils.mix(Appearance.m3colors.m3onSecondaryContainer, artDominantColor, 0.2) property color colOnSecondaryContainer: ColorUtils.mix(Appearance.m3colors.m3onSecondaryContainer, artDominantColor, 0.2)
} }
Rectangle { // Background wrapper with shadow
id: backgroundShadowLayer
anchors.fill: parent
anchors.margins: Appearance.sizes.elevationMargin
color: blendedColors.colLayer0
radius: root.popupRounding
layer.enabled: true RectangularShadow {
layer.effect: MultiEffect { anchors.fill: background
source: backgroundShadowLayer radius: background.radius
anchors.fill: backgroundShadowLayer blur: 1.2 * Appearance.sizes.elevationMargin
shadowEnabled: true spread: 1
shadowColor: Appearance.colors.colShadow color: Appearance.colors.colShadow
shadowVerticalOffset: 1 cached: true
shadowBlur: 0.5
} }
Rectangle { // Background Rectangle { // Background
id: background id: background
anchors.fill: parent anchors.fill: parent
anchors.margins: Appearance.sizes.elevationMargin
color: blendedColors.colLayer0 color: blendedColors.colLayer0
radius: root.popupRounding radius: root.popupRounding
@@ -306,4 +292,3 @@ Item { // Player instance
} }
} }
} }
}
@@ -25,6 +25,13 @@ Item {
implicitWidth: Appearance.sizes.osdWidth implicitWidth: Appearance.sizes.osdWidth
implicitHeight: valueIndicator.implicitHeight implicitHeight: valueIndicator.implicitHeight
RectangularShadow {
anchors.fill: valueIndicator
radius: valueIndicator.radius
blur: 1.2 * Appearance.sizes.elevationMargin
spread: 1
color: Appearance.colors.colShadow
}
WrapperRectangle { WrapperRectangle {
id: valueIndicator id: valueIndicator
anchors.fill: parent anchors.fill: parent
@@ -32,16 +39,6 @@ Item {
color: Appearance.colors.colLayer0 color: Appearance.colors.colLayer0
implicitWidth: valueRow.implicitWidth implicitWidth: valueRow.implicitWidth
layer.enabled: true
layer.effect: MultiEffect {
source: valueIndicator
anchors.fill: valueIndicator
shadowEnabled: true
shadowColor: Appearance.colors.colShadow
shadowVerticalOffset: 1
shadowBlur: 0.5
}
RowLayout { // Icon on the left, stuff on the right RowLayout { // Icon on the left, stuff on the right
id: valueRow id: valueRow
Layout.margins: 10 Layout.margins: 10
@@ -49,7 +49,14 @@ Item {
property Component windowComponent: OverviewWindow {} property Component windowComponent: OverviewWindow {}
property list<OverviewWindow> windowWidgets: [] property list<OverviewWindow> windowWidgets: []
Rectangle { RectangularShadow { // Background shadow
anchors.fill: overviewBackground
radius: overviewBackground.radius
blur: 1.2 * Appearance.sizes.elevationMargin
spread: 1
color: Appearance.colors.colShadow
}
Rectangle { // Background
id: overviewBackground id: overviewBackground
anchors.fill: parent anchors.fill: parent
@@ -59,16 +66,6 @@ Item {
color: Appearance.colors.colLayer0 color: Appearance.colors.colLayer0
radius: Appearance.rounding.screenRounding * root.scale + 5 * 2 radius: Appearance.rounding.screenRounding * root.scale + 5 * 2
layer.enabled: true
layer.effect: MultiEffect {
source: overviewBackground
anchors.fill: overviewBackground
shadowEnabled: true
shadowColor: Appearance.colors.colShadow
shadowVerticalOffset: 1
shadowBlur: 0.5
}
ColumnLayout { ColumnLayout {
id: workspaceColumnLayout id: workspaceColumnLayout
@@ -175,6 +175,13 @@ Item { // Wrapper
} }
} }
RectangularShadow { // Background shadow
anchors.fill: searchWidgetContent
radius: searchWidgetContent.radius
blur: 1.2 * Appearance.sizes.elevationMargin
spread: 1
color: Appearance.colors.colShadow
}
Rectangle { // Background Rectangle { // Background
id: searchWidgetContent id: searchWidgetContent
anchors.centerIn: parent anchors.centerIn: parent
@@ -182,15 +189,6 @@ Item { // Wrapper
implicitHeight: columnLayout.implicitHeight implicitHeight: columnLayout.implicitHeight
radius: Appearance.rounding.large radius: Appearance.rounding.large
color: Appearance.colors.colLayer0 color: Appearance.colors.colLayer0
layer.enabled: true
layer.effect: MultiEffect {
source: searchWidgetContent
anchors.fill: searchWidgetContent
shadowEnabled: true
shadowColor: Appearance.colors.colShadow
shadowVerticalOffset: 1
shadowBlur: 0.5
}
ColumnLayout { ColumnLayout {
id: columnLayout id: columnLayout
@@ -65,6 +65,13 @@ Scope { // Scope
} }
// Background // Background
RectangularShadow { // Background shadow
anchors.fill: sidebarLeftBackground
radius: sidebarLeftBackground.radius
blur: 1.2 * Appearance.sizes.elevationMargin
spread: 1
color: Appearance.colors.colShadow
}
Rectangle { Rectangle {
id: sidebarLeftBackground id: sidebarLeftBackground
@@ -78,16 +85,6 @@ Scope { // Scope
radius: Appearance.rounding.screenRounding - Appearance.sizes.elevationMargin + 1 radius: Appearance.rounding.screenRounding - Appearance.sizes.elevationMargin + 1
focus: sidebarRoot.visible focus: sidebarRoot.visible
layer.enabled: true
layer.effect: MultiEffect {
source: sidebarLeftBackground
anchors.fill: sidebarLeftBackground
shadowEnabled: true
shadowColor: Appearance.colors.colShadow
shadowVerticalOffset: 1
shadowBlur: 0.5
}
Behavior on width { Behavior on width {
animation: Appearance.animation.elementMove.numberAnimation.createObject(this) animation: Appearance.animation.elementMove.numberAnimation.createObject(this)
} }
@@ -43,6 +43,10 @@ Button {
} }
} }
StyledToolTip {
content: `${StringUtils.wordWrap(root.imageData.tags, root.maxTagStringLineLength)}`
}
padding: 0 padding: 0
implicitWidth: root.rowHeight * modelData.aspect_ratio implicitWidth: root.rowHeight * modelData.aspect_ratio
implicitHeight: root.rowHeight implicitHeight: root.rowHeight
@@ -97,10 +101,6 @@ Button {
colBackgroundHover: ColorUtils.transparentize(ColorUtils.mix(Appearance.m3colors.m3surface, Appearance.m3colors.m3onSurface, 0.8), 0.2) colBackgroundHover: ColorUtils.transparentize(ColorUtils.mix(Appearance.m3colors.m3surface, Appearance.m3colors.m3onSurface, 0.8), 0.2)
colRipple: ColorUtils.transparentize(ColorUtils.mix(Appearance.m3colors.m3surface, Appearance.m3colors.m3onSurface, 0.6), 0.1) colRipple: ColorUtils.transparentize(ColorUtils.mix(Appearance.m3colors.m3surface, Appearance.m3colors.m3onSurface, 0.6), 0.1)
StyledToolTip {
content: `${StringUtils.wordWrap(root.imageData.tags, root.maxTagStringLineLength)}\n${qsTr("Click for options")}`
}
contentItem: MaterialSymbol { contentItem: MaterialSymbol {
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
iconSize: Appearance.font.pixelSize.large iconSize: Appearance.font.pixelSize.large
@@ -124,6 +124,13 @@ Button {
width: contextMenu.width width: contextMenu.width
height: contextMenu.height height: contextMenu.height
RectangularShadow { // Background shadow
anchors.fill: contextMenu
radius: contextMenu.radius
blur: 1.2 * Appearance.sizes.elevationMargin
spread: 1
color: Appearance.colors.colShadow
}
Rectangle { Rectangle {
id: contextMenu id: contextMenu
anchors.centerIn: parent anchors.centerIn: parent
@@ -134,16 +141,6 @@ Button {
implicitHeight: contextMenuColumnLayout.implicitHeight + radius * 2 implicitHeight: contextMenuColumnLayout.implicitHeight + radius * 2
implicitWidth: contextMenuColumnLayout.implicitWidth implicitWidth: contextMenuColumnLayout.implicitWidth
layer.enabled: true
layer.effect: MultiEffect {
source: contextMenu
anchors.fill: contextMenu
shadowEnabled: true
shadowColor: Appearance.colors.colShadow
shadowVerticalOffset: 1
shadowBlur: 0.5
}
Behavior on opacity { Behavior on opacity {
NumberAnimation { NumberAnimation {
duration: Appearance.animation.elementMoveFast.duration duration: Appearance.animation.elementMoveFast.duration
@@ -56,24 +56,26 @@ Scope {
width: sidebarWidth - Appearance.sizes.hyprlandGapsOut * 2 width: sidebarWidth - Appearance.sizes.hyprlandGapsOut * 2
height: parent.height - Appearance.sizes.hyprlandGapsOut * 2 height: parent.height - Appearance.sizes.hyprlandGapsOut * 2
sourceComponent: Rectangle { sourceComponent: Item {
implicitHeight: sidebarRightBackground.implicitHeight
implicitWidth: sidebarRightBackground.implicitWidth
RectangularShadow { // Background shadow
anchors.fill: sidebarRightBackground
radius: sidebarRightBackground.radius
blur: 1.2 * Appearance.sizes.elevationMargin
spread: 1
color: Appearance.colors.colShadow
}
Rectangle {
id: sidebarRightBackground id: sidebarRightBackground
anchors.fill: parent
implicitHeight: parent.height - Appearance.sizes.hyprlandGapsOut * 2 implicitHeight: parent.height - Appearance.sizes.hyprlandGapsOut * 2
implicitWidth: sidebarWidth - Appearance.sizes.hyprlandGapsOut * 2 implicitWidth: sidebarWidth - Appearance.sizes.hyprlandGapsOut * 2
color: Appearance.colors.colLayer0 color: Appearance.colors.colLayer0
radius: Appearance.rounding.screenRounding - Appearance.sizes.elevationMargin + 1 radius: Appearance.rounding.screenRounding - Appearance.sizes.elevationMargin + 1
layer.enabled: true
layer.effect: MultiEffect {
source: sidebarRightBackground
anchors.fill: sidebarRightBackground
shadowEnabled: true
shadowColor: Appearance.colors.colShadow
shadowVerticalOffset: 1
shadowBlur: 0.5
}
Keys.onPressed: (event) => { Keys.onPressed: (event) => {
if (event.key === Qt.Key_Escape) { if (event.key === Qt.Key_Escape) {
sidebarRoot.hide(); sidebarRoot.hide();
@@ -162,6 +164,7 @@ Scope {
} }
} }
} }
}
} }
@@ -152,6 +152,13 @@ Item {
} }
// + FAB // + FAB
RectangularShadow { // Background shadow
anchors.fill: fabButton
radius: Appearance.rounding.normal
blur: 1.2 * Appearance.sizes.elevationMargin
spread: 1
color: Appearance.colors.colShadow
}
Button { Button {
id: fabButton id: fabButton
anchors.right: parent.right anchors.right: parent.right
@@ -173,16 +180,6 @@ Item {
Behavior on color { Behavior on color {
animation: Appearance.animation.elementMoveFast.colorAnimation.createObject(this) animation: Appearance.animation.elementMoveFast.colorAnimation.createObject(this)
} }
layer.enabled: true
layer.effect: MultiEffect {
source: fabBackground
anchors.fill: fabBackground
shadowEnabled: true
shadowColor: Appearance.colors.colShadow
shadowBlur: 0.6
shadowVerticalOffset: fabButton.hovered ? 4 : 2
}
} }
contentItem: MaterialSymbol { contentItem: MaterialSymbol {