ViewPage.qml 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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.0 as UM
  8. UM.PreferencesPage
  9. {
  10. id: preferencesPage
  11. //: View configuration page title
  12. title: qsTr("View");
  13. function reset()
  14. {
  15. UM.Preferences.resetPreference("view/show_overhang");
  16. UM.Preferences.resetPreferences("view/center_on_select");
  17. }
  18. GridLayout
  19. {
  20. columns: 2;
  21. CheckBox
  22. {
  23. id: overhangCheckbox
  24. checked: UM.Preferences.getValue("view/show_overhang")
  25. onCheckedChanged: UM.Preferences.setValue("view/show_overhang", checked)
  26. }
  27. Button
  28. {
  29. id: viewText //is a button so the user doesn't have te click inconvenientley precise to enable or disable the checkbox
  30. //: Display Overhang preference checkbox
  31. text: qsTr("Display Overhang");
  32. onClicked: overhangCheckbox.checked = !overhangCheckbox.checked
  33. //: Display Overhang preference tooltip
  34. tooltip: "Highlight unsupported areas of the model in red. Without support these areas will nog print properly."
  35. style: ButtonStyle {
  36. background: Rectangle {
  37. border.width: 0
  38. color: "transparent"
  39. }
  40. label: Text {
  41. renderType: Text.NativeRendering
  42. horizontalAlignment: Text.AlignLeft
  43. text: control.text
  44. }
  45. }
  46. }
  47. CheckBox
  48. {
  49. id: centerCheckbox
  50. checked: UM.Preferences.getValue("view/center_on_select")
  51. onCheckedChanged: UM.Preferences.setValue("view/center_on_select", checked)
  52. }
  53. Button
  54. {
  55. id: centerText //is a button so the user doesn't have te click inconvenientley precise to enable or disable the checkbox
  56. //: Display Overhang preference checkbox
  57. text: qsTr("Center camera when item is selected");
  58. onClicked: overhangCheckbox.checked = !overhangCheckbox.checked
  59. //: Display Overhang preference tooltip
  60. tooltip: "Moves the camera so the object is in the center of the view when an object is selected"
  61. style: ButtonStyle
  62. {
  63. background: Rectangle
  64. {
  65. border.width: 0
  66. color: "transparent"
  67. }
  68. label: Text
  69. {
  70. renderType: Text.NativeRendering
  71. horizontalAlignment: Text.AlignLeft
  72. text: control.text
  73. }
  74. }
  75. }
  76. Item { Layout.fillHeight: true; Layout.columnSpan: 2 }
  77. }
  78. }