mirror of
https://github.com/Swordfish90/cool-retro-term.git
synced 2025-02-20 20:09:14 +00:00
Add menubar in context menu when the application menubar is hidden.
This commit is contained in:
parent
d2b677a0e2
commit
1febce3775
51
app/qml/CRTMainMenuBar.qml
Normal file
51
app/qml/CRTMainMenuBar.qml
Normal file
@ -0,0 +1,51 @@
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.1
|
||||
|
||||
MenuBar {
|
||||
id: defaultMenuBar
|
||||
property bool visible: true
|
||||
Menu {
|
||||
title: qsTr("File")
|
||||
visible: defaultMenuBar.visible
|
||||
MenuItem {action: quitAction}
|
||||
}
|
||||
Menu {
|
||||
title: qsTr("Edit")
|
||||
visible: defaultMenuBar.visible
|
||||
MenuItem {action: copyAction}
|
||||
MenuItem {action: pasteAction}
|
||||
MenuSeparator{}
|
||||
MenuItem {action: showsettingsAction}
|
||||
}
|
||||
Menu{
|
||||
title: qsTr("View")
|
||||
visible: defaultMenuBar.visible
|
||||
MenuItem {action: fullscreenAction}
|
||||
MenuItem {action: showMenubarAction}
|
||||
MenuSeparator{}
|
||||
MenuItem {action: zoomIn}
|
||||
MenuItem {action: zoomOut}
|
||||
}
|
||||
Menu{
|
||||
id: profilesMenu
|
||||
title: qsTr("Profiles")
|
||||
visible: defaultMenuBar.visible
|
||||
Instantiator{
|
||||
model: shadersettings.profiles_list
|
||||
delegate: MenuItem {
|
||||
text: model.text
|
||||
onTriggered: {
|
||||
shadersettings.loadProfileString(obj_string);
|
||||
shadersettings.handleFontChanged();
|
||||
}
|
||||
}
|
||||
onObjectAdded: profilesMenu.insertItem(index, object)
|
||||
onObjectRemoved: profilesMenu.removeItem(object)
|
||||
}
|
||||
}
|
||||
Menu{
|
||||
title: qsTr("Help")
|
||||
visible: defaultMenuBar.visible
|
||||
MenuItem {action: showAboutAction}
|
||||
}
|
||||
}
|
@ -114,12 +114,13 @@ Item{
|
||||
}
|
||||
Menu{
|
||||
id: contextmenu
|
||||
|
||||
MenuItem{action: copyAction}
|
||||
MenuItem{action: pasteAction}
|
||||
MenuSeparator{}
|
||||
MenuItem{action: fullscreenAction}
|
||||
MenuItem{action: showMenubarAction}
|
||||
MenuSeparator{visible: !shadersettings.showMenubar}
|
||||
CRTMainMenuBar{visible: !shadersettings.showMenubar}
|
||||
}
|
||||
MouseArea{
|
||||
acceptedButtons: Qt.LeftButton | Qt.MiddleButton | Qt.RightButton
|
||||
|
@ -107,51 +107,8 @@ ApplicationWindow{
|
||||
aboutDialog.show();
|
||||
}
|
||||
}
|
||||
MenuBar {
|
||||
CRTMainMenuBar{
|
||||
id: defaultMenuBar
|
||||
Menu {
|
||||
title: qsTr("File")
|
||||
visible: shadersettings.showMenubar
|
||||
MenuItem {action: quitAction}
|
||||
}
|
||||
Menu {
|
||||
title: qsTr("Edit")
|
||||
visible: shadersettings.showMenubar
|
||||
MenuItem {action: copyAction}
|
||||
MenuItem {action: pasteAction}
|
||||
MenuSeparator{}
|
||||
MenuItem {action: showsettingsAction}
|
||||
}
|
||||
Menu{
|
||||
title: qsTr("View")
|
||||
visible: shadersettings.showMenubar
|
||||
MenuItem {action: fullscreenAction}
|
||||
MenuItem {action: showMenubarAction}
|
||||
MenuSeparator{}
|
||||
MenuItem {action: zoomIn}
|
||||
MenuItem {action: zoomOut}
|
||||
}
|
||||
Menu{
|
||||
id: profilesMenu
|
||||
title: qsTr("Profiles")
|
||||
Instantiator{
|
||||
model: shadersettings.profiles_list
|
||||
delegate: MenuItem {
|
||||
text: model.text
|
||||
onTriggered: {
|
||||
shadersettings.loadProfileString(obj_string);
|
||||
shadersettings.handleFontChanged();
|
||||
}
|
||||
}
|
||||
onObjectAdded: profilesMenu.insertItem(index, object)
|
||||
onObjectRemoved: profilesMenu.removeItem(object)
|
||||
}
|
||||
}
|
||||
Menu{
|
||||
title: qsTr("Help")
|
||||
visible: shadersettings.showMenubar
|
||||
MenuItem {action: showAboutAction}
|
||||
}
|
||||
}
|
||||
ApplicationSettings{
|
||||
id: shadersettings
|
||||
|
@ -63,6 +63,6 @@
|
||||
<file>fonts/1985-ibm-pc-vga/Perfect DOS VGA 437.ttf</file>
|
||||
<file>fonts/1985-ibm-pc-vga/dos437.txt</file>
|
||||
<file>Storage.qml</file>
|
||||
<file>CRTMainMenuBar.qml</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user