mirror of
https://seed.radicle.dev/rad:z39mP9rQAaGmERfUMPULfPUi473tY.git
synced 2026-11-29 22:40:29 +08:00
patch-list: Simplify layout
This commit is contained in:
@@ -11,17 +11,15 @@ use anyhow::Result;
|
||||
|
||||
use radicle::cob::patch::PatchId;
|
||||
|
||||
use tui::Exit;
|
||||
use tuirealm::application::PollStrategy;
|
||||
use tuirealm::{Application, Frame, NoUserEvent, Sub, SubClause};
|
||||
|
||||
use radicle_tui as tui;
|
||||
|
||||
use radicle_tui::context::Context;
|
||||
use radicle_tui::ui::subscription;
|
||||
use radicle_tui::ui::theme::{self, Theme};
|
||||
use radicle_tui::PageStack;
|
||||
use radicle_tui::Tui;
|
||||
use tui::context::Context;
|
||||
use tui::ui::subscription;
|
||||
use tui::ui::theme::{self, Theme};
|
||||
use tui::{Exit, PageStack, Tui};
|
||||
|
||||
use page::ListView;
|
||||
|
||||
|
||||
@@ -129,10 +129,8 @@ impl ViewPage<Cid, Message> for ListView {
|
||||
|
||||
fn view(&mut self, app: &mut Application<Cid, Message, NoUserEvent>, frame: &mut Frame) {
|
||||
let area = frame.size();
|
||||
let shortcuts_h = 1u16;
|
||||
let layout = layout::default_page(area, shortcuts_h);
|
||||
let layout = layout::default_page(area);
|
||||
|
||||
app.view(&Cid::List(ListCid::Header), frame, layout.navigation);
|
||||
app.view(
|
||||
&Cid::List(self.active_component.clone()),
|
||||
frame,
|
||||
@@ -140,7 +138,6 @@ impl ViewPage<Cid, Message> for ListView {
|
||||
);
|
||||
|
||||
app.view(&Cid::List(ListCid::Context), frame, layout.context);
|
||||
app.view(&Cid::List(ListCid::Shortcuts), frame, layout.shortcuts);
|
||||
}
|
||||
|
||||
fn subscribe(&self, app: &mut Application<Cid, Message, NoUserEvent>) -> Result<()> {
|
||||
|
||||
@@ -131,7 +131,7 @@ pub fn browse_context(context: &Context, theme: &Theme, progress: Progress) -> W
|
||||
|
||||
tui::ui::widget::context::bar(
|
||||
theme,
|
||||
"Browse",
|
||||
"Patches",
|
||||
"",
|
||||
"",
|
||||
&format!("{draft} draft | {open} open | {archived} archived | {merged} merged"),
|
||||
|
||||
@@ -132,7 +132,7 @@ impl ViewPage<Cid, Message> for ListView {
|
||||
fn view(&mut self, app: &mut Application<Cid, Message, NoUserEvent>, frame: &mut Frame) {
|
||||
let area = frame.size();
|
||||
let shortcuts_h = 1u16;
|
||||
let layout = layout::default_page(area, shortcuts_h);
|
||||
let layout = layout::full_page(area, shortcuts_h);
|
||||
|
||||
app.view(&Cid::List(ListCid::Header), frame, layout.navigation);
|
||||
app.view(
|
||||
@@ -284,7 +284,7 @@ impl ViewPage<Cid, Message> for PatchView {
|
||||
fn view(&mut self, app: &mut Application<Cid, Message, NoUserEvent>, frame: &mut Frame) {
|
||||
let area = frame.size();
|
||||
let shortcuts_h = 1u16;
|
||||
let layout = layout::default_page(area, shortcuts_h);
|
||||
let layout = layout::full_page(area, shortcuts_h);
|
||||
|
||||
app.view(&Cid::Patch(PatchCid::Header), frame, layout.navigation);
|
||||
app.view(
|
||||
|
||||
Reference in New Issue
Block a user