mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-18 20:28:01 -06:00
Remove all the signal propagation for the tooltip and allow only Cura.qml to handle them
Contributes to CURA-5941.
This commit is contained in:
parent
adabb833e0
commit
7dc3320b06
11 changed files with 28 additions and 54 deletions
|
@ -6,5 +6,16 @@ import QtQuick.Controls 2.0
|
|||
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Cura.SettingView {
|
||||
|
||||
Item
|
||||
{
|
||||
id: customPrintSetup
|
||||
|
||||
// TODO: Hardcoded now but UX has to decide about the height of this item
|
||||
height: 500
|
||||
|
||||
Cura.SettingView
|
||||
{
|
||||
anchors.fill: parent
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,17 +9,13 @@ import Cura 1.0 as Cura
|
|||
|
||||
Cura.ExpandableComponent
|
||||
{
|
||||
id: base
|
||||
id: printSetupSelector
|
||||
|
||||
property bool hideSettings: PrintInformation.preSliced
|
||||
|
||||
property string enabledText: catalog.i18nc("@label:Should be short", "On")
|
||||
property string disabledText: catalog.i18nc("@label:Should be short", "Off")
|
||||
|
||||
// This widget doesn't show tooltips by itself. Instead it emits signals so others can do something with it.
|
||||
signal showTooltip(Item item, point location, string text)
|
||||
signal hideTooltip()
|
||||
|
||||
iconSource: UM.Theme.getIcon("pencil")
|
||||
popupPadding: UM.Theme.getSize("default_lining").width
|
||||
popupSpacingY: UM.Theme.getSize("narrow_margin").width
|
||||
|
@ -32,17 +28,6 @@ Cura.ExpandableComponent
|
|||
name: "cura"
|
||||
}
|
||||
|
||||
Timer
|
||||
{
|
||||
id: tooltipDelayTimer
|
||||
interval: 500
|
||||
repeat: false
|
||||
property var item
|
||||
property string text
|
||||
|
||||
onTriggered: base.showTooltip(base, {x: 0, y: item.y}, text)
|
||||
}
|
||||
|
||||
headerItem: PrintSetupSelectorHeader
|
||||
{
|
||||
anchors.fill: parent
|
||||
|
|
|
@ -93,7 +93,7 @@ Item
|
|||
Item
|
||||
{
|
||||
id: contents
|
||||
height: childrenRect.height
|
||||
height: currentModeIndex == 0 ? recommendedPrintSetup.height : customPrintSetup.height
|
||||
|
||||
anchors
|
||||
{
|
||||
|
@ -104,28 +104,25 @@ Item
|
|||
|
||||
RecommendedPrintSetup
|
||||
{
|
||||
id: recommendedPrintSetup
|
||||
anchors
|
||||
{
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
top: parent.top
|
||||
}
|
||||
onShowTooltip: base.showTooltip(item, location, text)
|
||||
onHideTooltip: base.hideTooltip()
|
||||
visible: currentModeIndex == 0
|
||||
}
|
||||
|
||||
CustomPrintSetup
|
||||
{
|
||||
id: customPrintSetup
|
||||
anchors
|
||||
{
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
top: parent.top
|
||||
}
|
||||
height: 500
|
||||
onShowTooltip: base.showTooltip(item, location, text)
|
||||
onHideTooltip: base.hideTooltip()
|
||||
visible: currentModeIndex == 1
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ Item
|
|||
Item
|
||||
{
|
||||
id: enableAdhesionContainer
|
||||
height: childrenRect.height
|
||||
height: enableAdhesionCheckBox.height
|
||||
|
||||
anchors
|
||||
{
|
||||
|
@ -46,9 +46,11 @@ Item
|
|||
id: enableAdhesionCheckBox
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
property alias _hovered: adhesionMouseArea.containsMouse
|
||||
|
||||
//: Setting enable printing build-plate adhesion helper checkbox
|
||||
style: UM.Theme.styles.checkbox
|
||||
enabled: base.settingsEnabled
|
||||
enabled: recommendedPrintSettup.settingsEnabled
|
||||
|
||||
visible: platformAdhesionType.properties.enabled == "True"
|
||||
checked: platformAdhesionType.properties.value != "skirt" && platformAdhesionType.properties.value != "none"
|
||||
|
@ -58,7 +60,6 @@ Item
|
|||
id: adhesionMouseArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
enabled: base.settingsEnabled
|
||||
|
||||
onClicked:
|
||||
{
|
||||
|
|
|
@ -189,7 +189,7 @@ Item
|
|||
|
||||
text: catalog.i18nc("@label", "Gradual infill")
|
||||
style: UM.Theme.styles.checkbox
|
||||
enabled: base.settingsEnabled
|
||||
enabled: recommendedPrintSettup.settingsEnabled
|
||||
visible: infillSteps.properties.enabled == "True"
|
||||
checked: parseInt(infillSteps.properties.value) > 0
|
||||
|
||||
|
|
|
@ -10,13 +10,10 @@ import Cura 1.0 as Cura
|
|||
|
||||
Item
|
||||
{
|
||||
id: base
|
||||
id: recommendedPrintSettup
|
||||
|
||||
height: childrenRect.height + 2 * padding
|
||||
|
||||
signal showTooltip(Item item, point location, string text)
|
||||
signal hideTooltip()
|
||||
|
||||
property Action configureSettings
|
||||
|
||||
property bool settingsEnabled: Cura.ExtruderManager.activeExtruderStackId || extrudersEnabledCount.properties.value == 1
|
||||
|
|
|
@ -50,7 +50,7 @@ Item
|
|||
property alias _hovered: enableSupportMouseArea.containsMouse
|
||||
|
||||
style: UM.Theme.styles.checkbox
|
||||
enabled: base.settingsEnabled
|
||||
enabled: recommendedPrintSettup.settingsEnabled
|
||||
|
||||
visible: supportEnabled.properties.enabled == "True"
|
||||
checked: supportEnabled.properties.value == "True"
|
||||
|
@ -60,6 +60,7 @@ Item
|
|||
id: enableSupportMouseArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
|
||||
onClicked: supportEnabled.setPropertyValue("value", supportEnabled.properties.value != "True")
|
||||
|
||||
onEntered:
|
||||
|
@ -86,7 +87,7 @@ Item
|
|||
}
|
||||
|
||||
style: UM.Theme.styles.combobox_color
|
||||
enabled: base.settingsEnabled
|
||||
enabled: recommendedPrintSettup.settingsEnabled
|
||||
visible: enableSupportCheckBox.visible && (supportEnabled.properties.value == "True") && (extrudersEnabledCount.properties.value > 1)
|
||||
textRole: "text" // this solves that the combobox isn't populated in the first time Cura is started
|
||||
|
||||
|
@ -126,7 +127,7 @@ Item
|
|||
id: supportExtruderMouseArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
enabled: base.settingsEnabled
|
||||
enabled: recommendedPrintSettup.settingsEnabled
|
||||
acceptedButtons: Qt.NoButton
|
||||
onEntered:
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue