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"
enableSectionSwitchChecked: platformAdhesionType.properties.value != "skirt" && platformAdhesionType.properties.value != "none"
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 {}
@ -38,6 +39,7 @@ RecommendedSettingSection
{
Layout.preferredHeight: childrenRect.height
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" }
}
]

View file

@ -30,6 +30,16 @@ Item
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
{

View file

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

View file

@ -16,6 +16,7 @@ RecommendedSettingSection
icon: UM.Theme.getIcon("Hammer")
enableSectionSwitchVisible: false
enableSectionSwitchEnabled: false
tooltipText: ""
UM.SettingPropertyProvider
{
@ -29,8 +30,8 @@ RecommendedSettingSection
contents: [
RecommendedSettingItem
{
settingName: catalog.i18nc("@action:label", "Infill Density")
tooltipText: catalog.i18nc("@label", "Gradual infill will gradually increase the amount of infill towards the top.")
settingName: catalog.i18nc("infill_sparse_density description", "Infill Density")
tooltipText: catalog.i18nc("@label", "Adjusts the density of infill of the print.")
settingControl: Cura.SingleSettingSlider
{
height: UM.Theme.getSize("combobox").height
@ -50,6 +51,7 @@ RecommendedSettingSection
RecommendedSettingItem
{
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
{

View file

@ -18,7 +18,7 @@ RecommendedSettingSection
enableSectionSwitchVisible: supportEnabled.properties.enabled == "True"
enableSectionSwitchChecked: supportEnabled.properties.value == "True"
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) {
supportEnabled.setPropertyValue("value", state)
@ -53,6 +53,7 @@ RecommendedSettingSection
RecommendedSettingItem
{
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
{
@ -64,11 +65,13 @@ RecommendedSettingSection
{
Layout.preferredHeight: childrenRect.height
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" }
},
RecommendedSettingItem
{
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
{