mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 15:44:04 -06:00
Add an empty state, when there are no configurations, showing a label indicating that the list is empty
Contributes to CURA-5876.
This commit is contained in:
parent
b1244b6bde
commit
4ba448077e
3 changed files with 21 additions and 11 deletions
|
@ -7,16 +7,15 @@ import QtQuick.Controls 2.3
|
||||||
import UM 1.2 as UM
|
import UM 1.2 as UM
|
||||||
import Cura 1.0 as Cura
|
import Cura 1.0 as Cura
|
||||||
|
|
||||||
Column
|
Item
|
||||||
{
|
{
|
||||||
id: base
|
id: base
|
||||||
property var outputDevice: null
|
property var outputDevice: null
|
||||||
height: childrenRect.height + padding
|
height: childrenRect.height
|
||||||
spacing: UM.Theme.getSize("narrow_margin").height
|
|
||||||
|
|
||||||
function forceModelUpdate()
|
function forceModelUpdate()
|
||||||
{
|
{
|
||||||
// FIXME For now the model should be removed and then created again, otherwise changes in the printer don't automatically update the UI
|
// FIXME For now the model has to be removed and then created again, otherwise changes in the printer don't automatically update the UI
|
||||||
configurationList.model = []
|
configurationList.model = []
|
||||||
if (outputDevice)
|
if (outputDevice)
|
||||||
{
|
{
|
||||||
|
@ -24,6 +23,17 @@ Column
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This component will appear when there is no configurations (e.g. when loosing connection)
|
||||||
|
Label
|
||||||
|
{
|
||||||
|
width: parent.width
|
||||||
|
visible: configurationList.model.length == 0
|
||||||
|
text: "Configuration list empty. Probably because of lost connection" // TODO change this to a proper component
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
renderType: Text.NativeRendering
|
||||||
|
}
|
||||||
|
|
||||||
ScrollView
|
ScrollView
|
||||||
{
|
{
|
||||||
id: container
|
id: container
|
||||||
|
|
|
@ -35,7 +35,6 @@ Cura.ExpandablePopup
|
||||||
}
|
}
|
||||||
|
|
||||||
contentPadding: UM.Theme.getSize("default_lining").width
|
contentPadding: UM.Theme.getSize("default_lining").width
|
||||||
contentAlignment: Cura.ExpandablePopup.ContentAlignment.AlignLeft
|
|
||||||
enabled: Cura.MachineManager.hasMaterials || Cura.MachineManager.hasVariants || Cura.MachineManager.hasVariantBuildplates; //Only let it drop down if there is any configuration that you could change.
|
enabled: Cura.MachineManager.hasMaterials || Cura.MachineManager.hasVariants || Cura.MachineManager.hasVariantBuildplates; //Only let it drop down if there is any configuration that you could change.
|
||||||
|
|
||||||
headerItem: Item
|
headerItem: Item
|
||||||
|
@ -130,18 +129,19 @@ Cura.ExpandablePopup
|
||||||
{
|
{
|
||||||
id: popupItem
|
id: popupItem
|
||||||
width: UM.Theme.getSize("configuration_selector").width
|
width: UM.Theme.getSize("configuration_selector").width
|
||||||
height: implicitHeight //Required because ExpandableComponent will try to use this to determine the size of the background of the pop-up.
|
height: implicitHeight // Required because ExpandableComponent will try to use this to determine the size of the background of the pop-up.
|
||||||
padding: UM.Theme.getSize("default_margin").height
|
padding: UM.Theme.getSize("default_margin").height
|
||||||
spacing: UM.Theme.getSize("default_margin").height
|
spacing: UM.Theme.getSize("default_margin").height
|
||||||
|
|
||||||
property bool is_connected: false //If current machine is connected to a printer. Only evaluated upon making popup visible.
|
property bool is_connected: false // If current machine is connected to a printer. Only evaluated upon making popup visible.
|
||||||
|
property int configuration_method: ConfigurationMenu.ConfigurationMethod.Custom // Type of configuration being used. Only evaluated upon making popup visible.
|
||||||
|
|
||||||
onVisibleChanged:
|
onVisibleChanged:
|
||||||
{
|
{
|
||||||
is_connected = Cura.MachineManager.activeMachineNetworkKey !== "" && Cura.MachineManager.printerConnected //Re-evaluate.
|
is_connected = Cura.MachineManager.activeMachineNetworkKey !== "" && Cura.MachineManager.printerConnected // Re-evaluate.
|
||||||
|
configuration_method = is_connected ? ConfigurationMenu.ConfigurationMethod.Auto : ConfigurationMenu.ConfigurationMethod.Custom // Auto if connected to a printer at start-up, or Custom if not.
|
||||||
}
|
}
|
||||||
|
|
||||||
property int configuration_method: is_connected ? ConfigurationMenu.ConfigurationMethod.Auto : ConfigurationMenu.ConfigurationMethod.Custom //Auto if connected to a printer at start-up, or Custom if not.
|
|
||||||
|
|
||||||
Item
|
Item
|
||||||
{
|
{
|
||||||
width: parent.width - 2 * parent.padding
|
width: parent.width - 2 * parent.padding
|
||||||
|
|
|
@ -356,7 +356,7 @@
|
||||||
|
|
||||||
"expandable_component_content_header": [0.0, 3.0],
|
"expandable_component_content_header": [0.0, 3.0],
|
||||||
|
|
||||||
"configuration_selector": [38.0, 4.0],
|
"configuration_selector": [35.0, 4.0],
|
||||||
"configuration_selector_mode_tabs": [0.0, 3.0],
|
"configuration_selector_mode_tabs": [0.0, 3.0],
|
||||||
|
|
||||||
"action_panel_widget": [25.0, 0.0],
|
"action_panel_widget": [25.0, 0.0],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue