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))
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)
root.centerX = parsedContent.center_x
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))
height: Math.min(windowData?.size[1] * root.scale, (restrictToWorkspace ? windowData?.size[1] : availableWorkspaceHeight - y + yOffset))
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
layer.enabled: true
layer.effect: OpacityMask {
maskSource: Rectangle {
width: root.width
height: root.height
radius: Appearance.rounding.windowRounding * root.scale
}
}
Behavior on x {
animation: Appearance.animation.elementMoveEnter.numberAnimation.createObject(this)
@@ -67,44 +70,34 @@ Rectangle { // Window
ScreencopyView {
anchors.fill: parent
captureSource: GlobalStates.overviewOpen ? root.toplevel : null
live: false
}
live: true
ColumnLayout {
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.right: parent.right
spacing: Appearance.font.pixelSize.smaller * 0.5
IconImage {
id: windowIcon
Layout.alignment: Qt.AlignHCenter
source: root.iconPath
implicitSize: Math.min(targetWindowWidth, targetWindowHeight) * (root.compactMode ? root.iconToWindowRatioCompact : root.iconToWindowRatio)
Behavior on implicitSize {
animation: Appearance.animation.elementMoveEnter.numberAnimation.createObject(this)
}
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
}
StyledLabel {
Layout.leftMargin: 10
Layout.rightMargin: 10
visible: !compactMode
Layout.fillWidth: true
Layout.fillHeight: true
ColumnLayout {
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.right: parent.right
spacing: Appearance.font.pixelSize.smaller * 0.5
background: Rectangle {
width: parent.width
color: Appearance.colors.colLayer2
radius: Appearance.rounding.windowRounding * root.scale
IconImage {
id: windowIcon
Layout.alignment: Qt.AlignHCenter
source: root.iconPath
implicitSize: Math.min(targetWindowWidth, targetWindowHeight) * (root.compactMode ? root.iconToWindowRatioCompact : root.iconToWindowRatio)
Behavior on implicitSize {
animation: Appearance.animation.elementMoveEnter.numberAnimation.createObject(this)
}
}
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
}
QuickToggleButton {
toggled: false
buttonIcon: "restart_alt"
onClicked: {
Quickshell.reload(true)
}
StyledToolTip {
content: qsTr("Reload")
}
}
QuickToggleButton {
toggled: false
buttonIcon: "power_settings_new"