main.qml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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: 2
  13. property int columnCount: 30
  14. property int interval: 2
  15. property bool fitByHeight: false
  16. property double pace: 1.0
  17. property bool viewItemCount: false
  18. property bool globalWorld: 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. }