2
0
mirror of synced 2025-01-10 14:26:28 +00:00
status-qml/sandbox/ThemeSwitch.qml
Stefan 5f8453659d feat(Sandbox): add visual test setup page for StatusImageCropPanel
Other improvements:

- save state for theme switcher and last selected page
- add optional fill all test space for pages

fixes: 5401
2022-05-05 17:16:13 +02:00

50 lines
1.1 KiB
QML

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