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,26 +3,44 @@ import QtQuick.Controls 2.14
import StatusQ.Controls 0.1
Row {
id: themeSwitch
Item {
id: themeSwitchWrapper
signal checkedChanged()
spacing: 2
width: themeSwitch.width
height: themeSwitch.height
Text {
text: "🌤"
font.pixelSize: 15
anchors.verticalCenter: parent.verticalCenter
}
MouseArea {
id: sensor
hoverEnabled: true
anchors.fill: parent
StatusSwitch {
onCheckedChanged: themeSwitch.checkedChanged()
}
Row {
id: themeSwitch
spacing: 2
Text {
text: "🌙"
font.pixelSize: 15
anchors.verticalCenter: parent.verticalCenter
Text {
text: "🌤"
font.pixelSize: 15
anchors.verticalCenter: parent.verticalCenter
}
StatusSwitch {
onCheckedChanged: themeSwitchWrapper.checkedChanged()
StatusToolTip {
text: "Toggle Theme"
visible: sensor.containsMouse
orientation: StatusToolTip.Orientation.Bottom
y: themeSwitchWrapper.y + 16
}
}
Text {
text: "🌙"
font.pixelSize: 15
anchors.verticalCenter: parent.verticalCenter
}
}
}
}