2020-09-17 15:55:09 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
import QtQml 2.14
|
|
|
|
import "../../imports"
|
|
|
|
import "../../shared"
|
|
|
|
|
|
|
|
RadioButton {
|
|
|
|
id: control
|
2020-09-29 06:39:29 +00:00
|
|
|
property bool isHovered: false
|
|
|
|
width: indicator.implicitWidth
|
|
|
|
|
|
|
|
function getColor() {
|
|
|
|
if (checked) {
|
|
|
|
return Style.current.blue
|
|
|
|
}
|
|
|
|
if (hovered || isHovered) {
|
|
|
|
return Style.current.secondaryHover
|
|
|
|
}
|
|
|
|
return Style.current.grey
|
|
|
|
}
|
|
|
|
|
2020-09-17 15:55:09 +00:00
|
|
|
indicator: Rectangle {
|
|
|
|
implicitWidth: 20
|
|
|
|
implicitHeight: 20
|
2020-09-18 12:22:33 +00:00
|
|
|
x: 0
|
|
|
|
y: 6
|
2020-09-17 15:55:09 +00:00
|
|
|
radius: 10
|
2020-09-29 06:39:29 +00:00
|
|
|
color: control.getColor()
|
2020-09-17 15:55:09 +00:00
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
width: 12
|
|
|
|
height: 12
|
|
|
|
radius: 6
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
color: control.checked ? Style.current.white : Style.current.grey
|
|
|
|
visible: control.checked
|
|
|
|
}
|
|
|
|
}
|
|
|
|
contentItem: StyledText {
|
|
|
|
text: control.text
|
|
|
|
color: Style.current.textColor
|
2020-09-18 12:22:33 +00:00
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
leftPadding: !!control.text ? control.indicator.width + control.spacing : control.indicator.width
|
|
|
|
font.pixelSize: 15
|
feat: Support system dark mode theme
Supports system dark mode. Changes the user appearance setting to a 3-way setting of System, Light, Dark.
New accounts will have their appearance setting set to "System", which uses the system setting to determine if dark mode should be applied.
Breaking change: Users who had their settings on Light Theme, will now get the system theme (light or dark). Users who had their theme set to Dark, will now get the Light theme.
At startup, the onboarding screens will have the system-level setting of dark mode applied or not. Once, logged in, the user settings will be applied.
## Note
An appearance setting of "System" is not dynamic to the system-level setting. This means that if a user has "System" set for their appearance (and ie, the user has light mode set), and then user then changes their system setting from light to dark, the app will not respond until it is restarted. This is due to a limitation of Qt not having a reliable way to propagate these changes to QML.
2020-09-29 06:18:00 +00:00
|
|
|
font.family: Style.current.fontRegular.name
|
2020-09-17 15:55:09 +00:00
|
|
|
}
|
|
|
|
}
|