gui-cs / TerminalGuiDesigner

Forms Designer for Terminal.Gui (aka gui.cs)
MIT License
423 stars 28 forks source link

Adding 2 MenuBar to a Window is broken in v2 #287

Open tznind opened 8 months ago

tznind commented 8 months ago
  1. Create a new view
  2. Add 2 MenuBar
  3. Move them so they are both visible
  4. Save
  5. Close and re open app
  6. Open View

Expected: Both menu bars to be in same place as before (this is the way it works in v1) Observed: Only one menu bar is visible

image

tznind commented 8 months ago

Looks like the menu bar is there and after opening you can tab to it but its not visible.

Looking at properties it seems it has Width:0

View seemingly loads fine in real apps so must be a bug in properties or something.

image

Example .Designer.cs file (which looks correct) ```csharp //------------------------------------------------------------------------------ // // This code was generated by: // TerminalGuiDesigner v1.1.0.0 // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // // ----------------------------------------------------------------------------- namespace YourNamespace { using System; using Terminal.Gui; using System.Collections; using System.Collections.Generic; public partial class Class1 : Terminal.Gui.Window { private Terminal.Gui.MenuBar menuBar; private Terminal.Gui.MenuBarItem fileF9Menu; private Terminal.Gui.MenuItem editMeMenuItem; private Terminal.Gui.MenuBar menuBar2; private Terminal.Gui.MenuBarItem fileF9Menu2; private Terminal.Gui.MenuItem editMeMenuItem2; private void InitializeComponent() { this.menuBar2 = new Terminal.Gui.MenuBar(); this.menuBar = new Terminal.Gui.MenuBar(); this.Width = Dim.Fill(0); this.Height = Dim.Fill(0); this.X = 0; this.Y = 0; this.Visible = true; this.Modal = false; this.TextAlignment = Terminal.Gui.TextAlignment.Left; this.Title = ""; this.menuBar.Width = Dim.Fill(0); this.menuBar.Height = 1; this.menuBar.X = 0; this.menuBar.Y = 0; this.menuBar.Visible = true; this.menuBar.Data = "menuBar"; this.menuBar.TextAlignment = Terminal.Gui.TextAlignment.Left; this.fileF9Menu = new Terminal.Gui.MenuBarItem(); this.fileF9Menu.Title = "_File (F9)"; this.editMeMenuItem = new Terminal.Gui.MenuItem(); this.editMeMenuItem.Title = "Edit Me"; this.editMeMenuItem.Data = "editMeMenuItem"; this.fileF9Menu.Children = new Terminal.Gui.MenuItem[] { this.editMeMenuItem}; this.menuBar.Menus = new Terminal.Gui.MenuBarItem[] { this.fileF9Menu}; this.Add(this.menuBar); this.menuBar2.Width = Dim.Fill(0); this.menuBar2.Height = 1; this.menuBar2.X = 0; this.menuBar2.Y = 4; this.menuBar2.Visible = true; this.menuBar2.Data = "menuBar2"; this.menuBar2.TextAlignment = Terminal.Gui.TextAlignment.Left; this.fileF9Menu2 = new Terminal.Gui.MenuBarItem(); this.fileF9Menu2.Title = "_File (F9)"; this.editMeMenuItem2 = new Terminal.Gui.MenuItem(); this.editMeMenuItem2.Title = "Edit Me"; this.editMeMenuItem2.Data = "editMeMenuItem2"; this.fileF9Menu2.Children = new Terminal.Gui.MenuItem[] { this.editMeMenuItem2}; this.menuBar2.Menus = new Terminal.Gui.MenuBarItem[] { this.fileF9Menu2}; this.Add(this.menuBar2); } } } ```
tig commented 3 months ago

Suggestion: De-prioritize fixing this until this is done: