allow customizing color of focused title bar

This commit is contained in:
extrawurst 2024-02-18 12:58:54 +01:00 committed by extrawurst
parent e1f243d8fb
commit f4a7034a9a
3 changed files with 7 additions and 2 deletions

View file

@ -21,6 +21,7 @@ These defaults require some adoption from existing users but feel more natural t
* add confirmation for dialog for undo commit [[@TeFiLeDo](https://github.com/TeFiLeDo)] ([#1912](https://github.com/extrawurst/gitui/issues/1912))
* support `prepare-commit-msg` hook ([#1873](https://github.com/extrawurst/gitui/issues/1873))
* support for new-line in text-input (e.g. commit message editor) [[@pm100]](https://github/pm100) ([#1662](https://github.com/extrawurst/gitui/issues/1662)).
* new style `block_title_focused` to allow customizing title text of focused frame/block ([#2052](https://github.com/extrawurst/gitui/issues/2052)).
### Changed
* do not allow tagging when `tag.gpgsign` enabled until gpg-signing is [supported](https://github.com/extrawurst/gitui/issues/97) [[@TeFiLeDo](https://github.com/TeFiLeDo)] ([#1915](https://github.com/extrawurst/gitui/pull/1915))

View file

@ -1132,7 +1132,7 @@ impl App {
&self.repo_path_text,
text_area.width as usize,
),
self.theme.title(true),
self.theme.title(false),
)]))
.alignment(Alignment::Right),
text_area,

View file

@ -33,6 +33,7 @@ pub struct Theme {
tag_fg: Color,
branch_fg: Color,
line_break: String,
block_title_focused: Color,
}
impl Theme {
@ -50,7 +51,9 @@ impl Theme {
pub fn title(&self, focused: bool) -> Style {
if focused {
Style::default().add_modifier(Modifier::BOLD)
Style::default()
.fg(self.block_title_focused)
.add_modifier(Modifier::BOLD)
} else {
Style::default().fg(self.disabled_fg)
}
@ -342,6 +345,7 @@ impl Default for Theme {
tag_fg: Color::LightMagenta,
branch_fg: Color::LightYellow,
line_break: "".to_string(),
block_title_focused: Color::Reset,
}
}
}