main.qml 1.2 KB

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