mirror of
https://github.com/alexpasmantier/television.git
synced 2025-06-03 01:50:12 +00:00
fix(layout): double check whether preview is enabled (#499)
This commit is contained in:
parent
2b2654b6aa
commit
cd33151bac
@ -179,12 +179,14 @@ impl Ord for Ctx {
|
||||
/// This layout can then be sent back to the main thread to serve for tasks where having that
|
||||
/// information can be useful or lead to optimizations.
|
||||
pub fn draw(ctx: &Ctx, f: &mut Frame<'_>, area: Rect) -> Result<Layout> {
|
||||
let show_preview =
|
||||
ctx.config.ui.show_preview_panel && ctx.tv_state.preview_state.enabled;
|
||||
let show_remote = !matches!(ctx.tv_state.mode, Mode::Channel);
|
||||
|
||||
let layout =
|
||||
Layout::build(area, &ctx.config.ui, show_remote, show_preview);
|
||||
let layout = Layout::build(
|
||||
area,
|
||||
&ctx.config.ui,
|
||||
show_remote,
|
||||
ctx.tv_state.preview_state.enabled,
|
||||
);
|
||||
|
||||
// help bar (metadata, keymaps, logo)
|
||||
draw_help_bar(
|
||||
|
@ -140,7 +140,6 @@ impl Layout {
|
||||
ui_config: &UiConfig,
|
||||
show_remote: bool,
|
||||
show_preview: bool,
|
||||
//
|
||||
) -> Self {
|
||||
let show_preview = show_preview && ui_config.show_preview_panel;
|
||||
let dimensions = Dimensions::from(ui_config.ui_scale);
|
||||
|
Loading…
x
Reference in New Issue
Block a user