Merge pull request #17053 from quarnster/main

Add navigation style option
This commit is contained in:
Saumya Jain 2024-02-23 11:04:09 +01:00 committed by GitHub
commit bc3eb3be51
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 51 additions and 0 deletions

View file

@ -617,6 +617,7 @@ class CuraApplication(QtApplication):
preferences.addPreference("view/invert_zoom", False)
preferences.addPreference("view/filter_current_build_plate", False)
preferences.addPreference("view/navigation_style", "cura")
preferences.addPreference("cura/sidebar_collapsed", False)
preferences.addPreference("cura/favorite_materials", "")

View file

@ -101,6 +101,7 @@ UM.PreferencesPage
centerOnSelectCheckbox.checked = boolCheck(UM.Preferences.getValue("view/center_on_select"))
UM.Preferences.resetPreference("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");
zoomToMouseCheckbox.checked = boolCheck(UM.Preferences.getValue("view/zoom_to_mouse"))
//UM.Preferences.resetPreference("view/top_layer_count");
@ -614,6 +615,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
{
//: Spacer