update hypr toplevels

This commit is contained in:
Zacharias-Brohn
2025-11-18 19:25:45 +01:00
parent 5b069bf4c2
commit a40299ed41
13 changed files with 712 additions and 46 deletions
+2 -2
View File
@@ -103,8 +103,8 @@ Repeater {
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
Layout.fillHeight: true
Layout.preferredWidth: 30
color: collapseArea.containsMouse ? "#15FFFFFF" : "transparent"
radius: groupColumn.isExpanded ? 4 : Layout.preferredHeight / 2
color: !groupColumn.isExpanded ? "#E53935" : collapseArea.containsMouse ? "#15FFFFFF" : "transparent"
radius: groupColumn.isExpanded ? 4 : height / 2
visible: true
Text {
View File
+31
View File
@@ -131,6 +131,20 @@ PanelWindow {
border.color: "#555555"
radius: 8
// Rectangle {
// anchors.bottom: parent.bottom
// anchors.left: parent.left
// anchors.right: parent.right
// height: 4
// bottomLeftRadius: parent.radius
// bottomRightRadius: parent.radius
// color: "#40000000"
// Rectangle {
// anchors.fill: parent
// width: parent.width * ( Math.max(0, Math.min( rootItem.modelData.timer ) ) )
// }
// }
Component.onCompleted: {
root.notifRegions.push( notifRegion.createObject(root, { item: backgroundRect }));
}
@@ -217,6 +231,23 @@ PanelWindow {
}
}
}
ElapsedTimer {
id: timer
}
}
MouseArea {
property int timePassed
anchors.fill: parent
hoverEnabled: true
onEntered: {
// rootItem.modelData.timer.interval = 5000 - timer.restartMs();
rootItem.modelData.timer.stop();
}
onExited: {
rootItem.modelData.timer.start();
}
}
}
}
+2 -11
View File
@@ -1,5 +1,3 @@
//@ pragma Env QT_STYLE_OVERRIDE=Breeze
import QtQuick
import Quickshell
import Quickshell.Services.SystemTray
@@ -50,12 +48,6 @@ MouseArea {
Connections {
target: trayMenu
function onVisibleChanged() {
if ( !trayMenu.visible ) {
trayMenu.trayMenu = null;
}
}
function onFinishedLoading() {
if ( !root.hasLoaded )
trayMenu.visible = false;
@@ -67,9 +59,8 @@ MouseArea {
if ( mouse.button === Qt.LeftButton ) {
root.item.activate();
} else if ( mouse.button === Qt.RightButton ) {
if ( root.item?.menu !== trayMenu.trayMenu ) {
trayMenu.trayMenu = root.item?.menu;
}
trayMenu.trayMenu = null;
trayMenu.trayMenu = root.item?.menu;
trayMenu.visible = !trayMenu.visible;
trayMenu.focusGrab = true;
}
+53 -28
View File
@@ -7,6 +7,7 @@ import QtQuick.Layouts
import Qt5Compat.GraphicalEffects
import Quickshell.Hyprland
import QtQml
import qs.Effects
PanelWindow {
id: root
@@ -58,26 +59,11 @@ PanelWindow {
}
onVisibleChanged: {
if ( visible ) {
scaleValue = 0;
scaleAnimation.start();
} else {
if ( !visible )
root.menuStack.pop();
backEntry.visible = false;
}
}
NumberAnimation {
id: scaleAnimation
target: root
property: "scaleValue"
from: 0
to: 1
duration: 150
easing.type: Easing.OutCubic
onStopped: {
root.updateMask();
}
openAnim.start();
}
HyprlandFocusGrab {
@@ -85,7 +71,7 @@ PanelWindow {
windows: [ root ]
active: false
onCleared: {
root.visible = false;
closeAnim.start();
}
}
@@ -143,6 +129,54 @@ PanelWindow {
}
}
ParallelAnimation {
id: closeAnim
Anim {
target: menuRect
property: "implicitHeight"
to: 0
duration: MaterialEasing.expressiveEffectsTime
easing.bezierCurve: MaterialEasing.expressiveEffects
}
Anim {
targets: [ menuRect, shadowRect ]
property: "opacity"
from: 1
to: 0
duration: MaterialEasing.expressiveEffectsTime
easing.bezierCurve: MaterialEasing.expressiveEffects
}
onFinished: {
root.visible = false;
}
}
ParallelAnimation {
id: openAnim
Anim {
target: menuRect
property: "implicitHeight"
from: 0
to: listLayout.contentHeight + ( root.menuStack.length > 0 ? root.entryHeight + 10 : 10 )
duration: MaterialEasing.expressiveEffectsTime
easing.bezierCurve: MaterialEasing.expressiveEffects
}
Anim {
targets: [ menuRect, shadowRect ]
property: "opacity"
from: 0
to: 1
duration: MaterialEasing.expressiveEffectsTime
easing.bezierCurve: MaterialEasing.expressiveEffects
}
}
ShadowRect {
id: shadowRect
anchors.fill: menuRect
radius: menuRect.radius
}
Rectangle {
id: menuRect
x: Math.round( root.trayItemRect.x - ( menuRect.implicitWidth / 2 ) + 11 )
@@ -154,15 +188,6 @@ PanelWindow {
border.color: "#40FFFFFF"
clip: true
transform: [
Scale {
origin.x: menuRect.width / 2
origin.y: 0
xScale: root.scaleValue
yScale: root.scaleValue
}
]
Behavior on implicitWidth {
NumberAnimation {
duration: MaterialEasing.expressiveEffectsTime
@@ -242,7 +267,7 @@ PanelWindow {
if ( !menuItem.modelData.hasChildren ) {
if ( menuItem.modelData.enabled ) {
menuItem.modelData.triggered();
root.visible = false;
closeAnim.start();
}
} else {
root.menuStack.push(root.trayMenu);