RecommendedQualityProfileSelector.qml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. // Copyright (c) 2018 Ultimaker B.V.
  2. // Cura is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.7
  4. import QtQuick.Controls 1.4
  5. import QtQuick.Controls 2.3 as Controls2
  6. import QtQuick.Controls.Styles 1.4
  7. import UM 1.2 as UM
  8. import Cura 1.6 as Cura
  9. Item
  10. {
  11. id: qualityRow
  12. height: childrenRect.height
  13. property real labelColumnWidth: Math.round(width / 3)
  14. property real settingsColumnWidth: width - labelColumnWidth
  15. // Here are the elements that are shown in the left column
  16. Item
  17. {
  18. id: titleRow
  19. width: labelColumnWidth
  20. height: childrenRect.height
  21. Cura.IconWithText
  22. {
  23. id: qualityRowTitle
  24. source: UM.Theme.getIcon("category_layer_height")
  25. text: catalog.i18nc("@label", "Profiles")
  26. font: UM.Theme.getFont("medium")
  27. anchors.left: parent.left
  28. anchors.right: customisedSettings.left
  29. }
  30. }
  31. Column
  32. {
  33. anchors
  34. {
  35. left: titleRow.right
  36. right: parent.right
  37. }
  38. spacing: UM.Theme.getSize("default_margin").height
  39. Controls2.ButtonGroup
  40. {
  41. id: activeProfileButtonGroup
  42. exclusive: true
  43. onClicked: Cura.IntentManager.selectIntent(button.modelData.intent_category, button.modelData.quality_type)
  44. }
  45. Cura.LabelBar
  46. {
  47. id: labelbar
  48. anchors
  49. {
  50. left: parent.left
  51. right: parent.right
  52. }
  53. model: Cura.QualityProfilesDropDownMenuModel
  54. modelKey: "layer_height"
  55. }
  56. Repeater
  57. {
  58. model: Cura.IntentCategoryModel{}
  59. Cura.RadioCheckbar
  60. {
  61. anchors
  62. {
  63. left: parent.left
  64. right: parent.right
  65. }
  66. dataModel: model["qualities"]
  67. buttonGroup: activeProfileButtonGroup
  68. function checkedFunction(modelItem)
  69. {
  70. if(Cura.MachineManager.hasCustomQuality)
  71. {
  72. // When user created profile is active, no quality tickbox should be active.
  73. return false
  74. }
  75. return Cura.MachineManager.activeQualityType == modelItem.quality_type && Cura.MachineManager.activeIntentCategory == modelItem.intent_category
  76. }
  77. isCheckedFunction: checkedFunction
  78. }
  79. }
  80. }
  81. }