Add `Nothing` layout config inheritance workaround

Any layouts will default to `Nothing` which resembles blank screen.
However, they will be overwritten when there is a more specific layout
available either in the super config or in the sub config.
pull/126/head
Arijit Basu 3 years ago committed by Arijit Basu
parent b3e6679b50
commit b8df831248

@ -1045,6 +1045,7 @@ impl LayoutOptions {
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub enum Layout {
Nothing,
Table,
InputAndLogs,
Selection,
@ -1062,7 +1063,7 @@ pub enum Layout {
impl Default for Layout {
fn default() -> Self {
Self::Table
Self::Nothing
}
}
@ -1096,6 +1097,7 @@ impl Layout {
config: sc.extend(oc),
splits: os,
},
(s, Self::Nothing) => s,
(_, other) => other,
}
}

@ -1,5 +1,6 @@
version: v0.6.0
layouts:
custom: {}
builtin:
default:
Horizontal:

@ -534,6 +534,7 @@ pub fn draw_layout<B: Backend>(
hb: &Handlebars,
) {
match layout {
Layout::Nothing => {}
Layout::Table => draw_table(f, rect, app, hb),
Layout::SortAndFilter => draw_sort_n_filter(f, rect, app, hb),
Layout::HelpMenu => draw_help_menu(f, rect, app, hb),

Loading…
Cancel
Save