mirror of
https://github.com/monero-project/monero-gui.git
synced 2025-01-05 10:29:30 +00:00
wizard: fix flags hovering, cursor, layout
This commit is contained in:
parent
9f6b4334a1
commit
722d32a50c
1 changed files with 37 additions and 25 deletions
|
@ -31,7 +31,7 @@ import QtQuick.XmlListModel 2.0
|
||||||
import QtQuick.Layouts 1.1
|
import QtQuick.Layouts 1.1
|
||||||
import QtQml 2.2
|
import QtQml 2.2
|
||||||
|
|
||||||
|
import "../components" as MoneroComponents
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
// anchors.fill:parent
|
// anchors.fill:parent
|
||||||
|
@ -128,18 +128,29 @@ ColumnLayout {
|
||||||
|
|
||||||
clip: true
|
clip: true
|
||||||
|
|
||||||
delegate: ColumnLayout {
|
delegate: Item {
|
||||||
id: flagDelegate
|
id: flagDelegate
|
||||||
|
height: gridView.cellHeight
|
||||||
|
width: gridView.cellWidth
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
width: gridView.cellWidth
|
width: gridView.cellWidth
|
||||||
// height: gridView.cellHeight
|
|
||||||
// Layout.alignment: Qt.AlignHCenter
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: flagRect
|
id: flagRect
|
||||||
width: 60 * scaleRatio; height: 60 * scaleRatio
|
height: 60 * scaleRatio
|
||||||
// anchors.centerIn: parent
|
width: 60 * scaleRatio
|
||||||
radius: 30 * scaleRatio
|
radius: 30 * scaleRatio
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
color: gridView.currentIndex === index ? "#DBDBDB" : "#FFFFFF"
|
color: {
|
||||||
|
if (gridView.currentIndex === index) {
|
||||||
|
return MoneroComponents.Style.buttonBackgroundColor;
|
||||||
|
} else if (delegateArea.containsMouse) {
|
||||||
|
return MoneroComponents.Style.dimmedFontColor;
|
||||||
|
} else {
|
||||||
|
return MoneroComponents.Style.buttonTextColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
source: flag
|
source: flag
|
||||||
|
@ -149,17 +160,18 @@ ColumnLayout {
|
||||||
Text {
|
Text {
|
||||||
font.family: "Arial"
|
font.family: "Arial"
|
||||||
font.pixelSize: 18 * scaleRatio
|
font.pixelSize: 18 * scaleRatio
|
||||||
// anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
font.bold: gridView.currentIndex === index
|
font.bold: gridView.currentIndex === index
|
||||||
// elide: Text.ElideRight
|
|
||||||
color: "#3F3F3F"
|
color: "#3F3F3F"
|
||||||
text: display_name
|
text: display_name
|
||||||
// horizontalAlignment: Text.AlignHCenter
|
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
id: delegateArea
|
id: delegateArea
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
hoverEnabled: true
|
||||||
onClicked: {
|
onClicked: {
|
||||||
gridView.currentIndex = index
|
gridView.currentIndex = index
|
||||||
var data = languagesModel.get(gridView.currentIndex);
|
var data = languagesModel.get(gridView.currentIndex);
|
||||||
|
|
Loading…
Reference in a new issue