mirror of
https://github.com/Serial-Studio/Serial-Studio.git
synced 2025-01-31 17:42:55 +08:00
Save menubar visiblity status
This commit is contained in:
parent
2557711523
commit
01d2bfb672
@ -25,6 +25,7 @@ import QtQuick.Controls 2.12
|
||||
|
||||
MenuBar {
|
||||
id: root
|
||||
visible: app.menubarEnabled
|
||||
|
||||
//
|
||||
// Set background color + border
|
||||
@ -207,7 +208,7 @@ MenuBar {
|
||||
|
||||
DecentMenuItem {
|
||||
sequence: "alt+m"
|
||||
onTriggered: root.visible = !root.visible
|
||||
onTriggered: app.toggleMenubar()
|
||||
text: root.visible ? qsTr("Hide menubar") : qsTr("Show menubar")
|
||||
}
|
||||
}
|
||||
|
@ -143,11 +143,17 @@ Control {
|
||||
enabled: Cpp_IO_Console.saveAvailable
|
||||
}
|
||||
|
||||
MenuSeparator {}
|
||||
MenuSeparator {
|
||||
visible: app.menuBar !== null
|
||||
}
|
||||
|
||||
MenuItem {
|
||||
//onTriggered: app.menuBar.visible = !app.menuBar.visible
|
||||
//text: app.menuBar.visible ? qsTr("Hide menubar") : qsTr("Show menubar")
|
||||
enabled: visible
|
||||
visible: app.menuBar !== null
|
||||
onTriggered: app.toggleMenubar()
|
||||
height: visible ? implicitHeight : 0
|
||||
text: visible && app.menuBar.visible ? qsTr("Hide menubar") :
|
||||
qsTr("Show menubar")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -93,6 +93,11 @@ ApplicationWindow {
|
||||
readonly property bool dashboardAvailable: Cpp_UI_Provider.groupCount > 0
|
||||
readonly property bool widgetsAvailable: Cpp_UI_WidgetProvider.totalWidgetCount > 0
|
||||
|
||||
//
|
||||
// Menubar status
|
||||
//
|
||||
property bool menubarEnabled: true
|
||||
|
||||
//
|
||||
// Check for updates (non-silent mode)
|
||||
//
|
||||
@ -150,6 +155,13 @@ ApplicationWindow {
|
||||
terminal.copy()
|
||||
}
|
||||
|
||||
//
|
||||
// Hide/show menubar
|
||||
//
|
||||
function toggleMenubar() {
|
||||
app.menubarEnabled = !app.menubarEnabled
|
||||
}
|
||||
|
||||
//
|
||||
// Select all console text
|
||||
//
|
||||
@ -303,6 +315,7 @@ ApplicationWindow {
|
||||
property alias appStatus: app.appLaunchStatus
|
||||
property alias autoUpdater: app.automaticUpdates
|
||||
property alias appMaximized: app.windowMaximized
|
||||
property alias menubarVisible: app.menubarEnabled
|
||||
}
|
||||
|
||||
//
|
||||
|
Loading…
x
Reference in New Issue
Block a user