main.qml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. import QtQuick 2.5
  2. import QtQuick.Window 2.2
  3. import Qt.labs.settings 1.0
  4. Window {
  5. id: appWindow
  6. width: 1024
  7. height: 768
  8. Settings {
  9. id: settings
  10. property int itemTravel: 0
  11. property int columnCount: 5
  12. property int interval: 5
  13. property real pace: 1
  14. property bool viewItemCount: false
  15. property bool globalWorld: false
  16. // Very computationally heavy: 40% vs 20% for 0.1 vs 0
  17. property real restitution: 0
  18. property bool embossEffect: false
  19. }
  20. Rectangle {
  21. focus: true
  22. color: "black"
  23. anchors.fill: parent
  24. Keys.forwardTo: [punk, toplevelhandler]
  25. Gravity {
  26. // TODO: generalize all this
  27. id: punk
  28. }
  29. }
  30. Rectangle {
  31. id: toplevelhandler
  32. focus: true
  33. Keys.onLeftPressed: settings.columnCount = Math.max(settings.columnCount-1,1)
  34. Keys.onRightPressed: settings.columnCount++
  35. }
  36. Rectangle {
  37. visible: imageModel.rowCount() === 0
  38. color: "red"
  39. width: childrenRect.width
  40. height: childrenRect.height
  41. anchors { bottom: parent.bottom; horizontalCenter: parent.horizontalCenter }
  42. Text {
  43. font.pointSize: 40
  44. text: "No images found/provided"
  45. }
  46. }
  47. Component.onCompleted: showFullScreen()
  48. }