Commit d3882f70 authored by Alberto Mardegan's avatar Alberto Mardegan
Browse files

QML: add fullscreen button

parent a2f32b92
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="64"
height="64"
viewBox="0 0 16.933333 16.933334"
version="1.1"
id="svg8"
inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)"
sodipodi:docname="fullscreen.svg">
<defs
id="defs2" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="11.2"
inkscape:cx="28.413239"
inkscape:cy="32.698036"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="true"
units="px"
inkscape:window-width="1871"
inkscape:window-height="1056"
inkscape:window-x="49"
inkscape:window-y="24"
inkscape:window-maximized="1"
inkscape:pagecheckerboard="true">
<inkscape:grid
type="xygrid"
id="grid4518"
empspacing="4" />
</sodipodi:namedview>
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-280.06665)">
<rect
style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#040404;stroke-width:1.05833328;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:markers fill stroke"
id="rect821"
width="12.7"
height="12.7"
x="1.0583333"
y="283.24164" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.05833333;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
d="m 3.175,281.12498 h 12.7 v 12.7"
id="path825"
inkscape:connector-curvature="0" />
</g>
</svg>
<!DOCTYPE RCC><RCC version="1.0">
<qresource prefix="/icons">
<file alias="fullscreen">fullscreen.svg</file>
</qresource>
</RCC>
import QtQuick 2.7
import QtQuick.Controls 2.2
ToolButton {
id: root
property alias iconSource: image.source
contentItem: Image {
id: image
}
}
import QtQuick 2.7
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
RowLayout {
id: root
signal toggleFullScreenRequested()
signal moveViewRequested()
anchors.fill: parent
Item { Layout.fillWidth: true }
OsdButton {
Layout.alignment : Qt.AlignRight
iconSource: "qrc:/icons/fullscreen"
onClicked: root.toggleFullScreenRequested()
}
}
import LomiriVNC 1.0
import QtQuick 2.7
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import QtQuick.Window 2.2
Page {
id: root
......@@ -35,4 +35,23 @@ Page {
enabled: !parent.pinch.active
}
}
Drawer {
width: root.width
edge: Qt.BottomEdge
OsdRow {
onToggleFullScreenRequested: root.toggleFullScreen()
}
}
function toggleFullScreen() {
var window = Window.window
if (window.visibility == Window.FullScreen) {
window.showNormal()
} else {
window.showFullScreen()
}
}
}
......@@ -2,6 +2,8 @@
<qresource prefix="/">
<file>BackButton.qml</file>
<file>MainPage.qml</file>
<file>OsdRow.qml</file>
<file>OsdButton.qml</file>
<file>PlatformInitialization.qml</file>
<file>TextFieldWithContextMenu.qml</file>
<file>TitleHeader.qml</file>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment