mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
..
This commit is contained in:
parent
6bdb7b9e04
commit
442bb1a5d0
3 changed files with 8 additions and 2 deletions
|
|
@ -19,6 +19,12 @@ impl<'a> Folder<'a> {
|
||||||
Self { cx, folder, is_preview: false, is_selection: false, is_find: false }
|
Self { cx, folder, is_preview: false, is_selection: false, is_find: false }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
|
pub(super) fn with_preview(mut self, state: bool) -> Self {
|
||||||
|
self.is_preview = state;
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub(super) fn with_selection(mut self, state: bool) -> Self {
|
pub(super) fn with_selection(mut self, state: bool) -> Self {
|
||||||
self.is_selection = state;
|
self.is_selection = state;
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ use config::MANAGER;
|
||||||
use ratatui::{buffer::Buffer, layout::{self, Constraint, Direction, Rect}, widgets::{Block, Borders, Padding, Widget}};
|
use ratatui::{buffer::Buffer, layout::{self, Constraint, Direction, Rect}, widgets::{Block, Borders, Padding, Widget}};
|
||||||
|
|
||||||
use super::{Folder, Preview};
|
use super::{Folder, Preview};
|
||||||
use crate::context::Ctx;
|
use crate::Ctx;
|
||||||
|
|
||||||
pub(crate) struct Layout<'a> {
|
pub(crate) struct Layout<'a> {
|
||||||
cx: &'a Ctx,
|
cx: &'a Ctx,
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ impl<'a> Widget for Preview<'a> {
|
||||||
match &preview.lock.as_ref().unwrap().data {
|
match &preview.lock.as_ref().unwrap().data {
|
||||||
PreviewData::Folder => {
|
PreviewData::Folder => {
|
||||||
if let Some(folder) = manager.active().history(hovered) {
|
if let Some(folder) = manager.active().history(hovered) {
|
||||||
Folder::new(self.cx, folder).render(area, buf);
|
Folder::new(self.cx, folder).with_preview(true).render(area, buf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PreviewData::Text(s) => {
|
PreviewData::Text(s) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue