Skip to content

Commit

Permalink
Do not show PaneItem.infoBadge and PaneItem.trailing while the pa…
Browse files Browse the repository at this point in the history
…ne is transitioning (#906)

and fix `NavigationPane.header`
  • Loading branch information
bdlukaa committed Jul 31, 2023
1 parent 82ed4ca commit aa25d4e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- Added `Tab.disabled` ([#904](https://github.com/bdlukaa/fluent_ui/issues/904))
- Correctly remove tooltip as soon as the mouse leaves the widget ([#905](https://github.com/bdlukaa/fluent_ui/issues/905))
- Add `NavigationPaneThemeData.overlayBackgroundColor`, which is displayed on overlays, such as minimal and compact pane overlays ([#903](https://github.com/bdlukaa/fluent_ui/pull/903))
- Do not show `PaneItem.infoBadge` and `PaneItem.trailing` while the pane is transitioning ([#906](https://github.com/bdlukaa/fluent_ui/issues/906))

## 4.7.1

Expand Down
1 change: 1 addition & 0 deletions lib/src/controls/navigation/navigation_view/pane.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1308,6 +1308,7 @@ class _OpenNavigationPaneState extends State<_OpenNavigationPane>
),
child: DefaultTextStyle.merge(
style: theme.itemHeaderTextStyle,
maxLines: 1,
child: widget.pane.header!,
),
),
Expand Down
24 changes: 14 additions & 10 deletions lib/src/controls/navigation/navigation_view/pane_items.dart
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@ class PaneItem extends NavigationPaneItem {
);
case PaneDisplayMode.minimal:
case PaneDisplayMode.open:
final shouldShowTrailing = !(maybeBody?.isTransitioning ?? false);

return ConstrainedBox(
key: itemKey,
constraints: const BoxConstraints(
Expand All @@ -250,16 +252,18 @@ class PaneItem extends NavigationPaneItem {
),
),
Expanded(child: textResult),
if (infoBadge != null)
Padding(
padding: const EdgeInsetsDirectional.only(end: 8.0),
child: infoBadge!,
),
if (trailing != null)
IconTheme.merge(
data: const IconThemeData(size: 16.0),
child: trailing!,
),
if (shouldShowTrailing) ...[
if (infoBadge != null)
Padding(
padding: const EdgeInsetsDirectional.only(end: 8.0),
child: infoBadge!,
),
if (trailing != null)
IconTheme.merge(
data: const IconThemeData(size: 16.0),
child: trailing!,
),
],
]),
);
case PaneDisplayMode.top:
Expand Down
2 changes: 0 additions & 2 deletions lib/src/controls/navigation/navigation_view/view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,6 @@ class NavigationViewState extends State<NavigationView> {
return minimalLeading;
}

print(_isTransitioning);

return LayoutBuilder(builder: (context, consts) {
var displayMode = widget.pane?.displayMode ?? PaneDisplayMode.auto;

Expand Down

0 comments on commit aa25d4e

Please # to comment.