From 4ea93c5939729d9c15ef0bfa92a091987122c95f Mon Sep 17 00:00:00 2001 From: casper Date: Tue, 1 Mar 2022 13:12:35 +0100 Subject: [PATCH] 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 --- resources/qml/MainWindow/ApplicationMenu.qml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/resources/qml/MainWindow/ApplicationMenu.qml b/resources/qml/MainWindow/ApplicationMenu.qml index 6792690328..bf3781331a 100644 --- a/resources/qml/MainWindow/ApplicationMenu.qml +++ b/resources/qml/MainWindow/ApplicationMenu.qml @@ -32,7 +32,10 @@ Item contentItem: UM.Label { - text: menuBarItem.text + text: menuBarItem.text.replace(new RegExp("&([A-Za-z])"), function (match, character) + { + return `${character}`; + }) horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter }