Add interactive menu bar (File, Controller, Tools, Help) with clickable items
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
// RAIDGuard X - Complete GUI Recreation
|
||||
// Mimics Java Swing frmMain.java appearance
|
||||
// Based on Java frmMain.java structure (765x700, toolbar 750x65)
|
||||
|
||||
export component AppWindow inherits Window {
|
||||
title: "RAIDGuard X - DTR RAID Admin";
|
||||
@@ -15,6 +14,12 @@ export component AppWindow inherits Window {
|
||||
callback menu_exit();
|
||||
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> is_loading: false;
|
||||
in-out property<string> status_text: "Disconnected";
|
||||
@@ -100,35 +105,75 @@ export component AppWindow inherits Window {
|
||||
VerticalLayout {
|
||||
spacing: 0;
|
||||
|
||||
// Menu Bar - matches Java Swing JMenuBar (height 21)
|
||||
// Menu Bar - matches Java Swing JMenuBar
|
||||
Rectangle {
|
||||
height: 21px;
|
||||
height: 22px;
|
||||
background: #d4d0c8;
|
||||
HorizontalLayout {
|
||||
padding: 2px;
|
||||
spacing: 4px;
|
||||
Text {
|
||||
text: "File";
|
||||
font_size: 12px;
|
||||
color: #000000;
|
||||
spacing: 0;
|
||||
|
||||
// File menu
|
||||
Rectangle {
|
||||
width: 55px;
|
||||
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 {
|
||||
text: "Controller";
|
||||
font_size: 12px;
|
||||
color: #000000;
|
||||
|
||||
// Controller menu
|
||||
Rectangle {
|
||||
width: 85px;
|
||||
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 {
|
||||
text: "Tools";
|
||||
font_size: 12px;
|
||||
color: #000000;
|
||||
|
||||
// Tools menu
|
||||
Rectangle {
|
||||
width: 55px;
|
||||
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 {
|
||||
text: "Help";
|
||||
font_size: 12px;
|
||||
color: #000000;
|
||||
|
||||
// Help menu
|
||||
Rectangle {
|
||||
width: 55px;
|
||||
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; }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user