main.qml 1.3 KB

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