chore: add tooltip to theme switch

This commit is contained in:
Pascal Precht 2021-06-03 16:15:14 +02:00 committed by Michał Cieślak
parent aecbb443de
commit cd2fa3d0b7
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 import StatusQ.Controls 0.1
Row { Item {
id: themeSwitch id: themeSwitchWrapper
signal checkedChanged() signal checkedChanged()
width: themeSwitch.width
height: themeSwitch.height
MouseArea {
id: sensor
hoverEnabled: true
anchors.fill: parent
Row {
id: themeSwitch
spacing: 2 spacing: 2
Text { Text {
@ -16,7 +26,14 @@ Row {
} }
StatusSwitch { StatusSwitch {
onCheckedChanged: themeSwitch.checkedChanged() onCheckedChanged: themeSwitchWrapper.checkedChanged()
StatusToolTip {
text: "Toggle Theme"
visible: sensor.containsMouse
orientation: StatusToolTip.Orientation.Bottom
y: themeSwitchWrapper.y + 16
}
} }
Text { Text {
@ -24,5 +41,6 @@ Row {
font.pixelSize: 15 font.pixelSize: 15
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
} }
}
}
} }