diff --git a/src/TUI/Controls/Components/BreadCrumbsComponent.cs b/src/TUI/Controls/Components/BreadCrumbsComponent.cs new file mode 100644 index 0000000..0d230a5 --- /dev/null +++ b/src/TUI/Controls/Components/BreadCrumbsComponent.cs @@ -0,0 +1,20 @@ +using TUI.Engine.Attributes; +using TUI.Engine.Components; +using TUI.Engine.Theme; + +namespace TUI.Controls.Components; + +public class BreadCrumbsComponent : ComponentBase +{ + private readonly List _crumbs = new() { " " }; + + public BreadCrumbsComponent(params string[] crumbs) + { + _crumbs.AddRange(crumbs); + } + + protected override Sketch DrawComponent(Size minSize) + { + return new Sketch(string.Join("  ".Hint(), _crumbs).Hint()); + } +} \ No newline at end of file diff --git a/src/TUI/Controls/Containers/FooterContainer.cs b/src/TUI/Controls/Containers/FooterContainer.cs new file mode 100644 index 0000000..90c98d5 --- /dev/null +++ b/src/TUI/Controls/Containers/FooterContainer.cs @@ -0,0 +1,28 @@ +using TUI.Controls.Statics; +using TUI.Engine.Attributes.Alignments; +using TUI.Engine.Components; +using TUI.Engine.Containers; +using TUI.Engine.Nodes; +using TUI.Engine.Theme; + +namespace TUI.Controls.Containers; + +public class FooterContainer : ContainerBase +{ + private readonly INode _breadcrumbs; + + public FooterContainer(IComponent breadcrumbs) + { + breadcrumbs.SetAlignment(Horizontal.Left); + breadcrumbs.SetPaddingLeft(Level.Normal); + _breadcrumbs = breadcrumbs; + } + + public override Nodes GetNodes() + { + var copyright = new CopyrightComponent(); + copyright.SetAlignment(Horizontal.Right); + copyright.SetPaddingRight(Level.Normal); + return new Nodes { _breadcrumbs, copyright }; + } +} \ No newline at end of file diff --git a/src/TUI/Controls/Layouts/DashboardLayout.cs b/src/TUI/Controls/Layouts/DashboardLayout.cs index 9efb3a7..f8e75e6 100644 --- a/src/TUI/Controls/Layouts/DashboardLayout.cs +++ b/src/TUI/Controls/Layouts/DashboardLayout.cs @@ -3,7 +3,6 @@ using TUI.Engine.Attributes.Orientations; using TUI.Engine.Components; using TUI.Engine.Containers; using TUI.Engine.Nodes; -using TUI.Engine.Theme; namespace TUI.Controls.Layouts; @@ -13,7 +12,7 @@ public class DashboardLayout : ContainerBase, IContainer private readonly INode _footer; private readonly INode _dashboard; - public DashboardLayout(INode header, INode dashboard, IComponent footer) + public DashboardLayout(INode header, INode dashboard, INode footer) { SetOrientationVertical(); SetAdaptive(Orientation.Horizontal); @@ -21,9 +20,6 @@ public class DashboardLayout : ContainerBase, IContainer header.SetFixed(Orientation.Vertical, 6); footer.SetFixed(Orientation.Vertical, 1); - footer.SetPaddingRight(Level.Normal); - footer.SetAlignment(Horizontal.Right); - footer.SetAlignment(Vertical.Bottom); _header = header; _footer = footer; diff --git a/src/TUI/Pages/DependenciesPage.cs b/src/TUI/Pages/DependenciesPage.cs index aa2ecd1..985f2b9 100644 --- a/src/TUI/Pages/DependenciesPage.cs +++ b/src/TUI/Pages/DependenciesPage.cs @@ -4,6 +4,7 @@ using TUI.Controls.Containers; using TUI.Controls.Layouts; using TUI.Controls.Statics; using TUI.Domain; +using TUI.Engine; using TUI.Engine.Rendering.Canvas; using TUI.Providers.Dependencies; using TUI.Store; @@ -40,7 +41,6 @@ public class DependenciesPage : PageBase ICanvas canvas = new ConsoleCanvas(); var header = new HeaderContainer(); - var copyright = new CopyrightComponent(); var dashboard = new DashboardContainer(); var dependenciesHeader = new DependenciesContainer(); dependenciesHeader.AddTitleStub(); @@ -59,7 +59,9 @@ public class DependenciesPage : PageBase dashboard.AddChildren(projectDependencies); } - var layout = new DashboardLayout(header, dashboard, copyright); + var breadCrumbs = new BreadCrumbsComponent(" dependencies", "JavaScript"); + var footer = new FooterContainer(breadCrumbs); + var layout = new DashboardLayout(header, dashboard, footer); canvas.Draw(layout); // CommandLine = new CommandLine();