PerObjectItem.qml 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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 1.1
  6. import QtQuick.Controls.Styles 1.1
  7. import UM 1.5 as UM
  8. import Cura 1.0 as Cura
  9. UM.TooltipArea
  10. {
  11. x: model.depth * UM.Theme.getSize("default_margin").width;
  12. text: model.description;
  13. width: childrenRect.width;
  14. height: childrenRect.height;
  15. UM.CheckBox
  16. {
  17. id: check
  18. text: definition.label
  19. checked: addedSettingsModel.getVisible(model.key)
  20. onClicked:
  21. {
  22. addedSettingsModel.setVisible(model.key, checked);
  23. UM.ActiveTool.forceUpdate();
  24. }
  25. }
  26. // When the user removes settings from the list addedSettingsModel, we need to recheck if the
  27. // setting is visible or not to show a mark in the CheckBox.
  28. Connections
  29. {
  30. target: addedSettingsModel
  31. function onVisibleCountChanged()
  32. {
  33. check.checked = addedSettingsModel.getVisible(model.key)
  34. }
  35. }
  36. }