mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 14:37:29 -06:00
tab button in per model setting
CURA-18869
This commit is contained in:
parent
75fac58198
commit
c95481f6e7
1 changed files with 41 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
|||
//Copyright (c) 2022 Ultimaker B.V.
|
||||
//Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
|
||||
import UM 1.5 as UM
|
||||
|
@ -234,10 +234,11 @@ Item
|
|||
setDestroyed(true)
|
||||
}
|
||||
}
|
||||
|
||||
property int indexWithFocus: -1
|
||||
delegate: Row
|
||||
{
|
||||
spacing: UM.Theme.getSize("default_margin").width
|
||||
property var settingLoader_x: settingLoader.item
|
||||
Loader
|
||||
{
|
||||
id: settingLoader
|
||||
|
@ -340,6 +341,44 @@ Item
|
|||
function onPropertiesChanged() { provider.forcePropertiesChanged() }
|
||||
}
|
||||
|
||||
Connections
|
||||
{
|
||||
target: settingLoader.item
|
||||
function onFocusReceived()
|
||||
{
|
||||
|
||||
contents.indexWithFocus = index
|
||||
contents.positionViewAtIndex(index, ListView.Contain)
|
||||
}
|
||||
function onSetActiveFocusToNextSetting(forward)
|
||||
{
|
||||
if (forward == undefined || forward)
|
||||
{
|
||||
contents.currentIndex = contents.indexWithFocus + 1
|
||||
while(contents.currentItem && contents.currentItem.height <= 0)
|
||||
{
|
||||
contents.currentIndex++
|
||||
}
|
||||
if (contents.currentItem)
|
||||
{
|
||||
contents.currentItem.settingLoader_x.focusItem.forceActiveFocus()
|
||||
}
|
||||
}
|
||||
else
|
||||
{indexWithFocus
|
||||
contents.currentIndex = contents.indexWithFocus - 1
|
||||
while(contents.currentItem && contents.currentItem.height <= 0)
|
||||
{
|
||||
contents.currentIndex--
|
||||
}
|
||||
if (contents.currentItem)
|
||||
{
|
||||
contents.currentItem.settingLoader_x.focusItem.forceActiveFocus()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Connections
|
||||
{
|
||||
target: UM.ActiveTool
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue