Skip to content

Create a new Bar view to replace StatusBar (and eventually MenuBar) #3073

@tig

Description

@tig

Possible dupe of:

I want to refactor StatusBar. It's actually a quite simple control, but was written before...

  • View.Text
  • View.HotKey with killer ToString support
  • Frames (for StatusItem spacing/alignment)
  • Consistency in eventing (KeyBindings and no Action).
  • KeyBindingScope.Application

It should just be a View that is Width = Fill and Y = AnchorEnd by default.

The new StatusItem:

public class StatusItem : View {
    public override Text {
        get => $"KeyBindings.FirstOrDefault(b => b.Scope != KeyBindingScope.Focus).GetKeyFromCommands(Commands.Default));
}

... plus some stuff to auotmatically enable / disable Border.Thickness = new Thickness (0, 0, 1, 0) for the separator.

StatusBar.Add is an override that sets subview.X appropriately (1st gets X = 0, subsequent get X = Pos.View(prev); last gets Width = Dim.Fill()).

Originally posted by @tig in #3070 (comment)

Metadata

Metadata

Assignees

Labels

designIssues regarding Terminal.Gui design (bugs, guidelines, debates, etc...)

Type

No type

Projects

Status

✅ Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions