forked from Shinonome/dots-hyprland
overview: cleaner, add back hover effect
This commit is contained in:
@@ -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))
|
||||||
|
|
||||||
radius: Appearance.rounding.windowRounding * root.scale
|
layer.enabled: true
|
||||||
color: pressed ? Appearance.colors.colLayer2Active : hovered ? Appearance.colors.colLayer2Hover : Appearance.colors.colLayer2
|
layer.effect: OpacityMask {
|
||||||
border.color : ColorUtils.transparentize(Appearance.m3colors.m3outline, 0.9)
|
maskSource: Rectangle {
|
||||||
border.pixelAligned : false
|
width: root.width
|
||||||
border.width : 1
|
height: root.height
|
||||||
|
radius: Appearance.rounding.windowRounding * root.scale
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Behavior on x {
|
Behavior on x {
|
||||||
animation: Appearance.animation.elementMoveEnter.numberAnimation.createObject(this)
|
animation: Appearance.animation.elementMoveEnter.numberAnimation.createObject(this)
|
||||||
@@ -67,44 +70,34 @@ 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
|
||||||
}
|
|
||||||
|
|
||||||
ColumnLayout {
|
Rectangle {
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.fill: parent
|
||||||
anchors.left: parent.left
|
radius: Appearance.rounding.windowRounding * root.scale
|
||||||
anchors.right: parent.right
|
color: pressed ? Appearance.colors.colLayer2Active : hovered ? Appearance.colors.colLayer2Hover : Appearance.colors.colLayer2
|
||||||
spacing: Appearance.font.pixelSize.smaller * 0.5
|
opacity: pressed ? 0.3 : hovered ? 0.2 : 0
|
||||||
|
border.color : ColorUtils.transparentize(Appearance.m3colors.m3outline, 0.9)
|
||||||
IconImage {
|
border.pixelAligned : false
|
||||||
id: windowIcon
|
border.width : 1
|
||||||
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)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledLabel {
|
ColumnLayout {
|
||||||
Layout.leftMargin: 10
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
Layout.rightMargin: 10
|
anchors.left: parent.left
|
||||||
visible: !compactMode
|
anchors.right: parent.right
|
||||||
Layout.fillWidth: true
|
spacing: Appearance.font.pixelSize.smaller * 0.5
|
||||||
Layout.fillHeight: true
|
|
||||||
|
|
||||||
background: Rectangle {
|
IconImage {
|
||||||
width: parent.width
|
id: windowIcon
|
||||||
color: Appearance.colors.colLayer2
|
Layout.alignment: Qt.AlignHCenter
|
||||||
radius: Appearance.rounding.windowRounding * root.scale
|
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
|
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"
|
||||||
|
|||||||
Reference in New Issue
Block a user