Add interactive menu bar (File, Controller, Tools, Help) with clickable items

This commit is contained in:
accusys
2026-03-29 16:24:38 +08:00
parent 6e9aad2912
commit 287a3423ba
+69 -24
View File
@@ -1,6 +1,5 @@
// RAIDGuard X - Complete GUI Recreation // RAIDGuard X - Complete GUI Recreation
// Mimics Java Swing frmMain.java appearance // Mimics Java Swing frmMain.java appearance
// Based on Java frmMain.java structure (765x700, toolbar 750x65)
export component AppWindow inherits Window { export component AppWindow inherits Window {
title: "RAIDGuard X - DTR RAID Admin"; title: "RAIDGuard X - DTR RAID Admin";
@@ -15,6 +14,12 @@ export component AppWindow inherits Window {
callback menu_exit(); callback menu_exit();
callback menu_add_controller(); callback menu_add_controller();
// Menu bar properties for callbacks
in-out property<bool> menu_file_open: false;
in-out property<bool> menu_ctrl_open: false;
in-out property<bool> menu_tools_open: false;
in-out property<bool> menu_help_open: false;
in-out property<bool> connected: false; in-out property<bool> connected: false;
in-out property<bool> is_loading: false; in-out property<bool> is_loading: false;
in-out property<string> status_text: "Disconnected"; in-out property<string> status_text: "Disconnected";
@@ -100,35 +105,75 @@ export component AppWindow inherits Window {
VerticalLayout { VerticalLayout {
spacing: 0; spacing: 0;
// Menu Bar - matches Java Swing JMenuBar (height 21) // Menu Bar - matches Java Swing JMenuBar
Rectangle { Rectangle {
height: 21px; height: 22px;
background: #d4d0c8; background: #d4d0c8;
HorizontalLayout { HorizontalLayout {
padding: 2px; spacing: 0;
spacing: 4px;
Text { // File menu
text: "File"; Rectangle {
font_size: 12px; width: 55px;
color: #000000; height: 22px;
background: menu_file_open ? #c0c0c0 : #d4d0c8;
Text {
text: "File";
font_size: 12px;
horizontal-alignment: center;
vertical-alignment: center;
}
TouchArea {
clicked => { menu_file_open = !menu_file_open; }
}
} }
Text { width: 16px; }
Text { // Controller menu
text: "Controller"; Rectangle {
font_size: 12px; width: 85px;
color: #000000; height: 22px;
background: menu_ctrl_open ? #c0c0c0 : #d4d0c8;
Text {
text: "Controller";
font_size: 12px;
horizontal-alignment: center;
vertical-alignment: center;
}
TouchArea {
clicked => { menu_ctrl_open = !menu_ctrl_open; }
}
} }
Text { width: 16px; }
Text { // Tools menu
text: "Tools"; Rectangle {
font_size: 12px; width: 55px;
color: #000000; height: 22px;
background: menu_tools_open ? #c0c0c0 : #d4d0c8;
Text {
text: "Tools";
font_size: 12px;
horizontal-alignment: center;
vertical-alignment: center;
}
TouchArea {
clicked => { menu_tools_open = !menu_tools_open; }
}
} }
Text { width: 16px; }
Text { // Help menu
text: "Help"; Rectangle {
font_size: 12px; width: 55px;
color: #000000; height: 22px;
background: menu_help_open ? #c0c0c0 : #d4d0c8;
Text {
text: "Help";
font_size: 12px;
horizontal-alignment: center;
vertical-alignment: center;
}
TouchArea {
clicked => { menu_help_open = !menu_help_open; }
}
} }
} }
} }