mirror of
https://github.com/monero-project/monero-gui.git
synced 2024-11-16 15:58:11 +00:00
RadioButton: remove a gap between rectangle and text, fix layout
This commit is contained in:
parent
bac833c1dd
commit
09a49f6392
1 changed files with 13 additions and 22 deletions
|
@ -31,7 +31,7 @@ import QtQuick.Layouts 1.1
|
||||||
|
|
||||||
import "../components" as MoneroComponents
|
import "../components" as MoneroComponents
|
||||||
|
|
||||||
RowLayout {
|
Item {
|
||||||
id: radioButton
|
id: radioButton
|
||||||
property alias text: label.text
|
property alias text: label.text
|
||||||
property bool checked: false
|
property bool checked: false
|
||||||
|
@ -39,6 +39,7 @@ RowLayout {
|
||||||
property alias fontColor: label.color
|
property alias fontColor: label.color
|
||||||
signal clicked()
|
signal clicked()
|
||||||
height: 26 * scaleRatio
|
height: 26 * scaleRatio
|
||||||
|
width: layout.width
|
||||||
// legacy properties
|
// legacy properties
|
||||||
property var checkedColor: "white"
|
property var checkedColor: "white"
|
||||||
property var borderColor: checked ? Qt.rgba(1, 1, 1, 0.35) : Qt.rgba(1, 1, 1, 0.25)
|
property var borderColor: checked ? Qt.rgba(1, 1, 1, 0.35) : Qt.rgba(1, 1, 1, 0.25)
|
||||||
|
@ -49,15 +50,14 @@ RowLayout {
|
||||||
}
|
}
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
Layout.fillWidth: true
|
id: layout
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: button
|
id: button
|
||||||
anchors.left: parent.left
|
|
||||||
y: 0
|
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
border.color: borderColor
|
border.color: borderColor
|
||||||
width: radioButton.height
|
|
||||||
height: radioButton.height
|
height: radioButton.height
|
||||||
|
width: radioButton.height
|
||||||
radius: radioButton.height
|
radius: radioButton.height
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
@ -70,24 +70,17 @@ RowLayout {
|
||||||
radius: 10
|
radius: 10
|
||||||
opacity: 0.8
|
opacity: 0.8
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: {
|
|
||||||
toggle()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: label
|
id: label
|
||||||
anchors.left: button.right
|
Layout.leftMargin: (!isMobile ? 10 : 8) * scaleRatio
|
||||||
anchors.leftMargin: !isMobile ? 10 : 8
|
|
||||||
color: MoneroComponents.Style.defaultFontColor
|
color: MoneroComponents.Style.defaultFontColor
|
||||||
font.family: MoneroComponents.Style.fontRegular.name
|
font.family: MoneroComponents.Style.fontRegular.name
|
||||||
font.pixelSize: radioButton.fontSize
|
font.pixelSize: radioButton.fontSize
|
||||||
wrapMode: Text.Wrap
|
wrapMode: Text.Wrap
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
@ -96,6 +89,4 @@ RowLayout {
|
||||||
toggle()
|
toggle()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue