mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-13 03:19:04 +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;
|
||||
|
||||
property alias contents: controlContainer.children;
|
||||
property bool hovered: false
|
||||
property alias hovered: mouse.containsMouse
|
||||
|
||||
signal contextMenuRequested()
|
||||
signal showTooltip(string text);
|
||||
@ -52,7 +52,6 @@ Item {
|
||||
|
||||
onTriggered: base.showTooltip(definition.description);
|
||||
}
|
||||
}
|
||||
|
||||
Label
|
||||
{
|
||||
@ -90,7 +89,7 @@ Item {
|
||||
{
|
||||
id: revertButton;
|
||||
|
||||
// visible: base.overridden && base.is_enabled
|
||||
visible: propertyProvider.properties.state == "InstanceState.User"
|
||||
|
||||
height: parent.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."))
|
||||
onExited:
|
||||
{
|
||||
if(controlContainer.item && controlContainer.item.hovered)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
base.hovered = false;
|
||||
base.hideTooltip();
|
||||
}
|
||||
onExited: base.showTooltip(definition.description);
|
||||
}
|
||||
|
||||
UM.SimpleButton
|
||||
@ -126,6 +116,8 @@ Item {
|
||||
id: inheritButton;
|
||||
|
||||
//visible: has_profile_value && base.has_inherit_function && base.is_enabled
|
||||
visible: propertyProvider.properties.state == "InstanceState.User"
|
||||
|
||||
height: parent.height;
|
||||
width: height;
|
||||
|
||||
@ -142,15 +134,7 @@ Item {
|
||||
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."))
|
||||
|
||||
onExited: {
|
||||
if(controlContainer.item && controlContainer.item.hovered) {
|
||||
return;
|
||||
}
|
||||
|
||||
base.hovered = false;
|
||||
base.hideTooltip();
|
||||
}
|
||||
onExited: base.showTooltip(definition.description);
|
||||
}
|
||||
|
||||
}
|
||||
@ -165,6 +149,7 @@ Item {
|
||||
width: UM.Theme.getSize("setting_control").width;
|
||||
height: UM.Theme.getSize("setting_control").height
|
||||
}
|
||||
}
|
||||
|
||||
UM.I18nCatalog { id: catalog; name: "cura" }
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user