mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
merge select into THEME system: opener <-> select
This commit is contained in:
parent
7a2384934d
commit
ca9d77b6a2
1 changed files with 6 additions and 5 deletions
|
|
@ -1,6 +1,7 @@
|
|||
use core::Ctx;
|
||||
use config::THEME;
|
||||
use ratatui::{buffer::Buffer, layout::Rect, widgets::{Block, BorderType, Borders, Clear, List, ListItem, Widget}};
|
||||
|
||||
use ratatui::{buffer::Buffer, layout::Rect, style::{Color, Style}, widgets::{Block, BorderType, Borders, Clear, List, ListItem, Widget}};
|
||||
use crate::Ctx;
|
||||
|
||||
pub(crate) struct Select<'a> {
|
||||
cx: &'a Ctx,
|
||||
|
|
@ -21,10 +22,10 @@ impl<'a> Widget for Select<'a> {
|
|||
.enumerate()
|
||||
.map(|(i, v)| {
|
||||
if i != select.rel_cursor() {
|
||||
return ListItem::new(format!(" {v}"));
|
||||
return ListItem::new(format!(" {v}")).style(THEME.opener.inactive.get());
|
||||
}
|
||||
|
||||
ListItem::new(format!(" {v}")).style(Style::new().fg(Color::Magenta))
|
||||
ListItem::new(format!(" {v}")).style(THEME.opener.active.get())
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
|
|
@ -35,7 +36,7 @@ impl<'a> Widget for Select<'a> {
|
|||
.title(select.title())
|
||||
.borders(Borders::ALL)
|
||||
.border_type(BorderType::Rounded)
|
||||
.border_style(Style::new().fg(Color::Blue)),
|
||||
.border_style(THEME.opener.border.get()),
|
||||
)
|
||||
.render(area, buf);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue