Add a preference check to enable or disable the experimental feature

This commit is contained in:
Diego Prado Gesto 2019-02-17 19:22:54 +01:00
parent 86c7d3e5ab
commit 3829eb0905
4 changed files with 84 additions and 58 deletions

View File

@ -499,6 +499,7 @@ class CuraApplication(QtApplication):
preferences.addPreference("cura/choice_on_profile_override", "always_ask") preferences.addPreference("cura/choice_on_profile_override", "always_ask")
preferences.addPreference("cura/choice_on_open_project", "always_ask") preferences.addPreference("cura/choice_on_open_project", "always_ask")
preferences.addPreference("cura/use_multi_build_plate", False) 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_list_height", 400)
preferences.addPreference("view/settings_visible", False) preferences.addPreference("view/settings_visible", False)
preferences.addPreference("cura/currency", "") preferences.addPreference("cura/currency", "")

View File

@ -24,14 +24,14 @@ Item
Item Item
{ {
anchors.horizontalCenter: parent.horizontalCenter 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 height: parent.height
RowLayout RowLayout
{ {
id: itemRow id: itemRow
anchors.left: objectSelector.right anchors.left: loader.right
anchors.leftMargin: UM.Theme.getSize("default_margin").width anchors.leftMargin: UM.Theme.getSize("default_margin").width
width: Math.round(0.9 * prepareMenu.width) width: Math.round(0.9 * prepareMenu.width)
@ -82,60 +82,73 @@ Item
} }
} }
Cura.ObjectSelector Loader
{ {
id: objectSelector id: loader
height: UM.Theme.getSize("stage_menu").height sourceComponent: UM.Preferences.getValue("cura/show_list_of_files") ? objectSelector : openFileButton
width: UM.Theme.getSize("stage_menu").height
} }
// Button Component
// { {
// id: openFileButton id: objectSelector
// height: UM.Theme.getSize("stage_menu").height
// width: UM.Theme.getSize("stage_menu").height Cura.ObjectSelector
// onClicked: Cura.Actions.open.trigger() {
// hoverEnabled: true height: UM.Theme.getSize("stage_menu").height
// width: 1.5 * UM.Theme.getSize("stage_menu").height | 0
// contentItem: Item }
// { }
// anchors.fill: parent
// UM.RecolorImage Component
// { {
// id: buttonIcon id: openFileButton
// anchors.centerIn: parent Button
// source: UM.Theme.getIcon("load") {
// width: UM.Theme.getSize("button_icon").width height: UM.Theme.getSize("stage_menu").height
// height: UM.Theme.getSize("button_icon").height width: UM.Theme.getSize("stage_menu").height
// color: UM.Theme.getColor("icon") onClicked: Cura.Actions.open.trigger()
// hoverEnabled: true
// sourceSize.height: height
// } contentItem: Item
// } {
// anchors.fill: parent
// background: Rectangle UM.RecolorImage
// { {
// id: background id: buttonIcon
// height: UM.Theme.getSize("stage_menu").height anchors.centerIn: parent
// width: UM.Theme.getSize("stage_menu").height source: UM.Theme.getIcon("load")
// width: UM.Theme.getSize("button_icon").width
// radius: UM.Theme.getSize("default_radius").width height: UM.Theme.getSize("button_icon").height
// color: openFileButton.hovered ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("action_button") color: UM.Theme.getColor("icon")
// }
// sourceSize.height: height
// DropShadow }
// { }
// id: shadow
// // Don't blur the shadow background: Rectangle
// radius: 0 {
// anchors.fill: background id: background
// source: background height: UM.Theme.getSize("stage_menu").height
// verticalOffset: 2 width: UM.Theme.getSize("stage_menu").height
// visible: true
// color: UM.Theme.getColor("action_button_shadow") radius: UM.Theme.getSize("default_radius").width
// // Should always be drawn behind the background. color: openFileButton.hovered ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("action_button")
// z: background.z - 1 }
// }
// } 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
}
}
}
} }
} }

View File

@ -32,10 +32,7 @@ Button
right: printerTypes.left right: printerTypes.left
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
} }
text: { text: objectItemButton.text
print("HOLAAAAAAAA", objectItemButton.text)
return objectItemButton.text
}
color: UM.Theme.getColor("text") color: UM.Theme.getColor("text")
font: UM.Theme.getFont("medium") font: UM.Theme.getFont("medium")
visible: text != "" visible: text != ""

View File

@ -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 Connections
{ {
target: UM.Preferences target: UM.Preferences