mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
..
This commit is contained in:
parent
faa3281322
commit
3e0466f552
6 changed files with 119 additions and 54 deletions
|
|
@ -38,7 +38,7 @@ impl<'a> Widget for Input<'a> {
|
||||||
line
|
line
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
.style(THEME.input.text.into())
|
.style(THEME.input.value.into())
|
||||||
.render(area, buf);
|
.render(area, buf);
|
||||||
|
|
||||||
if let Some(Range { start, end }) = input.selected() {
|
if let Some(Range { start, end }) = input.selected() {
|
||||||
|
|
@ -47,7 +47,7 @@ impl<'a> Widget for Input<'a> {
|
||||||
|
|
||||||
buf.set_style(
|
buf.set_style(
|
||||||
Rect { x, y, width: (end - start).min(win.width - x), height: 1.min(win.height - y) },
|
Rect { x, y, width: (end - start).min(win.width - x), height: 1.min(win.height - y) },
|
||||||
THEME.input.visual.into(),
|
THEME.input.selected.into(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ impl<'a> Widget for Layout<'a> {
|
||||||
.map(|(i, v)| {
|
.map(|(i, v)| {
|
||||||
let mut item = ListItem::new(v.name.clone());
|
let mut item = ListItem::new(v.name.clone());
|
||||||
if i == tasks.cursor {
|
if i == tasks.cursor {
|
||||||
item = item.style(THEME.tasks.items.into());
|
item = item.style(THEME.tasks.hovered.into());
|
||||||
}
|
}
|
||||||
item
|
item
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
[tabs]
|
# vim:fileencoding=utf-8:foldmethod=marker
|
||||||
active = { fg = "#1E2031", bg = "#80AEFA" }
|
|
||||||
inactive = { fg = "#C8D3F8", bg = "#484D66" }
|
# : Status {{{
|
||||||
header = { fg = "#00FFFF" }
|
|
||||||
max_width = 1
|
|
||||||
|
|
||||||
[status]
|
[status]
|
||||||
plain = { fg = "#FFFFFF" }
|
plain = { fg = "#FFFFFF" }
|
||||||
|
|
@ -26,6 +24,17 @@ permissions_w = { fg = "#FA7F94" }
|
||||||
permissions_x = { fg = "#7AD9E5" }
|
permissions_x = { fg = "#7AD9E5" }
|
||||||
permissions_s = { fg = "#6D738F" }
|
permissions_s = { fg = "#6D738F" }
|
||||||
|
|
||||||
|
# : }}}
|
||||||
|
|
||||||
|
|
||||||
|
# : Manager {{{
|
||||||
|
|
||||||
|
[tabs]
|
||||||
|
active = { fg = "#1E2031", bg = "#80AEFA" }
|
||||||
|
inactive = { fg = "#C8D3F8", bg = "#484D66" }
|
||||||
|
header = { fg = "#00FFFF" }
|
||||||
|
max_width = 1
|
||||||
|
|
||||||
[files]
|
[files]
|
||||||
hovered = { fg = "#1E2031", bg = "#80AEFA" }
|
hovered = { fg = "#1E2031", bg = "#80AEFA" }
|
||||||
|
|
||||||
|
|
@ -34,16 +43,17 @@ selected = { fg = "#97DC8D", bg = "#97DC8D" }
|
||||||
copied = { fg = "#F3D398", bg = "#F3D398" }
|
copied = { fg = "#F3D398", bg = "#F3D398" }
|
||||||
cut = { fg = "#FF84A9", bg = "#FF84A9" }
|
cut = { fg = "#FF84A9", bg = "#FF84A9" }
|
||||||
|
|
||||||
|
[find]
|
||||||
|
# arrow = { fg = "LightYellow", italic = true }
|
||||||
|
|
||||||
[preview]
|
[preview]
|
||||||
hovered = { underline = true }
|
hovered = { underline = true }
|
||||||
syntect_theme = "~/.config/bat/themes/Catppuccin-macchiato.tmTheme"
|
syntect_theme = "~/.config/bat/themes/Catppuccin-macchiato.tmTheme"
|
||||||
|
|
||||||
[help]
|
# : }}}
|
||||||
key = { fg = "#E5E510" }
|
|
||||||
exec = { fg = "#11A8CD" }
|
|
||||||
desc = { fg = "#E5E5E5" }
|
# : File-specific styles {{{
|
||||||
curr = { bg = "#666666", bold = true }
|
|
||||||
btm = { fg = "#666666", bg = "#E5E5E5" }
|
|
||||||
|
|
||||||
[filetype]
|
[filetype]
|
||||||
|
|
||||||
|
|
@ -163,3 +173,60 @@ rules = [
|
||||||
# Default
|
# Default
|
||||||
"*" = ""
|
"*" = ""
|
||||||
"*/" = ""
|
"*/" = ""
|
||||||
|
|
||||||
|
# : }}}
|
||||||
|
|
||||||
|
|
||||||
|
# : Input {{{
|
||||||
|
|
||||||
|
[input]
|
||||||
|
border = { fg = "blue" }
|
||||||
|
title = { fg = "white" }
|
||||||
|
value = { fg = "white" }
|
||||||
|
selected = { fg = "darkGray" }
|
||||||
|
|
||||||
|
# : }}}
|
||||||
|
|
||||||
|
|
||||||
|
# : Select {{{
|
||||||
|
|
||||||
|
[select]
|
||||||
|
border = { fg = "blue" }
|
||||||
|
active = { fg = "magenta" }
|
||||||
|
inactive = { fg = "white" }
|
||||||
|
|
||||||
|
# : }}}
|
||||||
|
|
||||||
|
|
||||||
|
# : Tasks {{{
|
||||||
|
|
||||||
|
[tasks]
|
||||||
|
border = { fg = "blue" }
|
||||||
|
title = { fg = "white" }
|
||||||
|
hovered = { underline = true }
|
||||||
|
|
||||||
|
# : }}}
|
||||||
|
|
||||||
|
|
||||||
|
# : Which {{{
|
||||||
|
|
||||||
|
[which]
|
||||||
|
# block = { bg = "Black" }
|
||||||
|
# key = { fg = "LightCyan" }
|
||||||
|
# extend = { fg = "DarkGray" }
|
||||||
|
# desc = { fg = "Magenta" }
|
||||||
|
# separator = { separator = " -> ", color = "DarkGray" }
|
||||||
|
|
||||||
|
# : }}}
|
||||||
|
|
||||||
|
|
||||||
|
# : Help {{{
|
||||||
|
|
||||||
|
[help]
|
||||||
|
# key = { fg = "#E5E510" }
|
||||||
|
# exec = { fg = "#11A8CD" }
|
||||||
|
# desc = { fg = "#E5E5E5" }
|
||||||
|
# curr = { bg = "#666666", bold = true }
|
||||||
|
# btm = { fg = "#666666", bg = "#E5E5E5" }
|
||||||
|
|
||||||
|
# : }}}
|
||||||
|
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
use serde::{Deserialize, Serialize};
|
|
||||||
|
|
||||||
use super::Style;
|
|
||||||
|
|
||||||
#[derive(Deserialize, Serialize)]
|
|
||||||
pub struct Files {
|
|
||||||
pub hovered: Style,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Deserialize, Serialize)]
|
|
||||||
pub struct Marker {
|
|
||||||
pub selected: Style,
|
|
||||||
pub copied: Style,
|
|
||||||
pub cut: Style,
|
|
||||||
}
|
|
||||||
|
|
@ -1,15 +1,25 @@
|
||||||
mod color;
|
mod color;
|
||||||
mod filetype;
|
mod filetype;
|
||||||
|
mod help;
|
||||||
mod icon;
|
mod icon;
|
||||||
mod list;
|
mod input;
|
||||||
|
mod manager;
|
||||||
|
mod select;
|
||||||
mod status;
|
mod status;
|
||||||
mod style;
|
mod style;
|
||||||
|
mod tasks;
|
||||||
mod theme;
|
mod theme;
|
||||||
|
mod which;
|
||||||
|
|
||||||
pub use color::*;
|
pub use color::*;
|
||||||
pub use filetype::*;
|
pub use filetype::*;
|
||||||
|
pub use help::*;
|
||||||
pub use icon::*;
|
pub use icon::*;
|
||||||
pub use list::*;
|
pub use input::*;
|
||||||
|
pub use manager::*;
|
||||||
|
pub use select::*;
|
||||||
pub use status::*;
|
pub use status::*;
|
||||||
pub use style::*;
|
pub use style::*;
|
||||||
|
pub use tasks::*;
|
||||||
pub use theme::*;
|
pub use theme::*;
|
||||||
|
pub use which::*;
|
||||||
|
|
|
||||||
|
|
@ -1,38 +1,41 @@
|
||||||
use std::path::PathBuf;
|
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use shared::expand_path;
|
use shared::expand_path;
|
||||||
use validator::Validate;
|
use validator::Validate;
|
||||||
|
|
||||||
use super::{Files, Filetype, Icon, Marker, Status, Style};
|
use super::{Files, Filetype, Help, Icon, Input, Marker, Preview, Select, Status, Tabs, Tasks, Which};
|
||||||
use crate::{validation::check_validation, MERGED_THEME};
|
use crate::{validation::check_validation, MERGED_THEME};
|
||||||
|
|
||||||
#[derive(Deserialize, Serialize, Validate)]
|
|
||||||
pub struct Tabs {
|
|
||||||
pub active: Style,
|
|
||||||
pub inactive: Style,
|
|
||||||
pub header: Style,
|
|
||||||
#[validate(range(min = 1, message = "Must be greater than 0"))]
|
|
||||||
pub max_width: u8,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Deserialize, Serialize)]
|
|
||||||
pub struct Preview {
|
|
||||||
pub hovered: Style,
|
|
||||||
pub syntect_theme: PathBuf,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Deserialize, Serialize)]
|
#[derive(Deserialize, Serialize)]
|
||||||
pub struct Theme {
|
pub struct Theme {
|
||||||
pub tabs: Tabs,
|
// Status
|
||||||
pub status: Status,
|
pub status: Status,
|
||||||
|
|
||||||
|
// Manager
|
||||||
|
pub tabs: Tabs,
|
||||||
pub files: Files,
|
pub files: Files,
|
||||||
pub marker: Marker,
|
pub marker: Marker,
|
||||||
pub preview: Preview,
|
pub preview: Preview,
|
||||||
|
|
||||||
|
// File-specific styles
|
||||||
#[serde(rename = "filetype", deserialize_with = "Filetype::deserialize", skip_serializing)]
|
#[serde(rename = "filetype", deserialize_with = "Filetype::deserialize", skip_serializing)]
|
||||||
pub filetypes: Vec<Filetype>,
|
pub filetypes: Vec<Filetype>,
|
||||||
#[serde(deserialize_with = "Icon::deserialize", skip_serializing)]
|
#[serde(deserialize_with = "Icon::deserialize", skip_serializing)]
|
||||||
pub icons: Vec<Icon>,
|
pub icons: Vec<Icon>,
|
||||||
|
|
||||||
|
// Input
|
||||||
|
pub input: Input,
|
||||||
|
|
||||||
|
// Select
|
||||||
|
pub select: Select,
|
||||||
|
|
||||||
|
// Tasks
|
||||||
|
pub tasks: Tasks,
|
||||||
|
|
||||||
|
// Which
|
||||||
|
pub which: Which,
|
||||||
|
|
||||||
|
// Help
|
||||||
|
pub help: Help,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for Theme {
|
impl Default for Theme {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue