PerObjectItem.qml 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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.2 as UM
  8. UM.TooltipArea
  9. {
  10. x: model.depth * UM.Theme.getSize("default_margin").width;
  11. text: model.description;
  12. width: childrenRect.width;
  13. height: childrenRect.height;
  14. 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.ActiveTool.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. }