Unverified Commit da919749 authored by Michael Bonani's avatar Michael Bonani Committed by GitHub
Browse files

#733 Fixing visual bug on robot name (#786)



Co-authored-by: default avatarValentina <tibaldo@di.uniroma1.it>
parent 178a8bb5
......@@ -15,26 +15,28 @@ TextField {
//anchors.horizontalCenter: parent.horizontalCenter
font.family: "Roboto"
font.bold: readOnly
font.pointSize: 9
font.pointSize: 12
color : "white"
selectionColor: "#0a9eeb"
readOnly: true
maximumLength: 20
maximumLength: 30
wrapMode: Text.WrapAnywhere
FontMetrics {
id: fontMetrics
font: parent.font
}
onTextChanged: {
font.pointSize = 12
fontMetrics.font = font
while(fontMetrics.boundingRect(text).width >= width - 10) {
while(fontMetrics.boundingRect(text).width >= width - 9) {
font.pointSize = font.pointSize - 0.1
fontMetrics.font = font
if(font.pointSize < 5)
if(font.pointSize < 9.1)
break
}
}
......@@ -141,4 +143,4 @@ TextField {
horizontalAlignment:TextField.AlignHCenter
verticalAlignment: TextField.AlignVCenter
}
\ No newline at end of file
}
......@@ -7,7 +7,7 @@ Item {
property bool selectable: updateSelectable()
property double progress
Component.onCompleted: {
Component.onCompleted: {
device.groupChanged.connect(updateSelectable);
device.statusChanged.connect(updateSelectable);
......@@ -16,7 +16,7 @@ Item {
})
launcher.selectedAppChanged.connect(updateSelectable);
}
}
function isThymio(device) {
return device.type === ThymioNode.Thymio2
......@@ -262,9 +262,12 @@ Item {
id: textfield
editable: capabilities & ThymioNode.Rename
width: parent.width
height: 40
height: 48
deviceName: name
wrapMode: Text.WrapAnywhere
onAccepted: {
device.name = text
text = deviceName
}
......@@ -299,4 +302,4 @@ Item {
}
}
}
}
\ No newline at end of file
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment