mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-05 13:03:59 -06:00
Refactor the PrintSetupSelector
The file was splitted in several other files to improve readability. There is a new folder called PrintSetupSelector where all those files will be. Contributes to CURA-5941.
This commit is contained in:
parent
56f20648f5
commit
85b34d6005
7 changed files with 419 additions and 399 deletions
68
resources/qml/PrintSetupSelector/PrintSetupSelector.qml
Normal file
68
resources/qml/PrintSetupSelector/PrintSetupSelector.qml
Normal file
|
@ -0,0 +1,68 @@
|
|||
// Copyright (c) 2018 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.7
|
||||
import QtQuick.Controls 2.0
|
||||
|
||||
import UM 1.3 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Cura.ExpandableComponent
|
||||
{
|
||||
id: base
|
||||
|
||||
property int currentModeIndex: -1
|
||||
property bool hideSettings: PrintInformation.preSliced
|
||||
|
||||
property string enabledText: catalog.i18nc("@label:Should be short", "On")
|
||||
property string disabledText: catalog.i18nc("@label:Should be short", "Off")
|
||||
|
||||
// This widget doesn't show tooltips by itself. Instead it emits signals so others can do something with it.
|
||||
signal showTooltip(Item item, point location, string text)
|
||||
signal hideTooltip()
|
||||
|
||||
iconSource: UM.Theme.getIcon("pencil")
|
||||
popupPadding: UM.Theme.getSize("default_lining").width
|
||||
popupSpacingY: UM.Theme.getSize("narrow_margin").width
|
||||
|
||||
popupClosePolicy: Popup.CloseOnEscape
|
||||
|
||||
onCurrentModeIndexChanged: UM.Preferences.setValue("cura/active_mode", currentModeIndex)
|
||||
|
||||
Component.onCompleted:
|
||||
{
|
||||
popupItemWrapper.width = base.width
|
||||
}
|
||||
|
||||
UM.I18nCatalog
|
||||
{
|
||||
id: catalog
|
||||
name: "cura"
|
||||
}
|
||||
|
||||
Timer
|
||||
{
|
||||
id: tooltipDelayTimer
|
||||
interval: 500
|
||||
repeat: false
|
||||
property var item
|
||||
property string text
|
||||
|
||||
onTriggered: base.showTooltip(base, {x: 0, y: item.y}, text)
|
||||
}
|
||||
|
||||
headerItem: PrintSetupSelectorHeader
|
||||
{
|
||||
anchors.fill: parent
|
||||
}
|
||||
|
||||
Cura.ExtrudersModel
|
||||
{
|
||||
id: extrudersModel
|
||||
}
|
||||
|
||||
popupItem: PrintSetupSelectorContents
|
||||
{
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue