Huge quickshell progress dump

Was requested
This commit is contained in:
outfoxxed 2024-06-17 00:49:34 -07:00
parent 57d9f9a72e
commit 945793973e
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E
42 changed files with 2140 additions and 142 deletions

View file

@ -12,9 +12,21 @@ Scope {
readonly property TooltipItem activeItem: activeMenu ?? activeTooltip;
property TooltipItem lastActiveItem: null;
property Item tooltipItem: null;
onActiveItemChanged: {
if (activeItem != null) activeItem.visible = true;
if (lastActiveItem != null) lastActiveItem.visible = false;
if (activeItem != null) {
activeItem.targetVisible = true;
if (tooltipItem) {
activeItem.parent = tooltipItem;
}
}
if (lastActiveItem != null && lastActiveItem != activeItem) {
lastActiveItem.targetVisible = false;
}
lastActiveItem = activeItem;
}
@ -40,21 +52,22 @@ Scope {
PopupWindow {
id: popup
parentWindow: bar.widgetSurface
relativeX: bar.widgetSurface.tooltipXOffset
parentWindow: bar
relativeX: bar.tooltipXOffset
relativeY: 0
height: bar.widgetSurface.height
width: tooltipItem.width
height: bar.height
width: 1000//Math.max(1, widthAnim.running ? Math.max(tooltipItem.targetWidth, tooltipItem.lastTargetWidth) : tooltipItem.targetWidth)
visible: true
color: "transparent"
//color: "#20000000"
mask: Region {
item: (activeItem?.isMenu ?? false) ? tooltipItem : null
item: (activeItem?.hoverable ?? false) ? tooltipItem : null
}
HyprlandFocusGrab {
active: activeItem?.isMenu ?? false
windows: [ popup, bar.widgetSurface ]
windows: [ popup, bar ]
onActiveChanged: {
if (!active && activeItem?.isMenu) {
activeMenu.close()
@ -62,19 +75,34 @@ Scope {
}
}
BarWidgetInner {
Item {
id: tooltipItem
Component.onCompleted: {
root.tooltipItem = this;
if (root.activeItem) {
root.activeItem.parent = this;
}
}
readonly property var targetWidth: activeItem?.implicitWidth ?? 10;
readonly property var targetHeight: (activeItem?.implicitHeight ?? 0) + 10;
readonly property var targetWidth: activeItem?.implicitWidth ?? 0;
readonly property var targetHeight: activeItem?.implicitHeight ?? 0;
property var lastTargetWidthTracker: 0;
property var lastTargetWidth: 0;
onTargetWidthChanged: {
lastTargetWidth = lastTargetWidthTracker;
lastTargetWidthTracker = targetWidth;
}
readonly property real targetY: {
if (activeItem == null) return 0;
const target = bar.widgetSurface.contentItem.mapFromItem(activeItem.owner, 0, activeItem.targetRelativeY).y;
return bar.widgetSurface.boundedY(target, activeItem.implicitHeight / 2);
const target = bar.contentItem.mapFromItem(activeItem.owner, 0, activeItem.targetRelativeY).y;
return bar.boundedY(target, activeItem.implicitHeight / 2);
}
width: targetWidth + 10
property var w: -1
width: Math.max(1, w)
property var y1: -1
property var y2: -1
@ -112,13 +140,19 @@ Scope {
}
}
Item {
clip: true
children: [ activeItem ]
anchors {
fill: parent
margins: 5
SmoothedAnimation {
id: widthAnim
target: tooltipItem
property: "w"
to: tooltipItem.targetWidth;
onToChanged: {
if (tooltipItem.w == -1) {
stop();
tooltipItem.w = to;
} else {
velocity = (Math.max(tooltipItem.width, to) - Math.min(tooltipItem.width, to)) * 5;
restart();
}
}
}
}