aboutsummaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2018-12-20 14:32:27 -0600
committerluigi1111 <luigi1111w@gmail.com>2018-12-20 14:32:27 -0600
commitd6981981d30f9a5e71f879dfe3b67792aa4db152 (patch)
tree127b67d887f97f685b1e394a45912cf501331e6f /components
parent9477fe9286620ebe8754f821a67905e43d003e83 (diff)
parent09a49f6392f21d218ebb046e171b2e91753f9365 (diff)
downloadmonzero-gui-d6981981d30f9a5e71f879dfe3b67792aa4db152.tar.gz
monzero-gui-d6981981d30f9a5e71f879dfe3b67792aa4db152.tar.xz
monzero-gui-d6981981d30f9a5e71f879dfe3b67792aa4db152.zip
Merge pull request #1842
09a49f6 RadioButton: remove a gap between rectangle and text, fix layout (xiphon)
Diffstat (limited to 'components')
-rw-r--r--components/RadioButton.qml35
1 files changed, 13 insertions, 22 deletions
diff --git a/components/RadioButton.qml b/components/RadioButton.qml
index 083cb301..09b79107 100644
--- a/components/RadioButton.qml
+++ b/components/RadioButton.qml
@@ -31,7 +31,7 @@ import QtQuick.Layouts 1.1
import "../components" as MoneroComponents
-RowLayout {
+Item {
id: radioButton
property alias text: label.text
property bool checked: false
@@ -39,6 +39,7 @@ RowLayout {
property alias fontColor: label.color
signal clicked()
height: 26 * scaleRatio
+ width: layout.width
// legacy properties
property var checkedColor: "white"
property var borderColor: checked ? Qt.rgba(1, 1, 1, 0.35) : Qt.rgba(1, 1, 1, 0.25)
@@ -49,15 +50,14 @@ RowLayout {
}
RowLayout {
- Layout.fillWidth: true
+ id: layout
+
Rectangle {
id: button
- anchors.left: parent.left
- y: 0
color: "transparent"
border.color: borderColor
- width: radioButton.height
height: radioButton.height
+ width: radioButton.height
radius: radioButton.height
Rectangle {
@@ -70,32 +70,23 @@ RowLayout {
radius: 10
opacity: 0.8
}
-
- MouseArea {
- anchors.fill: parent
- cursorShape: Qt.PointingHandCursor
- onClicked: {
- toggle()
- }
- }
}
Text {
id: label
- anchors.left: button.right
- anchors.leftMargin: !isMobile ? 10 : 8
+ Layout.leftMargin: (!isMobile ? 10 : 8) * scaleRatio
color: MoneroComponents.Style.defaultFontColor
font.family: MoneroComponents.Style.fontRegular.name
font.pixelSize: radioButton.fontSize
wrapMode: Text.Wrap
+ }
+ }
- MouseArea {
- anchors.fill: parent
- cursorShape: Qt.PointingHandCursor
- onClicked: {
- toggle()
- }
- }
+ MouseArea {
+ anchors.fill: parent
+ cursorShape: Qt.PointingHandCursor
+ onClicked: {
+ toggle()
}
}
}