diff --git a/plugins/LayerView/LayerView.qml b/plugins/LayerView/LayerView.qml index 66fd6d3f7b..e2581a568c 100644 --- a/plugins/LayerView/LayerView.qml +++ b/plugins/LayerView/LayerView.qml @@ -223,6 +223,8 @@ Item view_settings.show_adhesion = UM.Preferences.getValue("layerview/show_adhesion"); view_settings.show_skin = UM.Preferences.getValue("layerview/show_skin"); view_settings.show_infill = UM.Preferences.getValue("layerview/show_infill"); + view_settings.only_show_top_layers = UM.Preferences.getValue("view/only_show_top_layers"); + view_settings.top_layer_count = UM.Preferences.getValue("view/top_layer_count"); } } @@ -238,6 +240,8 @@ Item property bool show_adhesion: UM.Preferences.getValue("layerview/show_adhesion") property bool show_skin: UM.Preferences.getValue("layerview/show_skin") property bool show_infill: UM.Preferences.getValue("layerview/show_infill") + property bool only_show_top_layers: UM.Preferences.getValue("view/only_show_top_layers") + property int top_layer_count: UM.Preferences.getValue("view/only_show_top_layers") anchors.top: UM.LayerView.compatibilityMode ? compatibilityModeLabel.bottom : layerTypeCombobox.bottom anchors.topMargin: UM.Theme.getSize("default_margin").height @@ -315,6 +319,22 @@ Item } text: catalog.i18nc("@label", "Show Infill") } + CheckBox { + checked: view_settings.only_show_top_layers + onClicked: { + UM.Preferences.setValue("view/only_show_top_layers", checked ? 1.0 : 0.0); + } + text: catalog.i18nc("@label", "Only Show Top Layers") + visible: UM.LayerView.compatibilityMode + } + CheckBox { + checked: view_settings.top_layer_count == 5 + onClicked: { + UM.Preferences.setValue("view/top_layer_count", checked ? 5 : 1); + } + text: catalog.i18nc("@label", "Show 5 Detailed Layers On Top") + visible: UM.LayerView.compatibilityMode + } } } } diff --git a/resources/qml/Preferences/GeneralPage.qml b/resources/qml/Preferences/GeneralPage.qml index 94b589a636..fc178ec19e 100644 --- a/resources/qml/Preferences/GeneralPage.qml +++ b/resources/qml/Preferences/GeneralPage.qml @@ -45,8 +45,6 @@ UM.PreferencesPage showOverhangCheckbox.checked = boolCheck(UM.Preferences.getValue("view/show_overhang")) UM.Preferences.resetPreference("view/center_on_select"); centerOnSelectCheckbox.checked = boolCheck(UM.Preferences.getValue("view/center_on_select")) - UM.Preferences.resetPreference("view/top_layer_count"); - topLayerCountCheckbox.checked = boolCheck(UM.Preferences.getValue("view/top_layer_count")) if (plugins.find("id", "SliceInfoPlugin") > -1) { UM.Preferences.resetPreference("info/send_slice_info") @@ -232,44 +230,6 @@ UM.PreferencesPage } } - UM.TooltipArea { - width: childrenRect.width; - height: childrenRect.height; - text: catalog.i18nc("@info:tooltip","Display 5 top layers in layer view or only the top-most layer. Rendering 5 layers takes longer, but may show more information.") - - CheckBox - { - id: topLayerCountCheckbox - text: catalog.i18nc("@action:button","Display five top layers in layer view compatibility mode"); - checked: UM.Preferences.getValue("view/top_layer_count") == 5 - onClicked: - { - if(UM.Preferences.getValue("view/top_layer_count") == 5) - { - UM.Preferences.setValue("view/top_layer_count", 1) - } - else - { - UM.Preferences.setValue("view/top_layer_count", 5) - } - } - } - } - - UM.TooltipArea { - width: childrenRect.width - height: childrenRect.height - text: catalog.i18nc("@info:tooltip", "Should only the top layers be displayed in layerview?") - - CheckBox - { - id: topLayersOnlyCheckbox - text: catalog.i18nc("@option:check", "Only display top layer(s) in layer view compatibility mode") - checked: boolCheck(UM.Preferences.getValue("view/only_show_top_layers")) - onCheckedChanged: UM.Preferences.setValue("view/only_show_top_layers", checked) - } - } - UM.TooltipArea { width: childrenRect.width height: childrenRect.height