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