ViewPage.qml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. // Copyright (c) 2015 Ultimaker B.V.
  2. // Cura is released under the terms of the AGPLv3 or higher.
  3. import QtQuick 2.1
  4. import QtQuick.Controls 1.1
  5. import QtQuick.Layouts 1.1
  6. import QtQuick.Controls.Styles 1.1
  7. import UM 1.1 as UM
  8. UM.PreferencesPage
  9. {
  10. id: preferencesPage
  11. //: View configuration page title
  12. title: catalog.i18nc("@title:window","View");
  13. function reset()
  14. {
  15. UM.Preferences.resetPreference("view/show_overhang");
  16. UM.Preferences.resetPreference("view/center_on_select");
  17. }
  18. Column
  19. {
  20. UM.I18nCatalog { id: catalog; name:"cura"}
  21. UM.TooltipArea
  22. {
  23. width: childrenRect.width;
  24. height: childrenRect.height;
  25. text: catalog.i18nc("@info:tooltip","Highlight unsupported areas of the model in red. Without support these areas will nog print properly.")
  26. CheckBox
  27. {
  28. id: overhangCheckbox
  29. checked: boolCheck(UM.Preferences.getValue("view/show_overhang"))
  30. onClicked: UM.Preferences.setValue("view/show_overhang", checked)
  31. text: catalog.i18nc("@option:check","Display Overhang");
  32. }
  33. }
  34. UM.TooltipArea {
  35. width: childrenRect.width;
  36. height: childrenRect.height;
  37. text: catalog.i18nc("@info:tooltip","Moves the camera so the object is in the center of the view when an object is selected")
  38. CheckBox
  39. {
  40. id: centerCheckbox
  41. text: catalog.i18nc("@action:button","Center camera when item is selected");
  42. checked: boolCheck(UM.Preferences.getValue("view/center_on_select"))
  43. onClicked: UM.Preferences.setValue("view/center_on_select", checked)
  44. }
  45. }
  46. Connections {
  47. target: UM.Preferences
  48. onPreferenceChanged:
  49. {
  50. overhangCheckbox.checked = boolCheck(UM.Preferences.getValue("view/show_overhang"))
  51. centerCheckbox.checked = boolCheck(UM.Preferences.getValue("view/center_on_select"))
  52. }
  53. }
  54. }
  55. }