Add native menubar.
This commit is contained in:
28
qml/main.qml
28
qml/main.qml
@@ -3,6 +3,7 @@ import QtQuick.Controls 2.12
|
|||||||
import QtQuick.Layouts 1.12
|
import QtQuick.Layouts 1.12
|
||||||
import QtQuick.Controls.Material 2.12
|
import QtQuick.Controls.Material 2.12
|
||||||
import Qt.labs.settings 1.1
|
import Qt.labs.settings 1.1
|
||||||
|
import Qt.labs.platform 1.1
|
||||||
|
|
||||||
import Spectral.Panel 2.0
|
import Spectral.Panel 2.0
|
||||||
import Spectral.Component 2.0
|
import Spectral.Component 2.0
|
||||||
@@ -46,6 +47,33 @@ ApplicationWindow {
|
|||||||
onShowWindow: window.showWindow()
|
onShowWindow: window.showWindow()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MenuBar {
|
||||||
|
id: menuBar
|
||||||
|
|
||||||
|
Menu {
|
||||||
|
id: fileMenu
|
||||||
|
title: "File"
|
||||||
|
|
||||||
|
MenuItem {
|
||||||
|
text: "Preferences"
|
||||||
|
|
||||||
|
shortcut: StandardKey.Preferences
|
||||||
|
role: MenuItem.PreferencesRole
|
||||||
|
|
||||||
|
onTriggered: accountDetailDialog.createObject(window).open()
|
||||||
|
}
|
||||||
|
|
||||||
|
MenuItem {
|
||||||
|
text: "Quit"
|
||||||
|
|
||||||
|
shortcut: StandardKey.Quit
|
||||||
|
role: MenuItem.QuitRole
|
||||||
|
|
||||||
|
onTriggered: Qt.quit()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Controller {
|
Controller {
|
||||||
id: spectralController
|
id: spectralController
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user