fix(workspace): add 120ms scroll throttle timer and auto-close popups on workspace switch to eliminate lag
This commit is contained in:
parent
8bc059af5f
commit
17d9edbd0c
@ -95,12 +95,22 @@ GlassPanel {
|
||||
id: wsItemMouse
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
onClicked: WorkspaceService.switchTo(wsItem.wsNumber)
|
||||
onClicked: {
|
||||
PopupService.closeAll()
|
||||
WorkspaceService.switchTo(wsItem.wsNumber)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Scroll Throttle Timer (Eliminates scroll lag during rapid mouse wheel scrolling)
|
||||
Timer {
|
||||
id: scrollThrottleTimer
|
||||
interval: 120
|
||||
repeat: false
|
||||
}
|
||||
|
||||
// Global Mouse Wheel Scroll Area
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
@ -108,6 +118,10 @@ GlassPanel {
|
||||
acceptedButtons: Qt.NoButton
|
||||
|
||||
onWheel: (wheel) => {
|
||||
if (scrollThrottleTimer.running) return;
|
||||
scrollThrottleTimer.restart();
|
||||
PopupService.closeAll()
|
||||
|
||||
if (wheel.angleDelta.y < 0) {
|
||||
if (WorkspaceService.activeWorkspace < WorkspaceService.totalWorkspaces) {
|
||||
WorkspaceService.switchTo(WorkspaceService.activeWorkspace + 1)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user