diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 655126471d..bbb4f15445 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -499,6 +499,7 @@ class CuraApplication(QtApplication): preferences.addPreference("cura/choice_on_profile_override", "always_ask") preferences.addPreference("cura/choice_on_open_project", "always_ask") preferences.addPreference("cura/use_multi_build_plate", False) + preferences.addPreference("cura/show_list_of_files", False) preferences.addPreference("view/settings_list_height", 400) preferences.addPreference("view/settings_visible", False) preferences.addPreference("cura/currency", "€") diff --git a/plugins/PrepareStage/PrepareMenu.qml b/plugins/PrepareStage/PrepareMenu.qml index f571143384..9d1ff81fd7 100644 --- a/plugins/PrepareStage/PrepareMenu.qml +++ b/plugins/PrepareStage/PrepareMenu.qml @@ -24,14 +24,14 @@ Item Item { anchors.horizontalCenter: parent.horizontalCenter - width: objectSelector.width + itemRow.width + UM.Theme.getSize("default_margin").width + width: loader.width + itemRow.width + UM.Theme.getSize("default_margin").width height: parent.height RowLayout { id: itemRow - anchors.left: objectSelector.right + anchors.left: loader.right anchors.leftMargin: UM.Theme.getSize("default_margin").width width: Math.round(0.9 * prepareMenu.width) @@ -82,60 +82,73 @@ Item } } - Cura.ObjectSelector + Loader { - id: objectSelector - height: UM.Theme.getSize("stage_menu").height - width: UM.Theme.getSize("stage_menu").height + id: loader + sourceComponent: UM.Preferences.getValue("cura/show_list_of_files") ? objectSelector : openFileButton } -// Button -// { -// id: openFileButton -// height: UM.Theme.getSize("stage_menu").height -// width: UM.Theme.getSize("stage_menu").height -// onClicked: Cura.Actions.open.trigger() -// hoverEnabled: true -// -// contentItem: Item -// { -// anchors.fill: parent -// UM.RecolorImage -// { -// id: buttonIcon -// anchors.centerIn: parent -// source: UM.Theme.getIcon("load") -// width: UM.Theme.getSize("button_icon").width -// height: UM.Theme.getSize("button_icon").height -// color: UM.Theme.getColor("icon") -// -// sourceSize.height: height -// } -// } -// -// background: Rectangle -// { -// id: background -// height: UM.Theme.getSize("stage_menu").height -// width: UM.Theme.getSize("stage_menu").height -// -// radius: UM.Theme.getSize("default_radius").width -// color: openFileButton.hovered ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("action_button") -// } -// -// DropShadow -// { -// id: shadow -// // Don't blur the shadow -// radius: 0 -// anchors.fill: background -// source: background -// verticalOffset: 2 -// visible: true -// color: UM.Theme.getColor("action_button_shadow") -// // Should always be drawn behind the background. -// z: background.z - 1 -// } -// } + Component + { + id: objectSelector + + Cura.ObjectSelector + { + height: UM.Theme.getSize("stage_menu").height + width: 1.5 * UM.Theme.getSize("stage_menu").height | 0 + } + } + + Component + { + id: openFileButton + Button + { + height: UM.Theme.getSize("stage_menu").height + width: UM.Theme.getSize("stage_menu").height + onClicked: Cura.Actions.open.trigger() + hoverEnabled: true + + contentItem: Item + { + anchors.fill: parent + UM.RecolorImage + { + id: buttonIcon + anchors.centerIn: parent + source: UM.Theme.getIcon("load") + width: UM.Theme.getSize("button_icon").width + height: UM.Theme.getSize("button_icon").height + color: UM.Theme.getColor("icon") + + sourceSize.height: height + } + } + + background: Rectangle + { + id: background + height: UM.Theme.getSize("stage_menu").height + width: UM.Theme.getSize("stage_menu").height + + radius: UM.Theme.getSize("default_radius").width + color: openFileButton.hovered ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("action_button") + } + + DropShadow + { + id: shadow + // Don't blur the shadow + radius: 0 + anchors.fill: background + source: background + verticalOffset: 2 + visible: true + color: UM.Theme.getColor("action_button_shadow") + // Should always be drawn behind the background. + z: background.z - 1 + } + } + } } } diff --git a/resources/qml/ObjectItemButton.qml b/resources/qml/ObjectItemButton.qml index 8b1a7036bd..44bdf469e3 100644 --- a/resources/qml/ObjectItemButton.qml +++ b/resources/qml/ObjectItemButton.qml @@ -32,10 +32,7 @@ Button right: printerTypes.left verticalCenter: parent.verticalCenter } - text: { - print("HOLAAAAAAAA", objectItemButton.text) - return objectItemButton.text - } + text: objectItemButton.text color: UM.Theme.getColor("text") font: UM.Theme.getFont("medium") visible: text != "" diff --git a/resources/qml/Preferences/GeneralPage.qml b/resources/qml/Preferences/GeneralPage.qml index 0dd6c6313a..35108a88bf 100644 --- a/resources/qml/Preferences/GeneralPage.qml +++ b/resources/qml/Preferences/GeneralPage.qml @@ -741,6 +741,21 @@ UM.PreferencesPage } } + UM.TooltipArea + { + width: childrenRect.width + height: childrenRect.height + text: catalog.i18nc("@info:tooltip", "This option enables a panel showing the list of loaded models") + + CheckBox + { + id: showListOfFilesCheckbox + text: catalog.i18nc("@option:check", "Show list of loaded models") + checked: boolCheck(UM.Preferences.getValue("cura/show_list_of_files")) + onCheckedChanged: UM.Preferences.setValue("cura/show_list_of_files", checked) + } + } + Connections { target: UM.Preferences