PerObjectItem.qml 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // Copyright (c) 2015 Ultimaker B.V.
  2. // Uranium is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.1
  4. import QtQuick.Layouts 1.1
  5. import QtQuick.Controls 2.1
  6. import UM 1.5 as UM
  7. import Cura 1.0 as Cura
  8. UM.TooltipArea
  9. {
  10. x: model.depth * UM.Theme.getSize("narrow_margin").width
  11. text: model.description
  12. width: childrenRect.width
  13. height: childrenRect.height
  14. UM.CheckBox
  15. {
  16. id: check
  17. text: definition.label
  18. checked: addedSettingsModel.getVisible(model.key)
  19. onClicked:
  20. {
  21. addedSettingsModel.setVisible(model.key, checked);
  22. UM.Controller.forceUpdate();
  23. }
  24. }
  25. // When the user removes settings from the list addedSettingsModel, we need to recheck if the
  26. // setting is visible or not to show a mark in the CheckBox.
  27. Connections
  28. {
  29. target: addedSettingsModel
  30. function onVisibleCountChanged()
  31. {
  32. check.checked = addedSettingsModel.getVisible(model.key)
  33. }
  34. }
  35. }