diff --git a/src/issue/app.rs b/src/issue/app.rs index 69c0b6e4..2350f62c 100644 --- a/src/issue/app.rs +++ b/src/issue/app.rs @@ -9,16 +9,17 @@ use radicle::identity::{Id, Project}; use radicle::prelude::Signer; use radicle::profile::Profile; -use radicle_tui::ui::subscription; -use radicle_tui::ui::widget; use tuirealm::application::PollStrategy; use tuirealm::{Application, Frame, NoUserEvent, Sub, SubClause}; -use radicle_tui::cob; -use radicle_tui::ui::context::Context; -use radicle_tui::ui::theme::{self, Theme}; -use radicle_tui::PageStack; -use radicle_tui::Tui; +use radicle_tui as tui; + +use tui::cob; +use tui::ui::context::Context; +use tui::ui::subscription; +use tui::ui::theme::{self, Theme}; +use tui::PageStack; +use tui::Tui; use page::{IssuePage, ListPage}; @@ -235,7 +236,7 @@ impl App { theme: &Theme, message: &str, ) -> Result<()> { - let popup = widget::common::info(theme, message); + let popup = tui::ui::info(theme, message); app.remount(Cid::Popup, popup.to_boxed(), vec![])?; app.active(&Cid::Popup)?; @@ -248,7 +249,7 @@ impl App { theme: &Theme, message: &str, ) -> Result<()> { - let popup = widget::common::warning(theme, message); + let popup = tui::ui::warning(theme, message); app.remount(Cid::Popup, popup.to_boxed(), vec![])?; app.active(&Cid::Popup)?; @@ -261,7 +262,7 @@ impl App { theme: &Theme, message: &str, ) -> Result<()> { - let popup = widget::common::error(theme, message); + let popup = tui::ui::error(theme, message); app.remount(Cid::Popup, popup.to_boxed(), vec![])?; app.active(&Cid::Popup)?; @@ -304,7 +305,7 @@ impl Tui for App { self.view_list(app, &self.theme.clone())?; // Add global key listener and subscribe to key events - let global = widget::common::global_listener().to_boxed(); + let global = tui::ui::global_listener().to_boxed(); app.mount( Cid::GlobalListener, global, diff --git a/src/issue/app/event.rs b/src/issue/app/event.rs index 59932034..774d85d3 100644 --- a/src/issue/app/event.rs +++ b/src/issue/app/event.rs @@ -3,14 +3,14 @@ use tuirealm::command::{Cmd, CmdResult, Direction as MoveDirection, Position}; use tuirealm::event::{Event, Key, KeyEvent, KeyModifiers}; use tuirealm::{MockComponent, NoUserEvent, State, StateValue}; -use radicle_tui::ui::widget::common::container::{ - AppHeader, GlobalListener, LabeledContainer, Popup, -}; -use radicle_tui::ui::widget::common::context::{ContextBar, Shortcuts}; -use radicle_tui::ui::widget::common::form::Form; -use radicle_tui::ui::widget::common::list::PropertyList; +use radicle_tui as tui; -use radicle_tui::ui::widget::Widget; +use tui::ui::widget::container::{AppHeader, GlobalListener, LabeledContainer, Popup}; +use tui::ui::widget::context::{ContextBar, Shortcuts}; +use tui::ui::widget::form::Form; +use tui::ui::widget::list::PropertyList; + +use tui::ui::widget::Widget; use super::ui; use super::{IssueCid, IssueMessage, Message, PopupMessage}; diff --git a/src/issue/app/page.rs b/src/issue/app/page.rs index aa3a1130..c64270cb 100644 --- a/src/issue/app/page.rs +++ b/src/issue/app/page.rs @@ -3,15 +3,18 @@ use std::collections::HashMap; use anyhow::Result; use radicle::cob::issue::{Issue, IssueId}; -use radicle_tui::cob; -use radicle_tui::ui::widget::common::context::{Progress, Shortcuts}; + use tuirealm::{AttrValue, Attribute, Frame, NoUserEvent, State, StateValue, Sub, SubClause}; -use radicle_tui::ui::context::Context; -use radicle_tui::ui::layout; -use radicle_tui::ui::theme::Theme; -use radicle_tui::ui::widget::{self, Widget}; -use radicle_tui::ViewPage; +use radicle_tui as tui; + +use tui::cob; +use tui::ui::context::Context; +use tui::ui::layout; +use tui::ui::theme::Theme; +use tui::ui::widget::context::{Progress, Shortcuts}; +use tui::ui::widget::Widget; +use tui::ViewPage; use super::{ Application, Cid, IssueCid, IssueCobMessage, IssueMessage, ListCid, Message, PopupMessage, @@ -53,14 +56,14 @@ impl ListPage { fn build_shortcuts(theme: &Theme) -> HashMap> { [( ListCid::IssueBrowser, - widget::common::shortcuts( + tui::ui::shortcuts( theme, vec![ - widget::common::shortcut(theme, "tab", "section"), - widget::common::shortcut(theme, "↑/↓", "navigate"), - widget::common::shortcut(theme, "enter", "show"), - widget::common::shortcut(theme, "o", "open"), - widget::common::shortcut(theme, "q", "quit"), + tui::ui::shortcut(theme, "tab", "section"), + tui::ui::shortcut(theme, "↑/↓", "navigate"), + tui::ui::shortcut(theme, "enter", "show"), + tui::ui::shortcut(theme, "o", "open"), + tui::ui::shortcut(theme, "q", "quit"), ], ), )] @@ -112,7 +115,7 @@ impl ViewPage for ListPage { theme: &Theme, ) -> Result<()> { let navigation = ui::list_navigation(theme); - let header = widget::common::app_header(context, theme, Some(navigation)).to_boxed(); + let header = tui::ui::app_header(context, theme, Some(navigation)).to_boxed(); let issue_browser = ui::issues(context, theme, None).to_boxed(); app.remount(Cid::List(ListCid::Header), header, vec![])?; @@ -229,36 +232,36 @@ impl IssuePage { [ ( IssueCid::List, - widget::common::shortcuts( + tui::ui::shortcuts( theme, vec![ - widget::common::shortcut(theme, "esc", "back"), - widget::common::shortcut(theme, "↑/↓", "navigate"), - widget::common::shortcut(theme, "enter", "show"), - widget::common::shortcut(theme, "o", "open"), - widget::common::shortcut(theme, "q", "quit"), + tui::ui::shortcut(theme, "esc", "back"), + tui::ui::shortcut(theme, "↑/↓", "navigate"), + tui::ui::shortcut(theme, "enter", "show"), + tui::ui::shortcut(theme, "o", "open"), + tui::ui::shortcut(theme, "q", "quit"), ], ), ), ( IssueCid::Details, - widget::common::shortcuts( + tui::ui::shortcuts( theme, vec![ - widget::common::shortcut(theme, "esc", "back"), - widget::common::shortcut(theme, "↑/↓", "scroll"), - widget::common::shortcut(theme, "q", "quit"), + tui::ui::shortcut(theme, "esc", "back"), + tui::ui::shortcut(theme, "↑/↓", "scroll"), + tui::ui::shortcut(theme, "q", "quit"), ], ), ), ( IssueCid::Form, - widget::common::shortcuts( + tui::ui::shortcuts( theme, vec![ - widget::common::shortcut(theme, "esc", "back"), - widget::common::shortcut(theme, "shift + tab / tab", "navigate"), - widget::common::shortcut(theme, "ctrl + s", "submit"), + tui::ui::shortcut(theme, "esc", "back"), + tui::ui::shortcut(theme, "shift + tab / tab", "navigate"), + tui::ui::shortcut(theme, "ctrl + s", "submit"), ], ), ), @@ -334,7 +337,7 @@ impl ViewPage for IssuePage { theme: &Theme, ) -> Result<()> { let navigation = ui::list_navigation(theme); - let header = widget::common::app_header(context, theme, Some(navigation)).to_boxed(); + let header = tui::ui::app_header(context, theme, Some(navigation)).to_boxed(); let list = ui::list(context, theme, self.issue.clone()).to_boxed(); app.remount(Cid::Issue(IssueCid::Header), header, vec![])?; diff --git a/src/issue/app/ui.rs b/src/issue/app/ui.rs index 8b54d2fb..87d49a41 100644 --- a/src/issue/app/ui.rs +++ b/src/issue/app/ui.rs @@ -8,18 +8,19 @@ use tuirealm::command::{Cmd, CmdResult}; use tuirealm::tui::layout::{Constraint, Direction, Layout, Rect}; use tuirealm::{AttrValue, Attribute, Frame, MockComponent, Props, State}; -use radicle_tui::ui::cob; -use radicle_tui::ui::cob::IssueItem; -use radicle_tui::ui::context::Context; -use radicle_tui::ui::theme::Theme; -use radicle_tui::ui::widget::common; -use radicle_tui::ui::widget::{Widget, WidgetComponent}; +use radicle_tui as tui; -use common::container::{Container, Tabs}; -use common::context::{ContextBar, Progress}; -use common::form::{Form, TextArea, TextField}; -use common::label::Textarea; -use common::list::{ColumnWidth, List, Property, Table}; +use tui::ui::cob; +use tui::ui::cob::IssueItem; +use tui::ui::context::Context; +use tui::ui::theme::Theme; +use tui::ui::widget::{Widget, WidgetComponent}; + +use tui::ui::widget::container::{Container, Tabs}; +use tui::ui::widget::context::{ContextBar, Progress}; +use tui::ui::widget::form::{Form, TextArea, TextField}; +use tui::ui::widget::label::Textarea; +use tui::ui::widget::list::{ColumnWidth, List, Property, Table}; pub const FORM_ID_EDIT: &str = "edit-form"; @@ -31,13 +32,13 @@ pub struct IssueBrowser { impl IssueBrowser { pub fn new(context: &Context, theme: &Theme, selected: Option<(IssueId, Issue)>) -> Self { let header = [ - common::label(" ● "), - common::label("ID"), - common::label("Title"), - common::label("Author"), - common::label("Tags"), - common::label("Assignees"), - common::label("Opened"), + tui::ui::label(" ● "), + tui::ui::label("ID"), + tui::ui::label("Title"), + tui::ui::label("Author"), + tui::ui::label("Tags"), + tui::ui::label("Assignees"), + tui::ui::label("Opened"), ]; let widths = [ @@ -121,7 +122,7 @@ impl LargeList { let list = Widget::new(List::new(&items, selected, theme.clone())) .highlight(theme.colors.item_list_highlighted_bg); - let container = common::container(theme, list.to_boxed()); + let container = tui::ui::container(theme, list.to_boxed()); Self { items, @@ -166,30 +167,30 @@ impl IssueHeader { let item = IssueItem::from((context.profile(), repo, id, issue.clone())); let title = Property::new( - common::label("Title").foreground(theme.colors.property_name_fg), - common::label(item.title()).foreground(theme.colors.browser_list_title), + tui::ui::label("Title").foreground(theme.colors.property_name_fg), + tui::ui::label(item.title()).foreground(theme.colors.browser_list_title), ); let author = Property::new( - common::label("Author").foreground(theme.colors.property_name_fg), - common::label(&cob::format_author(issue.author().id(), by_you)) + tui::ui::label("Author").foreground(theme.colors.property_name_fg), + tui::ui::label(&cob::format_author(issue.author().id(), by_you)) .foreground(theme.colors.browser_list_author), ); let issue_id = Property::new( - common::label("Issue").foreground(theme.colors.property_name_fg), - common::label(&id.to_string()).foreground(theme.colors.browser_list_description), + tui::ui::label("Issue").foreground(theme.colors.property_name_fg), + tui::ui::label(&id.to_string()).foreground(theme.colors.browser_list_description), ); let labels = Property::new( - common::label("Labels").foreground(theme.colors.property_name_fg), - common::label(&cob::format_labels(item.labels())) + tui::ui::label("Labels").foreground(theme.colors.property_name_fg), + tui::ui::label(&cob::format_labels(item.labels())) .foreground(theme.colors.browser_list_labels), ); let assignees = Property::new( - common::label("Assignees").foreground(theme.colors.property_name_fg), - common::label(&cob::format_assignees( + tui::ui::label("Assignees").foreground(theme.colors.property_name_fg), + tui::ui::label(&cob::format_assignees( &item .assignees() .iter() @@ -200,11 +201,11 @@ impl IssueHeader { ); let state = Property::new( - common::label("Status").foreground(theme.colors.property_name_fg), - common::label(&item.state().to_string()).foreground(theme.colors.browser_list_title), + tui::ui::label("Status").foreground(theme.colors.property_name_fg), + tui::ui::label(&item.state().to_string()).foreground(theme.colors.browser_list_title), ); - let table = common::property_table( + let table = tui::ui::property_table( theme, vec![ Widget::new(title), @@ -215,7 +216,7 @@ impl IssueHeader { Widget::new(state), ], ); - let container = common::container(theme, table.to_boxed()); + let container = tui::ui::container(theme, table.to_boxed()); Self { container } } @@ -294,7 +295,7 @@ impl CommentBody { .content(AttrValue::String(content)) .foreground(theme.colors.default_fg); - let textarea = common::container(theme, textarea.to_boxed()); + let textarea = tui::ui::container(theme, textarea.to_boxed()); Self { textarea } } @@ -320,9 +321,9 @@ impl WidgetComponent for CommentBody { } pub fn list_navigation(theme: &Theme) -> Widget { - common::tabs( + tui::ui::tabs( theme, - vec![common::reversable_label("Issues").foreground(theme.colors.tabs_highlighted_fg)], + vec![tui::ui::reversable_label("Issues").foreground(theme.colors.tabs_highlighted_fg)], ) } @@ -403,7 +404,7 @@ pub fn browse_context(context: &Context, theme: &Theme, progress: Progress) -> W .collect::>() .len(); - common::context::bar( + tui::ui::widget::context::bar( theme, "Browse", "", @@ -418,11 +419,11 @@ pub fn description_context( theme: &Theme, progress: Progress, ) -> Widget { - common::context::bar(theme, "Show", "", "", "", &progress.to_string()) + tui::ui::widget::context::bar(theme, "Show", "", "", "", &progress.to_string()) } pub fn form_context(_context: &Context, theme: &Theme, progress: Progress) -> Widget { - common::context::bar(theme, "Open", "", "", "", &progress.to_string()) + tui::ui::widget::context::bar(theme, "Open", "", "", "", &progress.to_string()) .custom(ContextBar::PROP_EDIT_MODE, AttrValue::Flag(true)) } diff --git a/src/patch/app.rs b/src/patch/app.rs index 77cc4847..a979ee74 100644 --- a/src/patch/app.rs +++ b/src/patch/app.rs @@ -11,10 +11,10 @@ use radicle::identity::{Id, Project}; use radicle::prelude::Signer; use radicle::profile::Profile; -use radicle_tui::ui::widget; use tuirealm::application::PollStrategy; use tuirealm::{Application, Frame, NoUserEvent, Sub, SubClause}; +use radicle_tui as tui; use radicle_tui::cob; use radicle_tui::ui::context::Context; use radicle_tui::ui::subscription; @@ -189,7 +189,7 @@ impl App { theme: &Theme, message: &str, ) -> Result<()> { - let popup = widget::common::info(theme, message); + let popup = tui::ui::info(theme, message); app.remount(Cid::Popup, popup.to_boxed(), vec![])?; app.active(&Cid::Popup)?; @@ -202,7 +202,7 @@ impl App { theme: &Theme, message: &str, ) -> Result<()> { - let popup = widget::common::warning(theme, message); + let popup = tui::ui::warning(theme, message); app.remount(Cid::Popup, popup.to_boxed(), vec![])?; app.active(&Cid::Popup)?; @@ -215,7 +215,7 @@ impl App { theme: &Theme, message: &str, ) -> Result<()> { - let popup = widget::common::error(theme, message); + let popup = tui::ui::error(theme, message); app.remount(Cid::Popup, popup.to_boxed(), vec![])?; app.active(&Cid::Popup)?; @@ -235,7 +235,7 @@ impl Tui for App { self.view_list(app, &self.theme.clone())?; // Add global key listener and subscribe to key events - let global = widget::common::global_listener().to_boxed(); + let global = tui::ui::global_listener().to_boxed(); app.mount( Cid::GlobalListener, global, diff --git a/src/patch/app/event.rs b/src/patch/app/event.rs index e0248078..92fbaca6 100644 --- a/src/patch/app/event.rs +++ b/src/patch/app/event.rs @@ -2,11 +2,9 @@ use tuirealm::command::{Cmd, CmdResult, Direction as MoveDirection}; use tuirealm::event::{Event, Key, KeyEvent}; use tuirealm::{MockComponent, NoUserEvent, State, StateValue}; -use radicle_tui::ui::widget::common::container::{ - AppHeader, GlobalListener, LabeledContainer, Popup, -}; -use radicle_tui::ui::widget::common::context::{ContextBar, Shortcuts}; -use radicle_tui::ui::widget::common::list::PropertyList; +use radicle_tui::ui::widget::container::{AppHeader, GlobalListener, LabeledContainer, Popup}; +use radicle_tui::ui::widget::context::{ContextBar, Shortcuts}; +use radicle_tui::ui::widget::list::PropertyList; use radicle_tui::ui::widget::Widget; diff --git a/src/patch/app/page.rs b/src/patch/app/page.rs index 986b5ef7..e68605e2 100644 --- a/src/patch/app/page.rs +++ b/src/patch/app/page.rs @@ -4,15 +4,16 @@ use anyhow::Result; use radicle::cob::patch::{Patch, PatchId}; -use radicle_tui::ui::widget::common::context::{Progress, Shortcuts}; use tuirealm::{Frame, NoUserEvent, State, StateValue, Sub, SubClause}; -use radicle_tui::ui::context::Context; -use radicle_tui::ui::layout; -use radicle_tui::ui::subscription; -use radicle_tui::ui::theme::Theme; -use radicle_tui::ui::widget::{self, Widget}; -use radicle_tui::ViewPage; +use radicle_tui as tui; + +use tui::ui::context::Context; +use tui::ui::theme::Theme; +use tui::ui::widget::context::{Progress, Shortcuts}; +use tui::ui::widget::Widget; +use tui::ui::{layout, subscription}; +use tui::ViewPage; use super::{ui, Application, Cid, ListCid, Message, PatchCid}; @@ -36,13 +37,13 @@ impl ListView { fn build_shortcuts(theme: &Theme) -> HashMap> { [( ListCid::PatchBrowser, - widget::common::shortcuts( + tui::ui::shortcuts( theme, vec![ - widget::common::shortcut(theme, "tab", "section"), - widget::common::shortcut(theme, "↑/↓", "navigate"), - widget::common::shortcut(theme, "enter", "show"), - widget::common::shortcut(theme, "q", "quit"), + tui::ui::shortcut(theme, "tab", "section"), + tui::ui::shortcut(theme, "↑/↓", "navigate"), + tui::ui::shortcut(theme, "enter", "show"), + tui::ui::shortcut(theme, "q", "quit"), ], ), )] @@ -95,7 +96,7 @@ impl ViewPage for ListView { theme: &Theme, ) -> Result<()> { let navigation = ui::list_navigation(theme); - let header = widget::common::app_header(context, theme, Some(navigation)).to_boxed(); + let header = tui::ui::app_header(context, theme, Some(navigation)).to_boxed(); let patch_browser = ui::patches(context, theme, None).to_boxed(); app.remount(Cid::List(ListCid::Header), header, vec![])?; @@ -186,23 +187,23 @@ impl PatchView { [ ( PatchCid::Activity, - widget::common::shortcuts( + tui::ui::shortcuts( theme, vec![ - widget::common::shortcut(theme, "esc", "back"), - widget::common::shortcut(theme, "tab", "section"), - widget::common::shortcut(theme, "q", "quit"), + tui::ui::shortcut(theme, "esc", "back"), + tui::ui::shortcut(theme, "tab", "section"), + tui::ui::shortcut(theme, "q", "quit"), ], ), ), ( PatchCid::Files, - widget::common::shortcuts( + tui::ui::shortcuts( theme, vec![ - widget::common::shortcut(theme, "esc", "back"), - widget::common::shortcut(theme, "tab", "section"), - widget::common::shortcut(theme, "q", "quit"), + tui::ui::shortcut(theme, "esc", "back"), + tui::ui::shortcut(theme, "tab", "section"), + tui::ui::shortcut(theme, "q", "quit"), ], ), ), @@ -236,7 +237,7 @@ impl ViewPage for PatchView { theme: &Theme, ) -> Result<()> { let navigation = ui::navigation(theme); - let header = widget::common::app_header(context, theme, Some(navigation)).to_boxed(); + let header = tui::ui::app_header(context, theme, Some(navigation)).to_boxed(); let activity = ui::activity(theme).to_boxed(); let files = ui::files(theme).to_boxed(); let context = ui::context(context, theme, self.patch.clone()).to_boxed(); diff --git a/src/patch/app/ui.rs b/src/patch/app/ui.rs index 4900190d..1e40b9c0 100644 --- a/src/patch/app/ui.rs +++ b/src/patch/app/ui.rs @@ -4,18 +4,19 @@ use tuirealm::command::{Cmd, CmdResult}; use tuirealm::tui::layout::Rect; use tuirealm::{AttrValue, Attribute, Frame, MockComponent, Props, State}; -use radicle_tui::ui::cob; -use radicle_tui::ui::cob::PatchItem; -use radicle_tui::ui::context::Context; -use radicle_tui::ui::layout; -use radicle_tui::ui::theme::Theme; -use radicle_tui::ui::widget::common; -use radicle_tui::ui::widget::{Widget, WidgetComponent}; +use radicle_tui as tui; -use common::container::Tabs; -use common::context::{ContextBar, Progress}; -use common::label::Label; -use common::list::{ColumnWidth, Table}; +use tui::ui::cob; +use tui::ui::cob::PatchItem; +use tui::ui::context::Context; +use tui::ui::layout; +use tui::ui::theme::Theme; +use tui::ui::widget::{Widget, WidgetComponent}; + +use tui::ui::widget::container::Tabs; +use tui::ui::widget::context::{ContextBar, Progress}; +use tui::ui::widget::label::Label; +use tui::ui::widget::list::{ColumnWidth, Table}; pub struct PatchBrowser { items: Vec, @@ -25,14 +26,14 @@ pub struct PatchBrowser { impl PatchBrowser { pub fn new(context: &Context, theme: &Theme, selected: Option<(PatchId, Patch)>) -> Self { let header = [ - common::label(" ● "), - common::label("ID"), - common::label("Title"), - common::label("Author"), - common::label("Head"), - common::label("+"), - common::label("-"), - common::label("Updated"), + tui::ui::label(" ● "), + tui::ui::label("ID"), + tui::ui::label("Title"), + tui::ui::label("Author"), + tui::ui::label("Head"), + tui::ui::label("+"), + tui::ui::label("-"), + tui::ui::label("Updated"), ]; let widths = [ @@ -158,18 +159,18 @@ impl WidgetComponent for Files { } pub fn list_navigation(theme: &Theme) -> Widget { - common::tabs( + tui::ui::tabs( theme, - vec![common::reversable_label("Patches").foreground(theme.colors.tabs_highlighted_fg)], + vec![tui::ui::reversable_label("Patches").foreground(theme.colors.tabs_highlighted_fg)], ) } pub fn navigation(theme: &Theme) -> Widget { - common::tabs( + tui::ui::tabs( theme, vec![ - common::reversable_label("Activity").foreground(theme.colors.tabs_highlighted_fg), - common::reversable_label("Files").foreground(theme.colors.tabs_highlighted_fg), + tui::ui::reversable_label("Activity").foreground(theme.colors.tabs_highlighted_fg), + tui::ui::reversable_label("Files").foreground(theme.colors.tabs_highlighted_fg), ], ) } @@ -183,14 +184,14 @@ pub fn patches( } pub fn activity(theme: &Theme) -> Widget { - let not_implemented = common::label("not implemented").foreground(theme.colors.default_fg); + let not_implemented = tui::ui::label("not implemented").foreground(theme.colors.default_fg); let activity = Activity::new(not_implemented); Widget::new(activity) } pub fn files(theme: &Theme) -> Widget { - let not_implemented = common::label("not implemented").foreground(theme.colors.default_fg); + let not_implemented = tui::ui::label("not implemented").foreground(theme.colors.default_fg); let files = Files::new(not_implemented); Widget::new(files) @@ -206,7 +207,7 @@ pub fn context(context: &Context, theme: &Theme, patch: (PatchId, Patch)) -> Wid let author = cob::format_author(patch.author().id(), is_you); let comments = rev.discussion().len(); - common::context::bar(theme, "Patch", &id, title, &author, &comments.to_string()) + tui::ui::widget::context::bar(theme, "Patch", &id, title, &author, &comments.to_string()) } pub fn browse_context(context: &Context, theme: &Theme, progress: Progress) -> Widget { @@ -230,7 +231,7 @@ pub fn browse_context(context: &Context, theme: &Theme, progress: Progress) -> W } } - common::context::bar( + tui::ui::widget::context::bar( theme, "Browse", "", diff --git a/src/ui.rs b/src/ui.rs index 9e2a9852..75b3dbac 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -6,3 +6,183 @@ pub mod state; pub mod subscription; pub mod theme; pub mod widget; + +use tuirealm::props::{AttrValue, Attribute}; +use tuirealm::MockComponent; + +use widget::container::{ + AppHeader, AppInfo, Container, GlobalListener, Header, LabeledContainer, Popup, Tabs, + VerticalLine, +}; +use widget::context::{Shortcut, Shortcuts}; +use widget::label::{Label, Textarea}; +use widget::list::{ColumnWidth, Property, PropertyList, PropertyTable}; + +use widget::Widget; + +use crate::ui::context::Context; +use crate::ui::theme::Theme; + +pub fn global_listener() -> Widget { + Widget::new(GlobalListener::default()) +} + +pub fn label(content: &str) -> Widget