quickshell: init config
This commit is contained in:
parent
cbb594395a
commit
5e9c4e8e4c
20 changed files with 1650 additions and 0 deletions
49
modules/style/quickshell/shell/services/Hover.qml
Normal file
49
modules/style/quickshell/shell/services/Hover.qml
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue