mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-13 05:19:08 +08:00
Nest all controls inside the mousearea of SettingItem
This makes hover events work properly without all the hassle
This commit is contained in:
parent
f5e97c5001
commit
3531e4c3e8
@ -16,7 +16,7 @@ Item {
|
|||||||
height: UM.Theme.getSize("section").height;
|
height: UM.Theme.getSize("section").height;
|
||||||
|
|
||||||
property alias contents: controlContainer.children;
|
property alias contents: controlContainer.children;
|
||||||
property bool hovered: false
|
property alias hovered: mouse.containsMouse
|
||||||
|
|
||||||
signal contextMenuRequested()
|
signal contextMenuRequested()
|
||||||
signal showTooltip(string text);
|
signal showTooltip(string text);
|
||||||
@ -52,7 +52,6 @@ Item {
|
|||||||
|
|
||||||
onTriggered: base.showTooltip(definition.description);
|
onTriggered: base.showTooltip(definition.description);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
@ -90,7 +89,7 @@ Item {
|
|||||||
{
|
{
|
||||||
id: revertButton;
|
id: revertButton;
|
||||||
|
|
||||||
// visible: base.overridden && base.is_enabled
|
visible: propertyProvider.properties.state == "InstanceState.User"
|
||||||
|
|
||||||
height: parent.height;
|
height: parent.height;
|
||||||
width: height;
|
width: height;
|
||||||
@ -108,16 +107,7 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onEntered: base.showTooltip(catalog.i18nc("@label", "This setting has a value that is different from the profile.\n\nClick to restore the value of the profile."))
|
onEntered: base.showTooltip(catalog.i18nc("@label", "This setting has a value that is different from the profile.\n\nClick to restore the value of the profile."))
|
||||||
onExited:
|
onExited: base.showTooltip(definition.description);
|
||||||
{
|
|
||||||
if(controlContainer.item && controlContainer.item.hovered)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
base.hovered = false;
|
|
||||||
base.hideTooltip();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
UM.SimpleButton
|
UM.SimpleButton
|
||||||
@ -125,7 +115,9 @@ Item {
|
|||||||
// This button shows when the setting has an inherited function, but is overriden by profile.
|
// This button shows when the setting has an inherited function, but is overriden by profile.
|
||||||
id: inheritButton;
|
id: inheritButton;
|
||||||
|
|
||||||
// visible: has_profile_value && base.has_inherit_function && base.is_enabled
|
//visible: has_profile_value && base.has_inherit_function && base.is_enabled
|
||||||
|
visible: propertyProvider.properties.state == "InstanceState.User"
|
||||||
|
|
||||||
height: parent.height;
|
height: parent.height;
|
||||||
width: height;
|
width: height;
|
||||||
|
|
||||||
@ -142,15 +134,7 @@ Item {
|
|||||||
iconSource: UM.Theme.getIcon("notice");
|
iconSource: UM.Theme.getIcon("notice");
|
||||||
|
|
||||||
onEntered: base.showTooltip(catalog.i18nc("@label", "This setting is normally calculated, but it currently has an absolute value set.\n\nClick to restore the calculated value."))
|
onEntered: base.showTooltip(catalog.i18nc("@label", "This setting is normally calculated, but it currently has an absolute value set.\n\nClick to restore the calculated value."))
|
||||||
|
onExited: base.showTooltip(definition.description);
|
||||||
onExited: {
|
|
||||||
if(controlContainer.item && controlContainer.item.hovered) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
base.hovered = false;
|
|
||||||
base.hideTooltip();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -165,6 +149,7 @@ Item {
|
|||||||
width: UM.Theme.getSize("setting_control").width;
|
width: UM.Theme.getSize("setting_control").width;
|
||||||
height: UM.Theme.getSize("setting_control").height
|
height: UM.Theme.getSize("setting_control").height
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
UM.I18nCatalog { id: catalog; name: "cura" }
|
UM.I18nCatalog { id: catalog; name: "cura" }
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user