Align tui and gui menubars.

This commit is contained in:
2026-03-13 17:46:15 -04:00
parent a92844b8e5
commit ae5d1c7e22
2 changed files with 13 additions and 54 deletions

View File

@@ -18,22 +18,6 @@ MenuBar {
ClideMenu {
title: qsTr("&File")
ClideMenuItem {
action: Action {
id: actionNewProject
text: qsTr("&New Project...")
}
}
ClideMenuItem {
action: Action {
id: actionOpen
text: qsTr("&Open...")
}
onTriggered: FileSystem.setDirectory(FileSystem.filePath)
}
ClideMenuItem {
action: Action {
id: actionSave
@@ -41,6 +25,13 @@ MenuBar {
text: qsTr("&Save")
}
}
ClideMenuItem {
action: Action {
id: actionReload
text: qsTr("&Reload")
}
}
MenuSeparator {
background: Rectangle {
border.color: color
@@ -67,37 +58,9 @@ MenuBar {
ClideMenuItem {
action: Action {
id: actionUndo
id: actionCloseTab
text: qsTr("&Undo")
}
}
ClideMenuItem {
action: Action {
id: actionRedo
text: qsTr("&Redo")
}
}
ClideMenuItem {
action: Action {
id: actionCut
text: qsTr("&Cut")
}
}
ClideMenuItem {
action: Action {
id: actionCopy
text: qsTr("&Copy")
}
}
ClideMenuItem {
action: Action {
id: actionPaste
text: qsTr("&Paste")
text: qsTr("&Close Tab")
}
}
}
@@ -132,13 +95,6 @@ MenuBar {
ClideMenu {
title: qsTr("&Help")
ClideMenuItem {
action: Action {
id: actionDocumentation
text: qsTr("&Documentation")
}
}
ClideMenuItem {
action: Action {
id: actionAbout

View File

@@ -21,6 +21,7 @@ use strum::{EnumIter, FromRepr, IntoEnumIterator};
#[derive(Debug, Clone, Copy, PartialEq, Eq, FromRepr, EnumIter)]
enum MenuBarItem {
File,
Edit,
View,
Help,
}
@@ -68,12 +69,14 @@ impl MenuBarItem {
MenuBarItem::File => "File",
MenuBarItem::View => "View",
MenuBarItem::Help => "Help",
MenuBarItem::Edit => "Edit",
}
}
pub fn options(&self) -> &[MenuBarItemOption] {
match self {
MenuBarItem::File => &[Save, CloseTab, Reload, Exit],
MenuBarItem::File => &[Save, Reload, Exit],
MenuBarItem::Edit => &[CloseTab],
MenuBarItem::View => &[ShowHideExplorer, ShowHideLogger],
MenuBarItem::Help => &[About],
}