mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-14 18:27:51 -06:00
Fix overlap of unit and setting value with RTL-languages
The unit was hard-coded to be anchored to the right. The text was getting the full width and aligned implicitly by the language. We'll keep the layout of the text properly internationalised, but make sure that the unit is opposite of wherever the text is. Fixes CURA-8206. Fixes #9667.
This commit is contained in:
parent
dc8c5e4268
commit
836e7c0c9b
1 changed files with 11 additions and 4 deletions
|
@ -1,4 +1,4 @@
|
||||||
// Copyright (c) 2017 Ultimaker B.V.
|
// Copyright (c) 2021 Ultimaker B.V.
|
||||||
// Cura is released under the terms of the LGPLv3 or higher.
|
// Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
import QtQuick 2.7
|
import QtQuick 2.7
|
||||||
|
@ -92,11 +92,18 @@ SettingItem
|
||||||
|
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
anchors.right: parent.right
|
anchors
|
||||||
anchors.rightMargin: Math.round(UM.Theme.getSize("setting_unit_margin").width)
|
{
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
left: parent.left
|
||||||
|
leftMargin: Math.round(UM.Theme.getSize("setting_unit_margin").width)
|
||||||
|
right: parent.right
|
||||||
|
rightMargin: Math.round(UM.Theme.getSize("setting_unit_margin").width)
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
|
||||||
text: definition.unit
|
text: definition.unit
|
||||||
|
//However the setting value is aligned, align the unit opposite. That way it stays readable with right-to-left languages.
|
||||||
|
horizontalAlignment: (input.effectiveHorizontalAlignment == Text.AlignLeft) ? Text.AlignRight : Text.AlignLeft
|
||||||
textFormat: Text.PlainText
|
textFormat: Text.PlainText
|
||||||
renderType: Text.NativeRendering
|
renderType: Text.NativeRendering
|
||||||
color: UM.Theme.getColor("setting_unit")
|
color: UM.Theme.getColor("setting_unit")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue