status-desktop/ui/shared/status/StatusImageRadioButton.qml
Alexandra Betouni 4ee21ada05 feat(desktop) Added image function in Style
Introduced Style.svg() Style.png() Style.emoji() and
Style.icon() in Style.qml. Those should be used to
set the source in Images instead of using relative
paths. Usage:
Image {
   source: Style.svg("check)
   ....

Also moved all Singletons inside a new "utils"
folder and made it a QML module, to use
import utils 1.0 instead of relative paths

Closes #3678
2021-09-28 15:28:00 -04:00

54 lines
1.3 KiB
QML

import QtQuick 2.13
import QtQuick.Controls 2.13
import QtQuick.Controls.Universal 2.12
import utils 1.0
import "../../shared"
import "./"
Rectangle {
id: root
property int padding: Style.current.padding
property alias control: radioControl
property alias image: img
property bool isHovered: false
signal radioCheckedChanged(checked: bool)
width: 312
height: 258
color: radioControl.checked ? Style.current.secondaryBackground :
(isHovered ? Style.current.backgroundHover : Style.current.transparent)
radius: Style.current.radius
SVGImage {
id: img
anchors.top: parent.top
anchors.topMargin: root.padding
anchors.left: parent.left
anchors.leftMargin: root.padding
anchors.right: parent.right
anchors.rightMargin: root.padding
}
StatusRadioButton {
id: radioControl
anchors.top: img.bottom
anchors.topMargin: root.padding
anchors.left: parent.left
anchors.leftMargin: root.padding
}
MouseArea {
anchors.fill: parent
hoverEnabled: true
onEntered: root.isHovered = true
onExited: root.isHovered = false
onClicked: {
root.radioCheckedChanged(!radioControl.checked)
}
cursorShape: Qt.PointingHandCursor
}
}