Create a gist now

Instantly share code, notes, and snippets.

Embed
QML bug
import QtQuick 2.2
import QtQuick.Window 2.0
import QtQuick.Controls 1.1
import QtQuick.Controls.Styles 1.1
ApplicationWindow {
id: backlight
flags: Qt.SubWindow | Qt.Tool | Qt.FramelessWindowHint | Qt.WindowSystemMenuHint | Qt.WindowStaysOnTopHint
visible: true
title: qsTr("backlight")
width: 500
height: 50
x: (Screen.width - width) / 2
y: (Screen.height - height) / 2
color: "transparent"
property real slideValue
signal onSlide(real value)
Rectangle {
anchors.fill: parent
radius: 25
opacity: 0.3
color: "gray"
}
Slider {
anchors.centerIn: parent
width: backlight.width - 16
height: backlight.height
value: backlight.slideValue
focus: true
onValueChanged: backlight.onSlide(value)
Keys.onSpacePressed: Qt.quit()
Keys.onEscapePressed: Qt.quit()
style: SliderStyle {
groove: Rectangle {
implicitHeight: 8
radius: 4
color: "gray"
}
handle: Rectangle {
anchors.centerIn: parent
color: control.pressed ? "white" : "lightgray"
border.color: "gray"
border.width: 2
width: 34
height: 34
radius: 17
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment