From 96656140d102a97f8406f39a9f81382798d028b9 Mon Sep 17 00:00:00 2001 From: Klesti Selimaj Date: Wed, 15 Jul 2026 01:00:33 +0200 Subject: [PATCH] Fixed outline --- pulse-ui/src/widget/outline.rs | 13 +++++++++---- src/main.rs | 9 +++++++-- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/pulse-ui/src/widget/outline.rs b/pulse-ui/src/widget/outline.rs index 2d28b27..8ff1e8c 100644 --- a/pulse-ui/src/widget/outline.rs +++ b/pulse-ui/src/widget/outline.rs @@ -4,17 +4,22 @@ pub struct Outline; impl Widget for Outline { fn render(&self, scope: &mut crate::render::RenderScope) { - scope.draw_text(0, "-".repeat(scope.rect.width as usize)); + scope.draw_text(0, "─".repeat(scope.rect.width as usize)); - scope.draw_text((0, 1), "|\n".repeat(scope.rect.height as usize - 2)); + scope.draw_text((0, 1), "│\n".repeat(scope.rect.height as usize - 2)); scope.draw_text( (scope.rect.width - 1, 1), - "|\n".repeat(scope.rect.height as usize - 2), + "│\n".repeat(scope.rect.height as usize - 2), ); scope.draw_text( (0, scope.rect.height - 1), - "-".repeat(scope.rect.width as usize), + "─".repeat(scope.rect.width as usize), ); + + scope.draw_text(0, "┌"); + scope.draw_text((scope.rect.width - 1, 0), "┐"); + scope.draw_text((0, scope.rect.height - 1), "└"); + scope.draw_text((scope.rect.width - 1, scope.rect.height - 1), "┘"); } } diff --git a/src/main.rs b/src/main.rs index 6e51fcb..4574386 100644 --- a/src/main.rs +++ b/src/main.rs @@ -5,7 +5,7 @@ use pulse_ui::{ layout::{LayoutItem, layout}, state::{Refresh, State}, unit::Size, - widget::spaced::SpacedRows, + widget::{outline::Outline, spaced::SpacedRows}, }; pub struct PulseTradeApp { @@ -24,10 +24,15 @@ impl App for PulseTradeApp { } async fn layout(&self) -> pulse_ui::layout::LayoutItem { - layout(vec![LayoutItem::Widget(Size::Flex(1))]) + layout(vec![LayoutItem::Frame { + padding: 1, + item: Box::new(LayoutItem::Widget(Size::Flex(1))), + }]) } async fn render(&mut self, layout: pulse_ui::layout::Allocation) { + // layout.draw_frame(0, Outline); + layout.draw( 0, SpacedRows(vec![