diff --git a/libdap-qt-ui-qml.qrc b/libdap-qt-ui-qml.qrc index 5a82b513f46eb12cd2aa8771573dd5cb4c2359ec..244e6b05d0f40c974f42efadada094a31d9806eb 100644 --- a/libdap-qt-ui-qml.qrc +++ b/libdap-qt-ui-qml.qrc @@ -18,5 +18,7 @@ <file>widgets/DapTopPanel.qml</file> <file>widgets/DapTopPanelForm.ui.qml</file> <file>Device.qml</file> + <file>widgets/DapRadioButton.qml</file> + <file>widgets/DapRadioButtonForm.ui.qml</file> </qresource> </RCC> diff --git a/widgets/DapRadioButton.qml b/widgets/DapRadioButton.qml new file mode 100644 index 0000000000000000000000000000000000000000..90662ac4c8866dd14324f18815932c5e1d8f6402 --- /dev/null +++ b/widgets/DapRadioButton.qml @@ -0,0 +1,4 @@ +import QtQuick 2.4 + +DapRadioButtonForm { +} diff --git a/widgets/DapRadioButtonForm.ui.qml b/widgets/DapRadioButtonForm.ui.qml new file mode 100644 index 0000000000000000000000000000000000000000..25eb1020280b24623a1f21fe3c7af38fa10098e2 --- /dev/null +++ b/widgets/DapRadioButtonForm.ui.qml @@ -0,0 +1,80 @@ +import QtQuick 2.0 +import QtQuick.Controls 2.0 + +RadioButton +{ + ///@detalis textButton Text RadioButton. + property alias nameRadioButton: nameButton.text + ///@detalis nameTextColor Text color. + property alias nameTextColor: nameButton.color + ///@detalis nameTextPixelSize Text size(px). + property alias nameTextPixelSize: nameButton.font.pixelSize + ///@detalis widthRadioButton Width RadioButton. + property alias widthRadioButton: customRadioButton.implicitWidth + ///@detalis heightRadioButton Height RadioButton. + property alias heightRadioButton: customRadioButton.implicitHeight + ///@detalis backgroundColor RadioButton background color + property alias backgroundColor:backgroundColor.color + ///@detalis spaceIndicatorText The gap between the indicator and the text. + property int spaceIndicatorText: 15 * pt + ///@detalis indicatorBorderColor Border color indicator. + property string indicatorBorderColor:"#3E3853" + ///@detalis indicatorBackgroundColor Background color indicator. + property string indicatorBackgroundColor:"transparent" + ///@detalis indicatorInnerColorActiv Color of the inner circle in checked condition. + property string indicatorInnerColorActiv:indicatorBorderColor + ///@detalis indicatorInnerColorNormal Color of the inner circle in normal condition. + property string indicatorInnerColorNormal:indicatorBackgroundColor + ///@detalis indicatorSize The size of the main circle of the indicator. + property int indicatorSize: 25 * pt + ///@detalis indicatorInnerSize The size of the inner circle of the indicator. + property int indicatorInnerSize: 15 * pt + + id: customRadioButton + + ///Text Options. + contentItem: Text { + id: nameButton + anchors.left: parent.left + anchors.right: parent.right + anchors.leftMargin: customRadioButton.indicator.width + spaceIndicatorText + verticalAlignment: Text.AlignVCenter + anchors.verticalCenter: parent.verticalCenter + color: "#3E3853" + font.pixelSize: 16 * pt + font.family: "Roboto" + horizontalAlignment: Text.AlignLeft + text: qsTr("template") + } + ///Indicator Options. + indicator: Rectangle { + id: indicatorRadioButton + implicitWidth: indicatorSize + implicitHeight: indicatorSize + x: 0 + y: parent.height / 2 - height / 2 + radius: indicatorSize/2 + color: indicatorBackgroundColor + border.color: indicatorBorderColor + + ///Indicator inner options. + Rectangle { + width: indicatorInnerSize + height: indicatorInnerSize + x: (indicatorRadioButton.width/2)-(width/2) + y: (indicatorRadioButton.height/2)-(height/2) + radius: indicatorInnerSize/2 + color: customRadioButton.checked ? indicatorInnerColorActiv : indicatorInnerColorNormal + } + } + ///Background options. + background: Rectangle + { + id:backgroundColor + anchors.fill:parent + color:"transparent" + } + + checked: false + autoExclusive: true +}