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 import StatusQ.Controls 0.1
Row { Item {
id: themeSwitch id: themeSwitchWrapper
signal checkedChanged() signal checkedChanged()
spacing: 2 width: themeSwitch.width
height: themeSwitch.height
Text { MouseArea {
text: "🌤" id: sensor
font.pixelSize: 15 hoverEnabled: true
anchors.verticalCenter: parent.verticalCenter anchors.fill: parent
}
StatusSwitch { Row {
onCheckedChanged: themeSwitch.checkedChanged() id: themeSwitch
} spacing: 2
Text { Text {
text: "🌙" text: "🌤"
font.pixelSize: 15 font.pixelSize: 15
anchors.verticalCenter: parent.verticalCenter 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
}
}
} }
} }