Changeset View
Changeset View
Standalone View
Standalone View
qmlUiKirigami/ImageViewer.qml
Show First 20 Lines • Show All 70 Lines • ▼ Show 20 Line(s) | 48 | actions { | |||
---|---|---|---|---|---|
71 | } | 71 | } | ||
72 | } | 72 | } | ||
73 | 73 | | |||
74 | //FIXME: HACK | 74 | //FIXME: HACK | ||
75 | property bool wasDrawerOpen | 75 | property bool wasDrawerOpen | ||
76 | Component.onCompleted: { | 76 | Component.onCompleted: { | ||
77 | applicationWindow().controlsVisible = false; | 77 | applicationWindow().controlsVisible = false; | ||
78 | listView.forceActiveFocus(); | 78 | listView.forceActiveFocus(); | ||
79 | applicationWindow().header.visible = false; | | |||
mart: heder and footer needs to never ever be visible when the imageviewer is open, regardless of… | |||||
80 | applicationWindow().footer.visible = false; | | |||
81 | wasDrawerOpen = applicationWindow().globalDrawer.visible; | 79 | wasDrawerOpen = applicationWindow().globalDrawer.visible; | ||
82 | applicationWindow().globalDrawer.visible = false; | 80 | applicationWindow().globalDrawer.visible = false; | ||
83 | applicationWindow().globalDrawer.enabled = false; | 81 | applicationWindow().globalDrawer.enabled = false; | ||
84 | } | 82 | } | ||
85 | function close() { | 83 | function close() { | ||
86 | applicationWindow().controlsVisible = true; | 84 | applicationWindow().controlsVisible = true; | ||
87 | applicationWindow().header.visible = true; | | |||
88 | applicationWindow().footer.visible = true; | | |||
89 | applicationWindow().globalDrawer.visible = wasDrawerOpen; | 85 | applicationWindow().globalDrawer.visible = wasDrawerOpen; | ||
90 | applicationWindow().globalDrawer.enabled = true; | 86 | applicationWindow().globalDrawer.enabled = true; | ||
91 | applicationWindow().visibility = Window.Windowed; | 87 | applicationWindow().visibility = Window.Windowed; | ||
92 | applicationWindow().pageStack.layers.pop(); | 88 | applicationWindow().pageStack.layers.pop(); | ||
93 | } | 89 | } | ||
94 | 90 | | |||
95 | 91 | | |||
96 | background: Rectangle { | 92 | background: Rectangle { | ||
97 | color: "black" | 93 | color: "black" | ||
98 | } | 94 | } | ||
99 | 95 | | |||
100 | Keys.onPressed: { | 96 | Keys.onPressed: { | ||
101 | switch(event.key) { | 97 | switch(event.key) { | ||
102 | case Qt.Key_Escape: | 98 | case Qt.Key_Escape: | ||
103 | root.close(); | 99 | root.close(); | ||
104 | break; | 100 | break; | ||
105 | case Qt.Key_F: | 101 | case Qt.Key_F: | ||
102 | applicationWindow().controlsVisible = false | ||||
106 | applicationWindow().visibility = applicationWindow().visibility == Window.FullScreen ? Window.Windowed : Window.FullScreen | 103 | applicationWindow().visibility = applicationWindow().visibility == Window.FullScreen ? Window.Windowed : Window.FullScreen | ||
107 | break; | 104 | break; | ||
108 | default: | 105 | default: | ||
109 | break; | 106 | break; | ||
110 | } | 107 | } | ||
111 | } | 108 | } | ||
112 | 109 | | |||
113 | ListView { | 110 | ListView { | ||
▲ Show 20 Lines • Show All 115 Lines • ▼ Show 20 Line(s) | 221 | Image { | |||
229 | fillMode: Image.PreserveAspectFit | 226 | fillMode: Image.PreserveAspectFit | ||
230 | asynchronous: true | 227 | asynchronous: true | ||
231 | autoTransform: true | 228 | autoTransform: true | ||
232 | sourceSize.width: imageWidth * 2 | 229 | sourceSize.width: imageWidth * 2 | ||
233 | sourceSize.height: imageHeight * 2 | 230 | sourceSize.height: imageHeight * 2 | ||
234 | Timer { | 231 | Timer { | ||
235 | id: doubleClickTimer | 232 | id: doubleClickTimer | ||
236 | interval: 150 | 233 | interval: 150 | ||
237 | onTriggered: applicationWindow().controlsVisible = !applicationWindow().controlsVisible | 234 | onTriggered: { | ||
235 | if( applicationWindow().visibility == Window.Windowed) { | ||||
mart: i would prefer controls to be available also on full screen | |||||
236 | applicationWindow().controlsVisible = !applicationWindow().controlsVisible | ||||
237 | } | ||||
238 | } | ||||
238 | } | 239 | } | ||
239 | MouseArea { | 240 | MouseArea { | ||
240 | anchors.fill: parent | 241 | anchors.fill: parent | ||
241 | onClicked: { | 242 | onClicked: { | ||
242 | doubleClickTimer.restart(); | 243 | doubleClickTimer.restart(); | ||
243 | } | 244 | } | ||
244 | onDoubleClicked: { | 245 | onDoubleClicked: { | ||
245 | doubleClickTimer.running = false; | 246 | doubleClickTimer.running = false; | ||
▲ Show 20 Lines • Show All 63 Lines • Show Last 20 Lines |
heder and footer needs to never ever be visible when the imageviewer is open, regardless of controlsVisible or not