Skip to content

Commit 0a505ea

Browse files
committed
Fix recursive style implementations
1 parent 83dd113 commit 0a505ea

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/style.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,13 @@ impl button::Catalog for ButtonStyle {
7777
}
7878

7979
fn style(&self, class: &Self::Class<'_>, status: button::Status) -> button::Style {
80-
let active = self.style(class, button::Status::Active);
80+
let active = if button::Status::Active == status {
81+
// Avoid Stack overflow
82+
button::Style::default()
83+
} else {
84+
self.style(class, button::Status::Active)
85+
};
86+
8187
match status {
8288
button::Status::Active => match self {
8389
Self::Icon => button::Style {
@@ -153,7 +159,7 @@ impl container::Catalog for LogContainer {
153159
type Class<'a> = LogContainer;
154160

155161
fn default<'a>() -> Self::Class<'a> {
156-
LogContainer::default()
162+
LogContainer { background: None }
157163
}
158164

159165
fn style(&self, _: &Self::Class<'_>) -> container::Style {
@@ -171,7 +177,7 @@ impl tab_bar::Catalog for CustomTabBar {
171177
type Class<'a> = CustomTabBar;
172178

173179
fn default<'a>() -> Self::Class<'a> {
174-
CustomTabBar::default()
180+
CustomTabBar {}
175181
}
176182

177183
fn style(&self, class: &Self::Class<'_>, status: tab_bar::Status) -> tab_bar::Style {

0 commit comments

Comments
 (0)