mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
QML UI: add button to show the preferences window
Add a button in the main qml file to show the preferences window. This window is linked to the QMLManager class, so any changes made will be saved to the user's settings file. Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
This commit is contained in:
parent
956336ae1a
commit
f01ec470e7
1 changed files with 180 additions and 158 deletions
|
@ -2,12 +2,12 @@ import QtQuick 2.3
|
||||||
import QtQuick.Controls 1.2
|
import QtQuick.Controls 1.2
|
||||||
import QtQuick.Window 2.2
|
import QtQuick.Window 2.2
|
||||||
import QtQuick.Dialogs 1.2
|
import QtQuick.Dialogs 1.2
|
||||||
|
import QtQuick.Layouts 1.1
|
||||||
import org.subsurfacedivelog.mobile 1.0
|
import org.subsurfacedivelog.mobile 1.0
|
||||||
|
|
||||||
ApplicationWindow {
|
ApplicationWindow {
|
||||||
title: qsTr("Subsurface")
|
title: qsTr("Subsurface")
|
||||||
width: 500;
|
width: 500;
|
||||||
height: 700
|
|
||||||
|
|
||||||
FileDialog {
|
FileDialog {
|
||||||
id: fileOpen
|
id: fileOpen
|
||||||
|
@ -23,24 +23,45 @@ ApplicationWindow {
|
||||||
id: manager
|
id: manager
|
||||||
}
|
}
|
||||||
|
|
||||||
menuBar: MenuBar {
|
Preferences {
|
||||||
Menu {
|
id: prefsWindow
|
||||||
title: qsTr("File")
|
|
||||||
MenuItem {
|
|
||||||
text: qsTr("Open")
|
|
||||||
onTriggered: fileOpen.open()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MenuItem {
|
ColumnLayout {
|
||||||
text: qsTr("Exit")
|
id: layout
|
||||||
onTriggered: Qt.quit();
|
anchors.fill: parent
|
||||||
|
spacing: 4
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: topPart
|
||||||
|
height: 35
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.maximumHeight: 35
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
Button {
|
||||||
|
id: prefsButton
|
||||||
|
text: "Preferences"
|
||||||
|
onClicked: {
|
||||||
|
prefsWindow.show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Button {
|
||||||
|
id: openFile
|
||||||
|
text: "Open File"
|
||||||
|
onClicked: {
|
||||||
|
fileOpen.open();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: page
|
id: page
|
||||||
width: parent.width; height: parent.height
|
Layout.fillHeight: true
|
||||||
|
Layout.fillWidth: true
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
id: diveDelegate
|
id: diveDelegate
|
||||||
|
@ -198,4 +219,5 @@ ApplicationWindow {
|
||||||
section.delegate: tripHeading
|
section.delegate: tripHeading
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue