1
mirror of https://github.com/monero-project/monero-gui synced 2025-01-09 17:56:22 +01:00

Merge pull request #1863

c57b2ef PrivacyLevelSmall: fix variable shadowing (xiphon)
This commit is contained in:
luigi1111 2018-12-26 16:14:47 -06:00
commit 48a267f631
No known key found for this signature in database
GPG Key ID: F4ACA0183641E010

View File

@ -41,7 +41,7 @@ Item {
onFillLevelChanged: { onFillLevelChanged: {
if (!interactive) { if (!interactive) {
//print("fillLevel: " + fillLevel) //print("fillLevel: " + fillLevel)
fillRect.width = row.positions[fillLevel].currentX + row.x fillRect.width = ruler.positions[fillLevel].currentX + ruler.x
} }
} }
@ -71,7 +71,7 @@ Item {
anchors.left: parent.left anchors.left: parent.left
anchors.margins: 4 anchors.margins: 4
//radius: 2 //radius: 2
width: row.x width: ruler.x
color: "#FF6C3C" color: "#FF6C3C"
@ -94,7 +94,7 @@ Item {
font.family: "Arial" font.family: "Arial"
font.pixelSize: 15 font.pixelSize: 15
color: "#000000" color: "#000000"
x: row.x + (row.positions[0] !== undefined ? row.positions[0].currentX - 3 : 0) - width x: ruler.x + (ruler.positions[0] !== undefined ? ruler.positions[0].currentX - 3 : 0) - width
text: qsTr("Low") + translationManager.emptyString text: qsTr("Low") + translationManager.emptyString
} }
@ -103,7 +103,7 @@ Item {
font.family: "Arial" font.family: "Arial"
font.pixelSize: 15 font.pixelSize: 15
color: "#000000" color: "#000000"
x: row.x + (row.positions[4] !== undefined ? row.positions[4].currentX - 3 : 0) - width x: ruler.x + (ruler.positions[4] !== undefined ? ruler.positions[4].currentX - 3 : 0) - width
text: qsTr("Medium") + translationManager.emptyString text: qsTr("Medium") + translationManager.emptyString
} }
@ -112,7 +112,7 @@ Item {
font.family: "Arial" font.family: "Arial"
font.pixelSize: 15 font.pixelSize: 15
color: "#000000" color: "#000000"
x: row.x + (row.positions[13] !== undefined ? row.positions[13].currentX - 3 : 0) - width x: ruler.x + (ruler.positions[13] !== undefined ? ruler.positions[13].currentX - 3 : 0) - width
text: qsTr("High") + translationManager.emptyString text: qsTr("High") + translationManager.emptyString
} }
@ -123,7 +123,7 @@ Item {
var xDiff = 999999 var xDiff = 999999
var index = -1 var index = -1
for(var i = 0; i < 14; ++i) { for(var i = 0; i < 14; ++i) {
var tmp = Math.abs(row.positions[i].currentX + row.x - mouseX) var tmp = Math.abs(ruler.positions[i].currentX + ruler.x - mouseX)
if(tmp < xDiff) { if(tmp < xDiff) {
xDiff = tmp xDiff = tmp
index = i index = i
@ -131,7 +131,7 @@ Item {
} }
if(index !== -1) { if(index !== -1) {
fillRect.width = Qt.binding(function(){ return row.positions[index].currentX + row.x }) fillRect.width = Qt.binding(function(){ return ruler.positions[index].currentX + ruler.x })
item.fillLevel = index item.fillLevel = index
print ("fillLevel: " + item.fillLevel) print ("fillLevel: " + item.fillLevel)
} }
@ -143,7 +143,7 @@ Item {
} }
Row { Row {
id: row id: ruler
anchors.right: bar.right anchors.right: bar.right
anchors.rightMargin: 8 anchors.rightMargin: 8
anchors.top: bar.bottom anchors.top: bar.bottom
@ -164,7 +164,7 @@ Item {
width: 1 width: 1
color: "#DBDBDB" color: "#DBDBDB"
Component.onCompleted: { Component.onCompleted: {
row.positions[index] = delegateItem2 ruler.positions[index] = delegateItem2
} }
} }
} }
@ -184,7 +184,7 @@ Item {
width: 1 width: 1
color: "#DBDBDB" color: "#DBDBDB"
Component.onCompleted: { Component.onCompleted: {
row.positions[index + 4] = delegateItem1 ruler.positions[index + 4] = delegateItem1
} }
} }
} }