Skip to content
Snippets Groups Projects
Commit dcbe85f3 authored by Konstantin's avatar Konstantin
Browse files

[+]add dapRadioButton

parent 1f0a5e1d
No related branches found
No related tags found
2 merge requests!11Bugs 2893,!10[+]add dapRadioButton
...@@ -18,5 +18,7 @@ ...@@ -18,5 +18,7 @@
<file>widgets/DapTopPanel.qml</file> <file>widgets/DapTopPanel.qml</file>
<file>widgets/DapTopPanelForm.ui.qml</file> <file>widgets/DapTopPanelForm.ui.qml</file>
<file>Device.qml</file> <file>Device.qml</file>
<file>widgets/DapRadioButton.qml</file>
<file>widgets/DapRadioButtonForm.ui.qml</file>
</qresource> </qresource>
</RCC> </RCC>
import QtQuick 2.4
DapRadioButtonForm {
}
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
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment