Skip to content

Commit

Permalink
Bugfix: use View style rather than Primary in ThemedView
Browse files Browse the repository at this point in the history
  • Loading branch information
gyscos committed Sep 29, 2023
1 parent 5885af0 commit 7a7d586
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cursive-core/src/views/themed_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ impl<T: View> ViewWrapper for ThemedView<T> {
wrap_impl!(self.view: T);

fn wrap_draw(&self, printer: &crate::Printer) {
// Hack: We need to re-apply the Primary style.
// Hack: We need to re-apply the View (+Primary) style.
//
// InheritParent would not be enough because it re-uses the previous _concrete color_
// (after the theme is applied), so it would not pick up the theme new colors.
// Ideally we would need to know the previous _StyleType_ (before the theme is applied),
// but that's not easy for now.
printer
.theme(&self.theme)
.with_style(crate::theme::PaletteStyle::Primary, |printer| {
.with_style(crate::theme::PaletteStyle::View, |printer| {
self.view.draw(printer);
});
}
Expand Down

0 comments on commit 7a7d586

Please sign in to comment.