Add navigation style option

This commit is contained in:
Fredrik Ehnbom 2023-10-21 12:18:00 +02:00
parent 5f998f0ab4
commit dc6edffea4
2 changed files with 51 additions and 0 deletions

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");
@ -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
{
//: Spacer