Skip to content

Commit

Permalink
fix(config): merge highlight styles into Home section
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-thevenet committed Nov 24, 2024
1 parent 8cf398b commit ada558e
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 20 deletions.
8 changes: 2 additions & 6 deletions .config/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,11 @@
"<Right>" = "Right"

[styles.Explorer]
highlighted_entry = "dark grey on rgb 255 153 000"
highlighted_searchbar = "rgb 255 153 000"
preview_headers = "bold rgb 255 153 000"

[styles.Filter]
highlighted_searchbar = "rgb 255 153 000"

[styles.Home]
highlighted_tab = "dark grey on rgb 255 153 000"
highlighted_style = "dark grey on rgb 255 153 000"
highlighted_bar_style = "rgb 255 153 000"

[tasks_config]
use_american_format = true
Expand Down
12 changes: 6 additions & 6 deletions src/components/explorer_tab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,9 @@ impl<'a> ExplorerTab<'a> {
*self
.config
.styles
.get(&crate::app::Mode::Explorer)
.get(&crate::app::Mode::Home)
.unwrap()
.get("highlighted_searchbar")
.get("highlighted_bar_style")
.unwrap()
} else {
Style::new()
Expand Down Expand Up @@ -429,9 +429,9 @@ impl<'a> ExplorerTab<'a> {
*self
.config
.styles
.get(&crate::app::Mode::Explorer)
.get(&crate::app::Mode::Home)
.unwrap()
.get("highlighted_searchbar")
.get("highlighted_bar_style")
.unwrap(),
),
);
Expand Down Expand Up @@ -661,9 +661,9 @@ impl<'a> Component for ExplorerTab<'a> {
let highlighted_style = *self
.config
.styles
.get(&crate::app::Mode::Explorer)
.get(&crate::app::Mode::Home)
.unwrap()
.get("highlighted_entry")
.get("highlighted_style")
.unwrap();

// Left Block
Expand Down
6 changes: 3 additions & 3 deletions src/components/filter_tab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ impl<'a> FilterTab<'a> {
.styles
.get(&crate::app::Mode::Home)
.unwrap()
.get("highlighted_tab")
.get("highlighted_style")
.unwrap();

let selected_tab_index = self.sorting_mode as usize;
Expand Down Expand Up @@ -253,9 +253,9 @@ impl<'a> Component for FilterTab<'a> {
*self
.config
.styles
.get(&crate::app::Mode::Filter)
.get(&crate::app::Mode::Home)
.unwrap()
.get("highlighted_searchbar")
.get("highlighted_bar_style")
.unwrap()
} else {
Style::new()
Expand Down
2 changes: 1 addition & 1 deletion src/components/home.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ impl Home {
.styles
.get(&crate::app::Mode::Home)
.unwrap()
.get("highlighted_tab")
.get("highlighted_style")
.unwrap();

let selected_tab_index = self.selected_tab as usize;
Expand Down
8 changes: 4 additions & 4 deletions src/components/time_management_tab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ impl<'a> TimeManagementTab<'a> {
.styles
.get(&crate::app::Mode::Home)
.unwrap()
.get("highlighted_tab")
.get("highlighted_style")
.unwrap();

let items: Vec<ListItem> = MethodsAvailable::iter()
Expand Down Expand Up @@ -395,9 +395,9 @@ impl<'a> TimeManagementTab<'a> {
*self
.config
.styles
.get(&crate::app::Mode::Explorer)
.get(&crate::app::Mode::Home)
.unwrap()
.get("highlighted_searchbar")
.get("highlighted_bar_style")
.unwrap(),
),
);
Expand Down Expand Up @@ -439,7 +439,7 @@ impl<'a> TimeManagementTab<'a> {
.styles
.get(&crate::app::Mode::Home)
.unwrap()
.get("highlighted_tab")
.get("highlighted_style")
.unwrap();

StatefulWidget::render(
Expand Down

0 comments on commit ada558e

Please sign in to comment.