mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-23 22:54:01 -06:00
Added preference to disable auto center when selecting object
This commit is contained in:
parent
5cab8b9467
commit
f68fdb01b4
3 changed files with 50 additions and 11 deletions
|
@ -85,6 +85,7 @@ class CuraApplication(QtApplication):
|
|||
Preferences.getInstance().addPreference("cura/active_mode", "simple")
|
||||
Preferences.getInstance().addPreference("cura/recent_files", "")
|
||||
Preferences.getInstance().addPreference("cura/categories_expanded", "")
|
||||
Preferences.getInstance().addPreference("view/center_on_select", True)
|
||||
|
||||
JobQueue.getInstance().jobFinished.connect(self._onJobFinished)
|
||||
|
||||
|
@ -197,10 +198,10 @@ class CuraApplication(QtApplication):
|
|||
self._previous_active_tool = None
|
||||
else:
|
||||
self.getController().setActiveTool("TranslateTool")
|
||||
|
||||
self._camera_animation.setStart(self.getController().getTool("CameraTool").getOrigin())
|
||||
self._camera_animation.setTarget(Selection.getSelectedObject(0).getWorldPosition())
|
||||
self._camera_animation.start()
|
||||
if Preferences.getInstance().getValue("view/center_on_select"):
|
||||
self._camera_animation.setStart(self.getController().getTool("CameraTool").getOrigin())
|
||||
self._camera_animation.setTarget(Selection.getSelectedObject(0).getWorldPosition())
|
||||
self._camera_animation.start()
|
||||
else:
|
||||
if self.getController().getActiveTool():
|
||||
self._previous_active_tool = self.getController().getActiveTool().getPluginId()
|
||||
|
|
|
@ -8,7 +8,8 @@ import QtQuick.Controls.Styles 1.1
|
|||
|
||||
import UM 1.0 as UM
|
||||
|
||||
UM.PreferencesPage {
|
||||
UM.PreferencesPage
|
||||
{
|
||||
id: preferencesPage
|
||||
|
||||
//: View configuration page title
|
||||
|
@ -17,22 +18,26 @@ UM.PreferencesPage {
|
|||
function reset()
|
||||
{
|
||||
UM.Preferences.resetPreference("view/show_overhang");
|
||||
UM.Preferences.resetPreferences("view/center_on_select");
|
||||
}
|
||||
|
||||
GridLayout {
|
||||
GridLayout
|
||||
{
|
||||
columns: 2;
|
||||
|
||||
CheckBox {
|
||||
id: viewCheckbox
|
||||
CheckBox
|
||||
{
|
||||
id: overhangCheckbox
|
||||
checked: UM.Preferences.getValue("view/show_overhang")
|
||||
onCheckedChanged: UM.Preferences.setValue("view/show_overhang", checked)
|
||||
}
|
||||
Button {
|
||||
Button
|
||||
{
|
||||
id: viewText //is a button so the user doesn't have te click inconvenientley precise to enable or disable the checkbox
|
||||
|
||||
//: Display Overhang preference checkbox
|
||||
text: qsTr("Display Overhang");
|
||||
onClicked: viewCheckbox.checked = !viewCheckbox.checked
|
||||
onClicked: overhangCheckbox.checked = !overhangCheckbox.checked
|
||||
|
||||
//: Display Overhang preference tooltip
|
||||
tooltip: "Highlight unsupported areas of the model in red. Without support these areas will nog print properly."
|
||||
|
@ -49,6 +54,39 @@ UM.PreferencesPage {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
CheckBox
|
||||
{
|
||||
id: centerCheckbox
|
||||
checked: UM.Preferences.getValue("view/center_on_select")
|
||||
onCheckedChanged: UM.Preferences.setValue("view/center_on_select", checked)
|
||||
}
|
||||
Button
|
||||
{
|
||||
id: centerText //is a button so the user doesn't have te click inconvenientley precise to enable or disable the checkbox
|
||||
|
||||
//: Display Overhang preference checkbox
|
||||
text: qsTr("Center camera when item is selected");
|
||||
onClicked: overhangCheckbox.checked = !overhangCheckbox.checked
|
||||
|
||||
//: Display Overhang preference tooltip
|
||||
tooltip: "Moves the camera so the object is in the center of the view when an object is selected"
|
||||
|
||||
style: ButtonStyle
|
||||
{
|
||||
background: Rectangle
|
||||
{
|
||||
border.width: 0
|
||||
color: "transparent"
|
||||
}
|
||||
label: Text
|
||||
{
|
||||
renderType: Text.NativeRendering
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
text: control.text
|
||||
}
|
||||
}
|
||||
}
|
||||
Item { Layout.fillHeight: true; Layout.columnSpan: 2 }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ Column
|
|||
Component.onCompleted: printer_connection.homeHead()
|
||||
Label
|
||||
{
|
||||
text: UM.Models.settingsModel.getItem(UM.Models.settingsModel.find("key", "machine_width")).toString()
|
||||
text: ""
|
||||
//Component.onCompleted:console.log(UM.Models.settingsModel.getMachineSetting("machine_width"))
|
||||
}
|
||||
Button
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue