wizard: fix flags hovering, cursor, layout

pull/2/head
xiphon 6 years ago
parent 9f6b4334a1
commit 722d32a50c

@ -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,38 +128,50 @@ ColumnLayout {
clip: true clip: true
delegate: ColumnLayout { delegate: Item {
id: flagDelegate id: flagDelegate
height: gridView.cellHeight
width: gridView.cellWidth width: gridView.cellWidth
// height: gridView.cellHeight
// Layout.alignment: Qt.AlignHCenter ColumnLayout {
Rectangle { width: gridView.cellWidth
id: flagRect Rectangle {
width: 60 * scaleRatio; height: 60 * scaleRatio id: flagRect
// anchors.centerIn: parent height: 60 * scaleRatio
radius: 30 * scaleRatio width: 60 * scaleRatio
Layout.alignment: Qt.AlignHCenter radius: 30 * scaleRatio
color: gridView.currentIndex === index ? "#DBDBDB" : "#FFFFFF" Layout.alignment: Qt.AlignHCenter
Image { color: {
anchors.fill: parent if (gridView.currentIndex === index) {
source: flag return MoneroComponents.Style.buttonBackgroundColor;
} else if (delegateArea.containsMouse) {
return MoneroComponents.Style.dimmedFontColor;
} else {
return MoneroComponents.Style.buttonTextColor;
}
}
Image {
anchors.fill: parent
source: flag
}
} }
}
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 color: "#3F3F3F"
// elide: Text.ElideRight text: display_name
color: "#3F3F3F" Layout.alignment: Qt.AlignHCenter
text: display_name }
// horizontalAlignment: Text.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);