Add NightLight, update README, format

This commit is contained in:
Ly-sec 2025-08-26 18:19:35 +02:00
parent 71cfbc8c0a
commit 634d78456d
11 changed files with 471 additions and 22 deletions

View file

@ -194,17 +194,13 @@ Loader {
property int calculatedY: {
if (panelAnchorVerticalCenter) {
return (panelWindow.height - panelHeight) / 2
}
else if (panelAnchorBottom) {
} else if (panelAnchorBottom) {
return panelWindow.height - panelHeight - (Style.marginS * scaling)
}
else if (panelAnchorTop) {
} else if (panelAnchorTop) {
return (Style.marginS * scaling)
}
else if (panelAnchorBottom) {
} else if (panelAnchorBottom) {
panelWindow.height - panelHeight - (Style.marginS * scaling)
}
else if (!barAtBottom) {
} else if (!barAtBottom) {
// Below the top bar
return Style.marginS * scaling
} else {

View file

@ -27,6 +27,7 @@ Item {
signal entered
signal exited
signal clicked
signal rightClicked
signal wheel(int delta)
// Internal state
@ -194,6 +195,7 @@ Item {
MouseArea {
anchors.fill: parent
hoverEnabled: true
acceptedButtons: Qt.LeftButton | Qt.RightButton
onEntered: {
root.entered()
tooltip.show()
@ -211,8 +213,12 @@ Item {
}
tooltip.hide()
}
onClicked: {
root.clicked()
onClicked: function (mouse) {
if (mouse.button === Qt.LeftButton) {
root.clicked()
} else if (mouse.button === Qt.RightButton) {
root.rightClicked()
}
}
onWheel: wheel => {
root.wheel(wheel.angleDelta.y)