main.qml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. property bool embossEffect: false
  21. }
  22. Rectangle {
  23. focus: true
  24. color: "black"
  25. anchors.fill: parent
  26. Keys.forwardTo: [punk, toplevelhandler]
  27. Gravity {
  28. // TODO: generalize all this
  29. id: punk
  30. }
  31. }
  32. Rectangle {
  33. id: toplevelhandler
  34. focus: true
  35. Keys.onLeftPressed: settings.columnCount = Math.max(settings.columnCount-1,1)
  36. Keys.onRightPressed: settings.columnCount++
  37. }
  38. Rectangle {
  39. visible: imageModel.rowCount() === 0
  40. color: "red"
  41. width: childrenRect.width
  42. height: childrenRect.height
  43. anchors { bottom: parent.bottom; horizontalCenter: parent.horizontalCenter }
  44. Text {
  45. font.pointSize: 40
  46. text: "No images found/provided"
  47. }
  48. }
  49. Component.onCompleted: showFullScreen()
  50. }