mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-13 01:19:00 +08:00
Scroll setting with active focus into view
This commit is contained in:
parent
b324e90ba5
commit
edee53b0b1
@ -14,10 +14,11 @@ Button {
|
|||||||
|
|
||||||
style: UM.Theme.styles.sidebar_category;
|
style: UM.Theme.styles.sidebar_category;
|
||||||
|
|
||||||
signal showTooltip(string text);
|
signal showTooltip(string text)
|
||||||
signal hideTooltip();
|
signal hideTooltip()
|
||||||
signal contextMenuRequested()
|
signal contextMenuRequested()
|
||||||
signal showAllHiddenInheritedSettings(string category_id)
|
signal showAllHiddenInheritedSettings(string category_id)
|
||||||
|
signal focusReceived()
|
||||||
|
|
||||||
text: definition.label
|
text: definition.label
|
||||||
iconSource: UM.Theme.getIcon(definition.icon)
|
iconSource: UM.Theme.getIcon(definition.icon)
|
||||||
@ -25,7 +26,24 @@ Button {
|
|||||||
checkable: true
|
checkable: true
|
||||||
checked: definition.expanded
|
checked: definition.expanded
|
||||||
|
|
||||||
onClicked: { forceActiveFocus(); definition.expanded ? settingDefinitionsModel.collapse(definition.key) : settingDefinitionsModel.expandAll(definition.key) }
|
onClicked:
|
||||||
|
{
|
||||||
|
forceActiveFocus();
|
||||||
|
if(definition.expanded)
|
||||||
|
{
|
||||||
|
settingDefinitionsModel.collapse(definition.key);
|
||||||
|
} else {
|
||||||
|
settingDefinitionsModel.expandAll(definition.key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onActiveFocusChanged:
|
||||||
|
{
|
||||||
|
if(activeFocus)
|
||||||
|
{
|
||||||
|
base.focusReceived();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
UM.SimpleButton
|
UM.SimpleButton
|
||||||
{
|
{
|
||||||
id: settingsButton
|
id: settingsButton
|
||||||
|
@ -62,6 +62,14 @@ SettingItem
|
|||||||
propertyProvider.setPropertyValue("value", !checked);
|
propertyProvider.setPropertyValue("value", !checked);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onActiveFocusChanged:
|
||||||
|
{
|
||||||
|
if(activeFocus)
|
||||||
|
{
|
||||||
|
base.focusReceived();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Rectangle
|
Rectangle
|
||||||
{
|
{
|
||||||
anchors
|
anchors
|
||||||
|
@ -94,7 +94,19 @@ SettingItem
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onActivated: { forceActiveFocus(); propertyProvider.setPropertyValue("value", definition.options[index].key) }
|
onActivated:
|
||||||
|
{
|
||||||
|
forceActiveFocus();
|
||||||
|
propertyProvider.setPropertyValue("value", definition.options[index].key);
|
||||||
|
}
|
||||||
|
|
||||||
|
onActiveFocusChanged:
|
||||||
|
{
|
||||||
|
if(activeFocus)
|
||||||
|
{
|
||||||
|
base.focusReceived();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Binding
|
Binding
|
||||||
{
|
{
|
||||||
|
@ -27,6 +27,14 @@ SettingItem
|
|||||||
propertyProvider.setPropertyValue("value", model.getItem(index).index);
|
propertyProvider.setPropertyValue("value", model.getItem(index).index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onActiveFocusChanged:
|
||||||
|
{
|
||||||
|
if(activeFocus)
|
||||||
|
{
|
||||||
|
base.focusReceived();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
currentIndex: propertyProvider.properties.value
|
currentIndex: propertyProvider.properties.value
|
||||||
|
|
||||||
MouseArea
|
MouseArea
|
||||||
|
@ -32,9 +32,10 @@ Item {
|
|||||||
property var stackLevels: propertyProvider.stackLevels
|
property var stackLevels: propertyProvider.stackLevels
|
||||||
property var stackLevel: stackLevels[0]
|
property var stackLevel: stackLevels[0]
|
||||||
|
|
||||||
|
signal focusReceived()
|
||||||
signal contextMenuRequested()
|
signal contextMenuRequested()
|
||||||
signal showTooltip(string text);
|
signal showTooltip(string text)
|
||||||
signal hideTooltip();
|
signal hideTooltip()
|
||||||
signal showAllHiddenInheritedSettings(string category_id)
|
signal showAllHiddenInheritedSettings(string category_id)
|
||||||
property string tooltipText:
|
property string tooltipText:
|
||||||
{
|
{
|
||||||
|
@ -31,6 +31,14 @@ SettingItem
|
|||||||
propertyProvider.setPropertyValue("value", model.getItem(index).index);
|
propertyProvider.setPropertyValue("value", model.getItem(index).index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onActiveFocusChanged:
|
||||||
|
{
|
||||||
|
if(activeFocus)
|
||||||
|
{
|
||||||
|
base.focusReceived();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Binding
|
Binding
|
||||||
{
|
{
|
||||||
target: control
|
target: control
|
||||||
|
@ -105,6 +105,14 @@ SettingItem
|
|||||||
propertyProvider.setPropertyValue("value", text)
|
propertyProvider.setPropertyValue("value", text)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onActiveFocusChanged:
|
||||||
|
{
|
||||||
|
if(activeFocus)
|
||||||
|
{
|
||||||
|
base.focusReceived();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text")
|
color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text")
|
||||||
font: UM.Theme.getFont("default");
|
font: UM.Theme.getFont("default");
|
||||||
|
|
||||||
|
@ -298,6 +298,10 @@ Item
|
|||||||
}
|
}
|
||||||
Cura.SettingInheritanceManager.manualRemoveOverride(category_id)
|
Cura.SettingInheritanceManager.manualRemoveOverride(category_id)
|
||||||
}
|
}
|
||||||
|
onFocusReceived:
|
||||||
|
{
|
||||||
|
contents.positionViewAtIndex(index, ListView.Contain);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user