overview: cleaner, add back hover effect

This commit is contained in:
end-4
2025-06-09 12:51:28 +02:00
parent db8d51b931
commit a81acb3dbe
3 changed files with 42 additions and 39 deletions
@@ -23,7 +23,7 @@ Scope {
property color colText: ColorUtils.colorWithLightness(Appearance.m3colors.m3primary, (root.dominantColorIsDark ? 0.8 : 0.12)) property color colText: ColorUtils.colorWithLightness(Appearance.m3colors.m3primary, (root.dominantColorIsDark ? 0.8 : 0.12))
function updateWidgetPosition(fileContent) { function updateWidgetPosition(fileContent) {
console.log("[BackgroundWidgets] Updating widget position with content:", fileContent) // console.log("[BackgroundWidgets] Updating widget position with content:", fileContent)
const parsedContent = JSON.parse(fileContent) const parsedContent = JSON.parse(fileContent)
root.centerX = parsedContent.center_x root.centerX = parsedContent.center_x
root.centerY = parsedContent.center_y root.centerY = parsedContent.center_y
@@ -45,11 +45,14 @@ Rectangle { // Window
width: Math.min(windowData?.size[0] * root.scale, (restrictToWorkspace ? windowData?.size[0] : availableWorkspaceWidth - x + xOffset)) width: Math.min(windowData?.size[0] * root.scale, (restrictToWorkspace ? windowData?.size[0] : availableWorkspaceWidth - x + xOffset))
height: Math.min(windowData?.size[1] * root.scale, (restrictToWorkspace ? windowData?.size[1] : availableWorkspaceHeight - y + yOffset)) height: Math.min(windowData?.size[1] * root.scale, (restrictToWorkspace ? windowData?.size[1] : availableWorkspaceHeight - y + yOffset))
layer.enabled: true
layer.effect: OpacityMask {
maskSource: Rectangle {
width: root.width
height: root.height
radius: Appearance.rounding.windowRounding * root.scale radius: Appearance.rounding.windowRounding * root.scale
color: pressed ? Appearance.colors.colLayer2Active : hovered ? Appearance.colors.colLayer2Hover : Appearance.colors.colLayer2 }
border.color : ColorUtils.transparentize(Appearance.m3colors.m3outline, 0.9) }
border.pixelAligned : false
border.width : 1
Behavior on x { Behavior on x {
animation: Appearance.animation.elementMoveEnter.numberAnimation.createObject(this) animation: Appearance.animation.elementMoveEnter.numberAnimation.createObject(this)
@@ -67,7 +70,16 @@ Rectangle { // Window
ScreencopyView { ScreencopyView {
anchors.fill: parent anchors.fill: parent
captureSource: GlobalStates.overviewOpen ? root.toplevel : null captureSource: GlobalStates.overviewOpen ? root.toplevel : null
live: false live: true
Rectangle {
anchors.fill: parent
radius: Appearance.rounding.windowRounding * root.scale
color: pressed ? Appearance.colors.colLayer2Active : hovered ? Appearance.colors.colLayer2Hover : Appearance.colors.colLayer2
opacity: pressed ? 0.3 : hovered ? 0.2 : 0
border.color : ColorUtils.transparentize(Appearance.m3colors.m3outline, 0.9)
border.pixelAligned : false
border.width : 1
} }
ColumnLayout { ColumnLayout {
@@ -86,25 +98,6 @@ Rectangle { // Window
animation: Appearance.animation.elementMoveEnter.numberAnimation.createObject(this) animation: Appearance.animation.elementMoveEnter.numberAnimation.createObject(this)
} }
} }
StyledLabel {
Layout.leftMargin: 10
Layout.rightMargin: 10
visible: !compactMode
Layout.fillWidth: true
Layout.fillHeight: true
background: Rectangle {
width: parent.width
color: Appearance.colors.colLayer2
radius: Appearance.rounding.windowRounding * root.scale
}
horizontalAlignment: Text.AlignHCenter
font.pixelSize: Appearance.font.pixelSize.smaller
font.italic: indicateXWayland ? true : false
elide: Text.ElideRight
text: windowData?.title ?? ""
} }
} }
} }
@@ -127,6 +127,16 @@ Scope {
Layout.fillWidth: true Layout.fillWidth: true
} }
QuickToggleButton {
toggled: false
buttonIcon: "restart_alt"
onClicked: {
Quickshell.reload(true)
}
StyledToolTip {
content: qsTr("Reload")
}
}
QuickToggleButton { QuickToggleButton {
toggled: false toggled: false
buttonIcon: "power_settings_new" buttonIcon: "power_settings_new"