Skip to content

Commit

Permalink
Fixes bdlukaa#105
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-hann committed Dec 3, 2021
1 parent da2436e commit c95ba48
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Date format: DD/MM/YYYY

## [3.4.2] - [DD/MM/YYYY]
## [next] - [DD/MM/YYYY]

- ComboBox's Popup Acrylic can now be disabled if wrapped in a `DisableAcrylic` ([#105](https://github.com/bdlukaa/fluent_ui/issues/105))
- `NavigationPane` width can now be customizable ([#99](https://github.com/bdlukaa/fluent_ui/issues/99))
- Implement `PaneItemAction` for `NavigationPane` ([#104](https://github.com/bdlukaa/fluent_ui/issues/104))

Expand Down
13 changes: 8 additions & 5 deletions lib/src/controls/form/combo_box.dart
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@ class _ComboboxRoute<T> extends PopupRoute<_ComboboxRouteResult<T>> {
this.elevation = 16,
required this.capturedThemes,
required this.style,
required this.acrylicEnabled,
this.barrierLabel,
this.itemHeight,
this.comboboxColor,
Expand All @@ -464,6 +465,7 @@ class _ComboboxRoute<T> extends PopupRoute<_ComboboxRouteResult<T>> {
final TextStyle style;
final double? itemHeight;
final Color? comboboxColor;
final bool acrylicEnabled;

final List<double> itemHeights;
ScrollController? scrollController;
Expand All @@ -481,11 +483,9 @@ class _ComboboxRoute<T> extends PopupRoute<_ComboboxRouteResult<T>> {
final String? barrierLabel;

@override
Widget buildPage(BuildContext context, Animation<double> animation,
Animation<double> secondaryAnimation) {
return LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) {
return _ComboboxRoutePage<T>(
Widget buildPage(context, animation, secondaryAnimation) {
return LayoutBuilder(builder: (context, constraints) {
final page = _ComboboxRoutePage<T>(
route: this,
constraints: constraints,
items: items,
Expand All @@ -497,6 +497,8 @@ class _ComboboxRoute<T> extends PopupRoute<_ComboboxRouteResult<T>> {
style: style,
comboboxColor: comboboxColor,
);
if (acrylicEnabled) return page;
return DisableAcrylic(child: page);
});
}

Expand Down Expand Up @@ -1233,6 +1235,7 @@ class _ComboboxState<T> extends State<Combobox<T>> with WidgetsBindingObserver {
ancestor: navigator.context.findRenderObject()) &
itemBox.size;
_comboboxRoute = _ComboboxRoute<T>(
acrylicEnabled: DisableAcrylic.of(context) != null,
items: menuItems,
buttonRect: menuMargin.resolve(textDirection).inflateRect(itemRect),
padding: _kMenuItemPadding.resolve(textDirection),
Expand Down

0 comments on commit c95ba48

Please # to comment.