Make fade of ignored entries styleable

This commit is contained in:
Antonio Scandurra 2022-05-24 09:12:57 +02:00
parent 85f228dade
commit 138a0b042d
3 changed files with 4 additions and 3 deletions

View file

@ -787,10 +787,9 @@ impl ProjectPanel {
MouseEventHandler::new::<Self, _, _>(entry_id.to_usize(), cx, |state, _| { MouseEventHandler::new::<Self, _, _>(entry_id.to_usize(), cx, |state, _| {
let padding = theme.container.padding.left + details.depth as f32 * theme.indent_width; let padding = theme.container.padding.left + details.depth as f32 * theme.indent_width;
let mut style = theme.entry.style_for(state, details.is_selected).clone(); let mut style = theme.entry.style_for(state, details.is_selected).clone();
// TODO: get style from theme.
if details.is_ignored { if details.is_ignored {
style.text.color.fade_out(0.6); style.text.color.fade_out(theme.ignored_entry_fade);
style.icon_color.fade_out(0.6); style.icon_color.fade_out(theme.ignored_entry_fade);
} }
let row_container_style = if show_editor { let row_container_style = if show_editor {
theme.filename_editor.container theme.filename_editor.container

View file

@ -223,6 +223,7 @@ pub struct ProjectPanel {
#[serde(flatten)] #[serde(flatten)]
pub container: ContainerStyle, pub container: ContainerStyle,
pub entry: Interactive<ProjectPanelEntry>, pub entry: Interactive<ProjectPanelEntry>,
pub ignored_entry_fade: f32,
pub filename_editor: FieldEditor, pub filename_editor: FieldEditor,
pub indent_width: f32, pub indent_width: f32,
} }

View file

@ -26,6 +26,7 @@ export default function projectPanel(theme: Theme) {
text: text(theme, "mono", "active", { size: "sm" }), text: text(theme, "mono", "active", { size: "sm" }),
} }
}, },
ignoredEntryFade: 0.6,
filenameEditor: { filenameEditor: {
background: backgroundColor(theme, 500, "active"), background: backgroundColor(theme, 500, "active"),
text: text(theme, "mono", "primary", { size: "sm" }), text: text(theme, "mono", "primary", { size: "sm" }),