From 3bc955fe8fb0926744448dfdc47dcace276cb7c9 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Thu, 1 Dec 2022 14:57:05 +0100 Subject: [PATCH] Fix review comments. - Text was cutoff instead of wrapped in Save Custom Profile (Rename Dialog). - Make the placeholder into a proper placeholder text. - Fix spelling (save -> safe). - Link didn't work as a link. - Slightly better tooltips. part of CURA-9347 --- resources/qml/Cura.qml | 33 ++++++++++++------- .../DiscardOrKeepProfileChangesDialog.qml | 8 ----- resources/qml/Dialogs/RenameDialog.qml | 3 ++ .../ProfileWarningReset.qml | 8 +++-- 4 files changed, 30 insertions(+), 22 deletions(-) diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index 2ba14a2d95..b70fc087ed 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -876,7 +876,7 @@ UM.MainWindow { id: createNewQualityDialog title: catalog.i18nc("@title:window", "Save Custom Profile") - object: catalog.i18nc("@textfield:placeholder", "") + objectPlaceholder: catalog.i18nc("@textfield:placeholder", "New Custom Profile") explanation: catalog.i18nc("@info", "Custom profile name:") extraInfo: [ @@ -887,17 +887,28 @@ UM.MainWindow source: UM.Theme.getIcon("Information") color: UM.Theme.getColor("text") }, - UM.Label + Column { - text: catalog.i18nc - ( - "@label %i will be replaced with a profile name", - "Only user changed settings will be saved in the custom profile.
" + - "The new custom profile will inherit properties from %1,
" + - "for materials that support it.
" + - "Learn more about Cura print profiles" - ).arg(Cura.MachineManager.activeQualityOrQualityChangesName).arg("https://support.ultimaker.com/s/article/1667337576882") - wrapMode: Text.WordWrap + UM.Label + { + text: catalog.i18nc + ( + "@label %i will be replaced with a profile name", + "Only user changed settings will be saved in the custom profile.
" + + "For materials that support it, the new custom profile will inherit properties from %1." + ).arg(Cura.MachineManager.activeQualityOrQualityChangesName) + wrapMode: Text.WordWrap + width: parent.parent.width - 2 * UM.Theme.getSize("message_type_icon").width + } + Cura.TertiaryButton + { + text: "Learn more about Cura print profiles" + iconSource: UM.Theme.getIcon("LinkExternal") + isIconOnRightSide: true + leftPadding: 0 + rightPadding: 0 + onClicked: Qt.openUrlExternally("https://support.ultimaker.com/s/article/1667337576882") + } } ] okButtonText: catalog.i18nc("@button", "Save new profile") diff --git a/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml b/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml index 4cae54158b..ea2a690321 100644 --- a/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml +++ b/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml @@ -155,14 +155,6 @@ UM.Dialog discardButton.enabled = true; } } - }, - Rectangle - { - // Workaround: If this placeholder isn't in here, then on repeated state-changes of the window, the rightButtons will be in the center (despite initially showing up right). - visible: alternateStates.state != "" - color: base.backgroundColor - implicitHeight: UM.Theme.getSize("combobox").height - implicitWidth: UM.Theme.getSize("combobox").width } ] diff --git a/resources/qml/Dialogs/RenameDialog.qml b/resources/qml/Dialogs/RenameDialog.qml index cbc8ad8224..1b3fd7f8e8 100644 --- a/resources/qml/Dialogs/RenameDialog.qml +++ b/resources/qml/Dialogs/RenameDialog.qml @@ -15,6 +15,7 @@ UM.Dialog buttonSpacing: UM.Theme.getSize("default_margin").width property string object: "" + property string objectPlaceholder: "" property alias newName: nameField.text property bool validName: true @@ -58,6 +59,8 @@ UM.Dialog id: nameField width: parent.width text: base.object + placeholderText: base.objectPlaceholder + placeholderTextColor: UM.Theme.getColor("text_field_text_disabled") maximumLength: 40 selectByMouse: true onTextChanged: base.textChanged(text) diff --git a/resources/qml/PrintSetupSelector/ProfileWarningReset.qml b/resources/qml/PrintSetupSelector/ProfileWarningReset.qml index d703296181..bd85f2dac6 100644 --- a/resources/qml/PrintSetupSelector/ProfileWarningReset.qml +++ b/resources/qml/PrintSetupSelector/ProfileWarningReset.qml @@ -114,7 +114,8 @@ Item UM.ToolTip { visible: parent.hovered - targetPoint: Qt.point(parent.x - width, Math.round(parent.y + parent.height / 2)) + y: parent.y + parent.height + UM.Theme.getSize("default_margin").height + targetPoint: Qt.point(parent.x, Math.round(parent.y + parent.height / 2)) tooltipText: catalog.i18nc("@info", "Reset to defaults.") } } @@ -148,8 +149,9 @@ Item UM.ToolTip { visible: parent.hovered - targetPoint: Qt.point(parent.x - width, Math.round(parent.y + parent.height / 2)) - tooltipText: catalog.i18nc("@info", "Compare and safe.") + y: parent.y + parent.height + UM.Theme.getSize("default_margin").height + targetPoint: Qt.point(parent.x, Math.round(parent.y + parent.height / 2)) + tooltipText: catalog.i18nc("@info", "Compare and save.") } } }