chore: add tooltip to theme switch

This commit is contained in:
Pascal Precht 2021-06-03 16:15:14 +02:00 committed by Pascal Precht
parent 6083fbb1e9
commit 092cc9666d
1 changed files with 34 additions and 16 deletions

View File

@ -3,10 +3,20 @@ import QtQuick.Controls 2.14
import StatusQ.Controls 0.1
Row {
id: themeSwitch
Item {
id: themeSwitchWrapper
signal checkedChanged()
width: themeSwitch.width
height: themeSwitch.height
MouseArea {
id: sensor
hoverEnabled: true
anchors.fill: parent
Row {
id: themeSwitch
spacing: 2
Text {
@ -16,7 +26,14 @@ Row {
}
StatusSwitch {
onCheckedChanged: themeSwitch.checkedChanged()
onCheckedChanged: themeSwitchWrapper.checkedChanged()
StatusToolTip {
text: "Toggle Theme"
visible: sensor.containsMouse
orientation: StatusToolTip.Orientation.Bottom
y: themeSwitchWrapper.y + 16
}
}
Text {
@ -24,5 +41,6 @@ Row {
font.pixelSize: 15
anchors.verticalCenter: parent.verticalCenter
}
}
}
}