quickshell: init config

This commit is contained in:
Bloxx12 2025-06-26 20:46:50 +02:00
commit 5e9c4e8e4c
Signed by: faukah
SSH key fingerprint: SHA256:Uj2AXqvtdCA4hn5Hq0ZonhIAyUqI1q4w2sMG3Z1TH7E
20 changed files with 1650 additions and 0 deletions

View file

@ -0,0 +1,49 @@
import Quickshell
import QtQuick
import "../config"
MouseArea {
id: root
anchors.fill: parent
hoverEnabled: true
required property ShellScreen screen
// required property Panels panels
required property Item bar
property bool showVolumeMenu: false
property bool isInRightPanel: false
// function withinPanelHeight(panel: Item, x: real, y: real): bool {
// const panelY = Config.border.thickness + panel.y;
// return y >= panelY - Config.border.rounding && y <= panelY + panel.height + Config.border.rounding;
// }
// function inLeftBorder(x: real, y: real): bool {
// return x <= Config.border.thickness;
// }
function inRightPanel(x: real, y: real): bool {
// Cursor is in middle veritcal third of screen
// Cursor is in the right border
return y >= root.screen.height / 3 && y <= (root.screen.height / 3) * 2 && x >= root.screen.width - Config.border.thickness;
}
// Update on mouse cursor movement
onPositionChanged: event => {
const x = event.x;
const y = event.y;
root.isInRightPanel = inRightPanel(x, y);
console.log("In right panel: " + root.isInRightPanel);
console.log("x:" + x + " y: " + y);
}
onContainsMouseChanged: {
if (!containsMouse) {
root.isInRightPanel = false;
}
}
}