-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Introduced `ListThemeConfig` in the theme configuration. - Updated `WidgetThemeConfig` to include `list` themes. - Modified `SingleNamespaceDialog` to accept and apply the new themes. - Added default implementations and builders for `FilterFormTheme` and `ListTheme`. - Updated tests to cover the new theme configurations.
- Loading branch information
Showing
13 changed files
with
400 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
use serde::{Deserialize, Serialize}; | ||
|
||
use super::{BorderThemeConfig, ThemeStyleConfig}; | ||
|
||
#[derive(Default, Debug, Clone, PartialEq, Eq, Deserialize, Serialize)] | ||
pub struct FilterFormThemeConfig { | ||
#[serde(default, skip_serializing_if = "Option::is_none")] | ||
pub base: Option<ThemeStyleConfig>, | ||
|
||
#[serde(default, skip_serializing_if = "Option::is_none")] | ||
pub border: Option<BorderThemeConfig>, | ||
|
||
#[serde(default)] | ||
pub prefix: ThemeStyleConfig, | ||
|
||
#[serde(default)] | ||
pub query: ThemeStyleConfig, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
use ratatui::style::Modifier; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
use super::{FilterFormThemeConfig, ThemeStyleConfig}; | ||
|
||
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)] | ||
pub struct ListThemeConfig { | ||
#[serde(default)] | ||
pub filter: FilterFormThemeConfig, | ||
|
||
#[serde(default = "default_selection")] | ||
pub selection: ThemeStyleConfig, | ||
|
||
#[serde(default)] | ||
pub status: ThemeStyleConfig, | ||
} | ||
|
||
impl Default for ListThemeConfig { | ||
fn default() -> ListThemeConfig { | ||
ListThemeConfig { | ||
selection: default_selection(), | ||
filter: FilterFormThemeConfig::default(), | ||
status: Default::default(), | ||
} | ||
} | ||
} | ||
|
||
fn default_selection() -> ThemeStyleConfig { | ||
ThemeStyleConfig { | ||
modifier: Modifier::REVERSED, | ||
..Default::default() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,9 @@ | ||
use serde::{Deserialize, Serialize}; | ||
|
||
use super::{BorderThemeConfig, ThemeStyleConfig}; | ||
use super::FilterFormThemeConfig; | ||
|
||
#[derive(Default, Debug, Clone, PartialEq, Eq, Deserialize, Serialize)] | ||
pub struct TableThemeConfig { | ||
#[serde(default)] | ||
pub filter: FilterFormThemeConfig, | ||
} | ||
|
||
#[derive(Default, Debug, Clone, PartialEq, Eq, Deserialize, Serialize)] | ||
pub struct FilterFormThemeConfig { | ||
#[serde(default, skip_serializing_if = "Option::is_none")] | ||
pub base: Option<ThemeStyleConfig>, | ||
|
||
#[serde(default, skip_serializing_if = "Option::is_none")] | ||
pub border: Option<BorderThemeConfig>, | ||
|
||
#[serde(default)] | ||
pub prefix: ThemeStyleConfig, | ||
|
||
#[serde(default)] | ||
pub query: ThemeStyleConfig, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.