Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tom Pillot
aseba
Commits
da919749
Unverified
Commit
da919749
authored
Apr 23, 2020
by
Michael Bonani
Committed by
GitHub
Apr 23, 2020
Browse files
#733 Fixing visual bug on robot name (#786)
Co-authored-by:
Valentina
<
tibaldo@di.uniroma1.it
>
parent
178a8bb5
Changes
2
Hide whitespace changes
Inline
Side-by-side
aseba/launcher/src/qml/EditableDeviceNameInput.qml
View file @
da919749
...
...
@@ -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
}
aseba/launcher/src/qml/ThymioSelectionDeviceDelegate.qml
View file @
da919749
...
...
@@ -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
:
4
0
height
:
4
8
deviceName
:
name
wrapMode
:
Text
.
WrapAnywhere
onAccepted
:
{
device
.
name
=
text
text
=
deviceName
}
...
...
@@ -299,4 +302,4 @@ Item {
}
}
}
}
\ No newline at end of file
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment