chore: add more space between font item and font menu

This commit is contained in:
Lucas.Xu 2023-09-22 13:53:14 +08:00
parent d5f8ce5435
commit 5dfc470873
3 changed files with 8 additions and 1 deletions

View File

@ -16,6 +16,7 @@ final customizeFontToolbarItem = ToolbarItem(
cursor: SystemMouseCursors.click, cursor: SystemMouseCursors.click,
child: FontFamilyDropDown( child: FontFamilyDropDown(
currentFontFamily: '', currentFontFamily: '',
offset: const Offset(0, 12),
popoverController: popoverController, popoverController: popoverController,
onOpen: () => keepEditorFocusNotifier.value += 1, onOpen: () => keepEditorFocusNotifier.value += 1,
onClose: () => keepEditorFocusNotifier.value -= 1, onClose: () => keepEditorFocusNotifier.value -= 1,

View File

@ -60,6 +60,7 @@ class FontFamilyDropDown extends StatefulWidget {
this.onFontFamilyChanged, this.onFontFamilyChanged,
this.child, this.child,
this.popoverController, this.popoverController,
this.offset,
}); });
final String currentFontFamily; final String currentFontFamily;
@ -68,6 +69,7 @@ class FontFamilyDropDown extends StatefulWidget {
final void Function(String fontFamily)? onFontFamilyChanged; final void Function(String fontFamily)? onFontFamilyChanged;
final Widget? child; final Widget? child;
final PopoverController? popoverController; final PopoverController? popoverController;
final Offset? offset;
@override @override
State<FontFamilyDropDown> createState() => _FontFamilyDropDownState(); State<FontFamilyDropDown> createState() => _FontFamilyDropDownState();
@ -87,6 +89,7 @@ class _FontFamilyDropDownState extends State<FontFamilyDropDown> {
query.value = ''; query.value = '';
widget.onClose?.call(); widget.onClose?.call();
}, },
offset: widget.offset,
child: widget.child, child: widget.child,
popupBuilder: (_) { popupBuilder: (_) {
widget.onOpen?.call(); widget.onOpen?.call();

View File

@ -74,6 +74,7 @@ class ThemeValueDropDown extends StatefulWidget {
this.onClose, this.onClose,
this.child, this.child,
this.popoverController, this.popoverController,
this.offset,
}); });
final String currentValue; final String currentValue;
@ -82,6 +83,7 @@ class ThemeValueDropDown extends StatefulWidget {
final void Function()? onClose; final void Function()? onClose;
final Widget? child; final Widget? child;
final PopoverController? popoverController; final PopoverController? popoverController;
final Offset? offset;
@override @override
State<ThemeValueDropDown> createState() => _ThemeValueDropDownState(); State<ThemeValueDropDown> createState() => _ThemeValueDropDownState();
@ -93,13 +95,14 @@ class _ThemeValueDropDownState extends State<ThemeValueDropDown> {
return AppFlowyPopover( return AppFlowyPopover(
key: widget.popoverKey, key: widget.popoverKey,
controller: widget.popoverController, controller: widget.popoverController,
direction: PopoverDirection.bottomWithRightAligned, direction: PopoverDirection.bottomWithCenterAligned,
popupBuilder: widget.popupBuilder, popupBuilder: widget.popupBuilder,
constraints: const BoxConstraints( constraints: const BoxConstraints(
minWidth: 80, minWidth: 80,
maxWidth: 160, maxWidth: 160,
maxHeight: 400, maxHeight: 400,
), ),
offset: widget.offset,
onClose: widget.onClose, onClose: widget.onClose,
child: widget.child ?? child: widget.child ??
FlowyTextButton( FlowyTextButton(