add scrool or click actions
This commit is contained in:
parent
3dc6111825
commit
7ca7e1e952
3 changed files with 39 additions and 0 deletions
|
|
@ -9,6 +9,18 @@ Row {
|
|||
|
||||
property int percent: 0
|
||||
|
||||
Process {
|
||||
id: adjProc
|
||||
property string cmd: ""
|
||||
command: ["sh", "-c", cmd]
|
||||
onRunningChanged: if (!running && cmd !== "") current.reload()
|
||||
}
|
||||
|
||||
function adjust(delta) {
|
||||
adjProc.cmd = delta > 0 ? "light -A 5" : "light -U 5";
|
||||
adjProc.running = true;
|
||||
}
|
||||
|
||||
FileView {
|
||||
id: current
|
||||
path: "/sys/class/backlight/intel_backlight/brightness"
|
||||
|
|
@ -36,4 +48,8 @@ Row {
|
|||
font.family: M.Theme.fontFamily
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
WheelHandler {
|
||||
onWheel: event => root.adjust(event.angleDelta.y)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue