Warning, /graphics/washipad/src/main.qml is written in an unsupported language. File is not indexed.

0001 // This file is part of Washi Pad
0002 // SPDX-FileCopyrightText: 2018 Kevin Ottens <ervin@kde.org>
0003 // SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0004 
0005 import QtQuick 2.0
0006 import QtQuick.Window 2.0
0007 import Qt.labs.platform 1.1
0008 
0009 import WashiPad 1.0
0010 
0011 Rectangle {
0012     id: background
0013     color: Qt.rgba(0.25, 0.25, 0.25, 1.0)
0014 
0015     SketchModel {
0016         id: sketchModel
0017     }
0018 
0019     Sketch {
0020         id: sketch
0021         anchors.fill: parent
0022         penColor: toolBar.currentColor
0023         model: sketchModel
0024         isMouseSupportEnabled: toolBar.isMouseSupportEnabled
0025     }
0026 
0027     ToolBar {
0028         id: toolBar
0029         anchors.top: parent.top
0030         anchors.right: parent.right
0031         cursorPos: sketch.cursorPos
0032         onSaveRequested: saveDialog.open()
0033     }
0034 
0035     SketchSerializer {
0036         id: serializer
0037     }
0038 
0039     FileDialog {
0040          id: saveDialog
0041          title: "Save as..."
0042          fileMode: FileDialog.SaveFile
0043          folder: StandardPaths.writableLocation(StandardPaths.HomeLocation)
0044          nameFilters: [ "SVG Image (*.svg)", "PNG Image (*.png)" ]
0045          onAccepted: {
0046              serializer.serialize(sketchModel, sketch.size, file)
0047          }
0048      }
0049 }