Skip to content
New issue

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

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

Already on GitHub? # to your account

Add NavigationView Popup Color #903

Closed
wants to merge 1 commit into from
Closed
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 @@ -10,6 +10,7 @@
- Added `FluentThemeData.selectionColor`, which defaults to the accent color normal shade ([#897](https://github.com/bdlukaa/fluent_ui/issues/897))
- Flyout reverse transition duration is properly set ([#893](https://github.com/bdlukaa/fluent_ui/issues/893))
- Remove view padding when app bar is provided ([#884](https://github.com/bdlukaa/fluent_ui/issues/884))
- Added `NavigationPaneThemeData.popupBackgroundColor`, which defaults to the black color normal shade

## 4.7.0

Expand Down
8 changes: 8 additions & 0 deletions lib/src/controls/navigation/navigation_view/style.dart
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ class NavigationPaneThemeData with Diagnosticable {
/// is used.
final Color? backgroundColor;

/// The minimal pane background color. If null, [Colors.black]
/// is used.
final Color? popupBackgroundColor;

/// The color of the tiles. If null, [ButtonThemeData.uncheckedInputColor]
/// is used
final ButtonState<Color?>? tileColor;
Expand Down Expand Up @@ -115,6 +119,7 @@ class NavigationPaneThemeData with Diagnosticable {

const NavigationPaneThemeData({
this.backgroundColor,
this.popupBackgroundColor,
this.tileColor,
this.highlightColor,
this.labelPadding,
Expand Down Expand Up @@ -201,6 +206,7 @@ class NavigationPaneThemeData with Diagnosticable {
EdgeInsetsGeometry.lerp(a?.headerPadding, b?.headerPadding, t),
tileColor: ButtonState.lerp(a?.tileColor, b?.tileColor, t, Color.lerp),
backgroundColor: Color.lerp(a?.backgroundColor, b?.backgroundColor, t),
popupBackgroundColor: Color.lerp(a?.popupBackgroundColor, b?.popupBackgroundColor, t),
itemHeaderTextStyle:
TextStyle.lerp(a?.itemHeaderTextStyle, b?.itemHeaderTextStyle, t),
selectedTextStyle: ButtonState.lerp(
Expand Down Expand Up @@ -229,6 +235,7 @@ class NavigationPaneThemeData with Diagnosticable {
headerPadding: style?.headerPadding ?? headerPadding,
tileColor: style?.tileColor ?? tileColor,
backgroundColor: style?.backgroundColor ?? backgroundColor,
popupBackgroundColor: style?.popupBackgroundColor ?? popupBackgroundColor,
itemHeaderTextStyle: style?.itemHeaderTextStyle ?? itemHeaderTextStyle,
selectedTextStyle: style?.selectedTextStyle ?? selectedTextStyle,
unselectedTextStyle: style?.unselectedTextStyle ?? unselectedTextStyle,
Expand All @@ -249,6 +256,7 @@ class NavigationPaneThemeData with Diagnosticable {
properties
..add(DiagnosticsProperty('tileColor', tileColor))
..add(ColorProperty('backgroundColor', backgroundColor))
..add(ColorProperty('popupBackgroundColor', popupBackgroundColor))
..add(ColorProperty('highlightColor', highlightColor))
..add(
DiagnosticsProperty<EdgeInsetsGeometry>('labelPadding', labelPadding))
Expand Down
2 changes: 1 addition & 1 deletion lib/src/controls/navigation/navigation_view/view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ class NavigationViewState extends State<NavigationView> {
height: MediaQuery.sizeOf(context).height,
child: PaneScrollConfiguration(
child: ColoredBox(
color: Colors.black,
color: theme.popupBackgroundColor ?? Colors.black,
child: Mica(
backgroundColor: overlayBackgroundColor(),
child: Container(
Expand Down