mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-06 13:34:01 -06:00
Fix scroll position after collapsing category not in focus
When collapsing a category, the height of the category is briefly set to 0 and then animated there properly. If the setting list becomes so small then that the scroll bar disappears, the view should automatically get scrolled up. But because the focus changed at the same time it would move the scrollbar such that the category header was in view. This clashed, causing the scroll position to end up not completely at the top even though the scroll bar did disappear. Setting the focus after collapsing the scroll bar prevents this. Contributes to issue CURA-4732 and fixes #2935.
This commit is contained in:
parent
cda600f12d
commit
8b504c8acc
1 changed files with 8 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
|||
// Copyright (c) 2015 Ultimaker B.V.
|
||||
// Uranium is released under the terms of the LGPLv3 or higher.
|
||||
// Copyright (c) 2017 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.1
|
||||
|
@ -31,13 +31,17 @@ Button {
|
|||
|
||||
onClicked:
|
||||
{
|
||||
forceActiveFocus();
|
||||
if(definition.expanded)
|
||||
{
|
||||
settingDefinitionsModel.collapse(definition.key);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
settingDefinitionsModel.expandAll(definition.key);
|
||||
}
|
||||
//Set focus so that tab navigation continues from this point on.
|
||||
//NB: This must be set AFTER collapsing/expanding the category so that the scroll position is correct.
|
||||
forceActiveFocus();
|
||||
}
|
||||
onActiveFocusChanged:
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue