Add tooltips

CURA-9793
This commit is contained in:
Joey de l'Arago 2022-11-30 17:44:58 +01:00
parent 487bf41a7b
commit 574b1000f6
5 changed files with 24 additions and 8 deletions

View File

@ -17,6 +17,7 @@ RecommendedSettingSection
enableSectionSwitchVisible: platformAdhesionType.properties.enabled == "True" enableSectionSwitchVisible: platformAdhesionType.properties.enabled == "True"
enableSectionSwitchChecked: platformAdhesionType.properties.value != "skirt" && platformAdhesionType.properties.value != "none" enableSectionSwitchChecked: platformAdhesionType.properties.value != "skirt" && platformAdhesionType.properties.value != "none"
enableSectionSwitchEnabled: recommendedPrintSetup.settingsEnabled enableSectionSwitchEnabled: recommendedPrintSetup.settingsEnabled
tooltipText: catalog.i18nc("@label", "Enable printing a brim or raft. This will add a flat area around or under your object which is easy to cut off afterwards.")
property var curaRecommendedMode: Cura.RecommendedMode {} property var curaRecommendedMode: Cura.RecommendedMode {}
@ -38,6 +39,7 @@ RecommendedSettingSection
{ {
Layout.preferredHeight: childrenRect.height Layout.preferredHeight: childrenRect.height
settingName: catalog.i18nc("@action:label", "Print with") settingName: catalog.i18nc("@action:label", "Print with")
tooltipText: catalog.i18nc("adhesion_extruder_nr description", "The extruder train to use for printing the skirt/brim/raft. This is used in multi-extrusion.")
settingControl: Cura.SingleSettingExtruderSelectorBar { extruderSettingName: "adhesion_extruder_nr" } settingControl: Cura.SingleSettingExtruderSelectorBar { extruderSettingName: "adhesion_extruder_nr" }
} }
] ]

View File

@ -30,6 +30,16 @@ Item
anchors.leftMargin: UM.Theme.getSize("medium_button_icon").width + UM.Theme.getSize("default_margin").width anchors.leftMargin: UM.Theme.getSize("medium_button_icon").width + UM.Theme.getSize("default_margin").width
} }
MouseArea
{
id: tooltipArea
anchors.fill: settingLabel
propagateComposedEvents: true
hoverEnabled: true
onEntered: base.showTooltip(parent, Qt.point(-UM.Theme.getSize("thick_margin").width, 0), tooltipText)
onExited: base.hideTooltip()
}
Loader Loader
{ {

View File

@ -16,9 +16,9 @@ Item
property alias enableSectionSwitchVisible: enableSectionSwitch.visible property alias enableSectionSwitchVisible: enableSectionSwitch.visible
property alias enableSectionSwitchChecked: enableSectionSwitch.checked property alias enableSectionSwitchChecked: enableSectionSwitch.checked
property alias enableSectionSwitchEnabled: enableSectionSwitch.enabled property alias enableSectionSwitchEnabled: enableSectionSwitch.enabled
property string tooltipText: "test"
property var enableSectionClicked: { return } property var enableSectionClicked: { return }
property int leftColumnWidth: Math.floor(width * 0.35) property int leftColumnWidth: Math.floor(width * 0.35)
property var toolTipText: ""
property alias contents: settingColumn.children property alias contents: settingColumn.children
@ -49,13 +49,12 @@ Item
MouseArea MouseArea
{ {
id: tooltipMouseArea id: tooltipArea
anchors.fill: sectionTitle anchors.fill: sectionTitle
propagateComposedEvents: true propagateComposedEvents: true
hoverEnabled: true hoverEnabled: true
onEntered: base.showTooltip(parent, Qt.point(-UM.Theme.getSize("thick_margin").width, 0), tooltipText)
onEntered: { print("showTooltip") } onExited: base.hideTooltip()
onExited: { print("hideTooltip" ) }
} }
} }

View File

@ -16,6 +16,7 @@ RecommendedSettingSection
icon: UM.Theme.getIcon("Hammer") icon: UM.Theme.getIcon("Hammer")
enableSectionSwitchVisible: false enableSectionSwitchVisible: false
enableSectionSwitchEnabled: false enableSectionSwitchEnabled: false
tooltipText: ""
UM.SettingPropertyProvider UM.SettingPropertyProvider
{ {
@ -29,8 +30,8 @@ RecommendedSettingSection
contents: [ contents: [
RecommendedSettingItem RecommendedSettingItem
{ {
settingName: catalog.i18nc("@action:label", "Infill Density") settingName: catalog.i18nc("infill_sparse_density description", "Infill Density")
tooltipText: catalog.i18nc("@label", "Gradual infill will gradually increase the amount of infill towards the top.") tooltipText: catalog.i18nc("@label", "Adjusts the density of infill of the print.")
settingControl: Cura.SingleSettingSlider settingControl: Cura.SingleSettingSlider
{ {
height: UM.Theme.getSize("combobox").height height: UM.Theme.getSize("combobox").height
@ -50,6 +51,7 @@ RecommendedSettingSection
RecommendedSettingItem RecommendedSettingItem
{ {
settingName: catalog.i18nc("@action:label", "Infill Pattern") settingName: catalog.i18nc("@action:label", "Infill Pattern")
tooltipText: catalog.i18nc("infill_pattern description", "The pattern of the infill material of the print. The line and zig zag infill swap direction on alternate layers, reducing material cost. The grid, triangle, tri-hexagon, cubic, octet, quarter cubic, cross and concentric patterns are fully printed every layer. Gyroid, cubic, quarter cubic and octet infill change with every layer to provide a more equal distribution of strength over each direction. Lightning infill tries to minimize the infill, by only supporting the ceiling of the object.")
settingControl: Cura.SingleSettingComboBox settingControl: Cura.SingleSettingComboBox
{ {

View File

@ -18,7 +18,7 @@ RecommendedSettingSection
enableSectionSwitchVisible: supportEnabled.properties.enabled == "True" enableSectionSwitchVisible: supportEnabled.properties.enabled == "True"
enableSectionSwitchChecked: supportEnabled.properties.value == "True" enableSectionSwitchChecked: supportEnabled.properties.value == "True"
enableSectionSwitchEnabled: recommendedPrintSetup.settingsEnabled enableSectionSwitchEnabled: recommendedPrintSetup.settingsEnabled
toolTipText: catalog.i18nc("@label", "Generate structures to support parts of the model which have overhangs. Without these structures, such parts would collapse during printing.") tooltipText: catalog.i18nc("@label", "Generate structures to support parts of the model which have overhangs. Without these structures, such parts would collapse during printing.")
function onEnableSectionChanged(state) { function onEnableSectionChanged(state) {
supportEnabled.setPropertyValue("value", state) supportEnabled.setPropertyValue("value", state)
@ -53,6 +53,7 @@ RecommendedSettingSection
RecommendedSettingItem RecommendedSettingItem
{ {
settingName: catalog.i18nc("@action:label", "Support Type") settingName: catalog.i18nc("@action:label", "Support Type")
tooltipText: catalog.i18nc("support_structure description", "Chooses between the techniques available to generate support. \"Normal\" support creates a support structure directly below the overhanging parts and drops those areas straight down. \"Tree\" support creates branches towards the overhanging areas that support the model on the tips of those branches, and allows the branches to crawl around the model to support it from the build plate as much as possible.")
settingControl: Cura.SingleSettingComboBox settingControl: Cura.SingleSettingComboBox
{ {
@ -64,11 +65,13 @@ RecommendedSettingSection
{ {
Layout.preferredHeight: childrenRect.height Layout.preferredHeight: childrenRect.height
settingName: catalog.i18nc("@action:label", "Print with") settingName: catalog.i18nc("@action:label", "Print with")
tooltipText: catalog.i18nc("support_extruder_nr description", "The extruder train to use for printing the support. This is used in multi-extrusion.")
settingControl: Cura.SingleSettingExtruderSelectorBar { extruderSettingName: "support_extruder_nr" } settingControl: Cura.SingleSettingExtruderSelectorBar { extruderSettingName: "support_extruder_nr" }
}, },
RecommendedSettingItem RecommendedSettingItem
{ {
settingName: catalog.i18nc("@action:label", "Placement") settingName: catalog.i18nc("@action:label", "Placement")
tooltipText: catalog.i18nc("support_type description", "Adjusts the placement of the support structures. The placement can be set to touching build plate or everywhere. When set to everywhere the support structures will also be printed on the model.")
settingControl: Cura.SingleSettingComboBox settingControl: Cura.SingleSettingComboBox
{ {