mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-18 07:56:11 +08:00
Merge branch 'CURA-8728_using-tab-in-per-model' of github.com:Ultimaker/Cura
This commit is contained in:
commit
6ae423361f
@ -1,7 +1,7 @@
|
|||||||
//Copyright (c) 2022 Ultimaker B.V.
|
//Copyright (c) 2022 Ultimaker B.V.
|
||||||
//Cura is released under the terms of the LGPLv3 or higher.
|
//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 QtQuick.Controls 2.15
|
||||||
|
|
||||||
import UM 1.5 as UM
|
import UM 1.5 as UM
|
||||||
@ -234,10 +234,11 @@ Item
|
|||||||
setDestroyed(true)
|
setDestroyed(true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
property int indexWithFocus: -1
|
||||||
delegate: Row
|
delegate: Row
|
||||||
{
|
{
|
||||||
spacing: UM.Theme.getSize("default_margin").width
|
spacing: UM.Theme.getSize("default_margin").width
|
||||||
|
property var settingLoaderItem: settingLoader.item
|
||||||
Loader
|
Loader
|
||||||
{
|
{
|
||||||
id: settingLoader
|
id: settingLoader
|
||||||
@ -340,6 +341,44 @@ Item
|
|||||||
function onPropertiesChanged() { provider.forcePropertiesChanged() }
|
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.settingLoaderItem.focusItem.forceActiveFocus()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
contents.currentIndex = contents.indexWithFocus - 1
|
||||||
|
while(contents.currentItem && contents.currentItem.height <= 0)
|
||||||
|
{
|
||||||
|
contents.currentIndex--
|
||||||
|
}
|
||||||
|
if (contents.currentItem)
|
||||||
|
{
|
||||||
|
contents.currentItem.settingLoaderItem.focusItem.forceActiveFocus()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Connections
|
Connections
|
||||||
{
|
{
|
||||||
target: UM.ActiveTool
|
target: UM.ActiveTool
|
||||||
|
Loading…
x
Reference in New Issue
Block a user