Fix text rendering issue in the menu bar

To denote the hotkey assigned with each menu item an ampersand is used
in the configuration. This ampersand was previously rendered directly
to the screen due to the `UM.Label`. This is now correctly replaced by
an underline.

CURA-8688
This commit is contained in:
casper 2022-03-01 13:12:35 +01:00
parent 71e0489c3e
commit 4ea93c5939

View file

@ -32,7 +32,10 @@ Item
contentItem: UM.Label contentItem: UM.Label
{ {
text: menuBarItem.text text: menuBarItem.text.replace(new RegExp("&([A-Za-z])"), function (match, character)
{
return `<u>${character}</u>`;
})
horizontalAlignment: Text.AlignLeft horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
} }