Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow customizing color of focused title bar #2054

Merged
merged 1 commit into from
Feb 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 5 additions & 1 deletion src/ui/style.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ pub struct Theme {
tag_fg: Color,
branch_fg: Color,
line_break: String,
block_title_focused: Color,
}

impl Theme {
Expand All @@ -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)
}
Expand Down Expand Up @@ -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,
}
}
}
Expand Down
Loading