Skip to content

Commit

Permalink
fix(themes): Restore default theme, refactor (atuinsh#2294)
Browse files Browse the repository at this point in the history
* fix(theme): let the base colour remain unchanged

* fix(theme): split out default

* fix(theme): make base theme 'default' not an empty string

* wip(theme): return styles, not colors

* wip(theme): tidy up module structure a little

* wip(theme): removed unhandled references to foreground_color

* chore: fix cargo fmt

* feat(theme): allow crossterm-deserializable colors
  • Loading branch information
philtweir authored Jul 23, 2024
1 parent 95cef71 commit 17ed668
Show file tree
Hide file tree
Showing 7 changed files with 246 additions and 117 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/atuin-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ indicatif = "0.17.7"
tiny-bip39 = "1"

# theme
crossterm = "0.27.0"
crossterm = { version = "0.27.0", features = ["serde"] }
palette = { version = "0.7.5", features = ["serializing"] }
lazy_static = "1.4.0"
strum_macros = "0.26.3"
Expand Down
2 changes: 1 addition & 1 deletion crates/atuin-client/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ records = true

# [theme]
## Color theme to use for rendering in the terminal.
## There are some built-in themes, including the base theme which has the default colors,
## There are some built-in themes, including the base theme ("default"),
## "autumn" and "marine". You can add your own themes to the "./themes" subdirectory of your
## Atuin config (or ATUIN_THEME_DIR, if provided) as TOML files whose keys should be one or
## more of AlertInfo, AlertWarn, AlertError, Annotation, Base, Guidance, Important, and
Expand Down
4 changes: 2 additions & 2 deletions crates/atuin-client/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ pub struct Preview {

#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct Theme {
/// Name of desired theme ("" for base)
/// Name of desired theme ("default" for base)
pub name: String,

/// Whether any available additional theme debug should be shown
Expand Down Expand Up @@ -756,7 +756,7 @@ impl Settings {
.set_default("daemon.socket_path", socket_path.to_str())?
.set_default("daemon.systemd_socket", false)?
.set_default("daemon.tcp_port", 8889)?
.set_default("theme.name", "")?
.set_default("theme.name", "default")?
.set_default("theme.debug", None::<bool>)?
.set_default(
"prefers_reduced_motion",
Expand Down
Loading

0 comments on commit 17ed668

Please sign in to comment.