mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 07:33:57 -06:00
Add navigation style option
This commit is contained in:
parent
5f998f0ab4
commit
dc6edffea4
2 changed files with 51 additions and 0 deletions
|
@ -589,6 +589,7 @@ class CuraApplication(QtApplication):
|
||||||
|
|
||||||
preferences.addPreference("view/invert_zoom", False)
|
preferences.addPreference("view/invert_zoom", False)
|
||||||
preferences.addPreference("view/filter_current_build_plate", False)
|
preferences.addPreference("view/filter_current_build_plate", False)
|
||||||
|
preferences.addPreference("view/navigation_style", "cura")
|
||||||
preferences.addPreference("cura/sidebar_collapsed", False)
|
preferences.addPreference("cura/sidebar_collapsed", False)
|
||||||
|
|
||||||
preferences.addPreference("cura/favorite_materials", "")
|
preferences.addPreference("cura/favorite_materials", "")
|
||||||
|
|
|
@ -101,6 +101,7 @@ UM.PreferencesPage
|
||||||
centerOnSelectCheckbox.checked = boolCheck(UM.Preferences.getValue("view/center_on_select"))
|
centerOnSelectCheckbox.checked = boolCheck(UM.Preferences.getValue("view/center_on_select"))
|
||||||
UM.Preferences.resetPreference("view/invert_zoom");
|
UM.Preferences.resetPreference("view/invert_zoom");
|
||||||
invertZoomCheckbox.checked = boolCheck(UM.Preferences.getValue("view/invert_zoom"))
|
invertZoomCheckbox.checked = boolCheck(UM.Preferences.getValue("view/invert_zoom"))
|
||||||
|
UM.Preferences.resetPreference("view/navigation_style");
|
||||||
UM.Preferences.resetPreference("view/zoom_to_mouse");
|
UM.Preferences.resetPreference("view/zoom_to_mouse");
|
||||||
zoomToMouseCheckbox.checked = boolCheck(UM.Preferences.getValue("view/zoom_to_mouse"))
|
zoomToMouseCheckbox.checked = boolCheck(UM.Preferences.getValue("view/zoom_to_mouse"))
|
||||||
//UM.Preferences.resetPreference("view/top_layer_count");
|
//UM.Preferences.resetPreference("view/top_layer_count");
|
||||||
|
@ -604,6 +605,55 @@ UM.PreferencesPage
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UM.TooltipArea
|
||||||
|
{
|
||||||
|
width: childrenRect.width
|
||||||
|
height: childrenRect.height
|
||||||
|
text: catalog.i18nc("@info:tooltip", "What type of camera navigation should be used?")
|
||||||
|
Column
|
||||||
|
{
|
||||||
|
spacing: UM.Theme.getSize("narrow_margin").height
|
||||||
|
|
||||||
|
UM.Label
|
||||||
|
{
|
||||||
|
text: catalog.i18nc("@window:text", "Camera navigation:")
|
||||||
|
}
|
||||||
|
ListModel
|
||||||
|
{
|
||||||
|
id: navigationStylesList
|
||||||
|
Component.onCompleted:
|
||||||
|
{
|
||||||
|
append({ text: catalog.i18n("Cura"), code: "cura" })
|
||||||
|
append({ text: catalog.i18n("FreeCAD trackpad"), code: "freecad_trackpad" })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Cura.ComboBox
|
||||||
|
{
|
||||||
|
id: cameraNavigationComboBox
|
||||||
|
|
||||||
|
model: navigationStylesList
|
||||||
|
textRole: "text"
|
||||||
|
width: UM.Theme.getSize("combobox").width
|
||||||
|
height: UM.Theme.getSize("combobox").height
|
||||||
|
|
||||||
|
currentIndex:
|
||||||
|
{
|
||||||
|
var code = UM.Preferences.getValue("view/navigation_style");
|
||||||
|
for(var i = 0; i < comboBoxList.count; ++i)
|
||||||
|
{
|
||||||
|
if(model.get(i).code == code)
|
||||||
|
{
|
||||||
|
return i
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
onActivated: UM.Preferences.setValue("view/navigation_style", model.get(index).code)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Item
|
Item
|
||||||
{
|
{
|
||||||
//: Spacer
|
//: Spacer
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue