main.qml 841 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. width: 1024
  8. height: 768
  9. Settings {
  10. id: settings
  11. property int columnCount: 4
  12. property int interval: 30
  13. property bool animateDeath: false
  14. property bool fitByHeight: true
  15. property double pace: 6.0
  16. }
  17. Rectangle {
  18. focus: true
  19. color: "black"
  20. anchors.fill: parent
  21. Keys.forwardTo: [punk, toplevelhandler]
  22. Gravity {
  23. // TODO: generalize all this
  24. id: punk
  25. }
  26. }
  27. Rectangle {
  28. id: toplevelhandler
  29. focus: true
  30. Keys.onLeftPressed: settings.columnCount = Math.max(settings.columnCount-1,1)
  31. Keys.onRightPressed: settings.columnCount++
  32. }
  33. }