Skip to content

YaruWindowTitleBar does not use custom ThemeData colors for focused background #1008

@PsychotherapistSam

Description

@PsychotherapistSam

Hi!

When using a custom dark theme (not based on yaru's default light/dark surface colors), the YaruWindowTitleBar does not pick up my theme's color for the focused background. Instead, it always uses the hardcoded YaruColors.titleBarDark or YaruColors.titleBarLight.

See here:

final defaultBackgroundColor = WidgetStateProperty.resolveWith((states) {
if (!states.contains(WidgetState.focused)) {
return theme.colorScheme.surface;
}
return light ? YaruColors.titleBarLight : YaruColors.titleBarDark;
});

Is this intended? If not, could the title bar be adjusted to use the current ThemeData by default, so it works better with custom color themes?

I also noticed that when setting the backgroundColor property on YaruWindowTitleBar, it does override the internal focus logic and applies the same color for both the focused and the unfocused states. It would be nice if there were a way to provide different colors for both states, or for the widget to use the theme’s color scheme by default.

This would make it so much easier to integrate with custom themes.

Thanks! :)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions