mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-10 07:15:03 -06:00
Scroll setting with active focus into view
This commit is contained in:
parent
b324e90ba5
commit
edee53b0b1
8 changed files with 73 additions and 6 deletions
|
@ -14,10 +14,11 @@ Button {
|
|||
|
||||
style: UM.Theme.styles.sidebar_category;
|
||||
|
||||
signal showTooltip(string text);
|
||||
signal hideTooltip();
|
||||
signal showTooltip(string text)
|
||||
signal hideTooltip()
|
||||
signal contextMenuRequested()
|
||||
signal showAllHiddenInheritedSettings(string category_id)
|
||||
signal focusReceived()
|
||||
|
||||
text: definition.label
|
||||
iconSource: UM.Theme.getIcon(definition.icon)
|
||||
|
@ -25,7 +26,24 @@ Button {
|
|||
checkable: true
|
||||
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
|
||||
{
|
||||
id: settingsButton
|
||||
|
|
|
@ -62,6 +62,14 @@ SettingItem
|
|||
propertyProvider.setPropertyValue("value", !checked);
|
||||
}
|
||||
|
||||
onActiveFocusChanged:
|
||||
{
|
||||
if(activeFocus)
|
||||
{
|
||||
base.focusReceived();
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle
|
||||
{
|
||||
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
|
||||
{
|
||||
|
|
|
@ -27,6 +27,14 @@ SettingItem
|
|||
propertyProvider.setPropertyValue("value", model.getItem(index).index);
|
||||
}
|
||||
|
||||
onActiveFocusChanged:
|
||||
{
|
||||
if(activeFocus)
|
||||
{
|
||||
base.focusReceived();
|
||||
}
|
||||
}
|
||||
|
||||
currentIndex: propertyProvider.properties.value
|
||||
|
||||
MouseArea
|
||||
|
|
|
@ -32,9 +32,10 @@ Item {
|
|||
property var stackLevels: propertyProvider.stackLevels
|
||||
property var stackLevel: stackLevels[0]
|
||||
|
||||
signal focusReceived()
|
||||
signal contextMenuRequested()
|
||||
signal showTooltip(string text);
|
||||
signal hideTooltip();
|
||||
signal showTooltip(string text)
|
||||
signal hideTooltip()
|
||||
signal showAllHiddenInheritedSettings(string category_id)
|
||||
property string tooltipText:
|
||||
{
|
||||
|
|
|
@ -31,6 +31,14 @@ SettingItem
|
|||
propertyProvider.setPropertyValue("value", model.getItem(index).index);
|
||||
}
|
||||
|
||||
onActiveFocusChanged:
|
||||
{
|
||||
if(activeFocus)
|
||||
{
|
||||
base.focusReceived();
|
||||
}
|
||||
}
|
||||
|
||||
Binding
|
||||
{
|
||||
target: control
|
||||
|
|
|
@ -105,6 +105,14 @@ SettingItem
|
|||
propertyProvider.setPropertyValue("value", text)
|
||||
}
|
||||
|
||||
onActiveFocusChanged:
|
||||
{
|
||||
if(activeFocus)
|
||||
{
|
||||
base.focusReceived();
|
||||
}
|
||||
}
|
||||
|
||||
color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text")
|
||||
font: UM.Theme.getFont("default");
|
||||
|
||||
|
|
|
@ -298,6 +298,10 @@ Item
|
|||
}
|
||||
Cura.SettingInheritanceManager.manualRemoveOverride(category_id)
|
||||
}
|
||||
onFocusReceived:
|
||||
{
|
||||
contents.positionViewAtIndex(index, ListView.Contain);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue