From 5dfc4708732a2e04548a138c94687983f4c58ac8 Mon Sep 17 00:00:00 2001 From: "Lucas.Xu" Date: Fri, 22 Sep 2023 13:53:14 +0800 Subject: [PATCH] chore: add more space between font item and font menu --- .../editor_plugins/font/customize_font_toolbar_item.dart | 1 + .../widgets/settings_appearance/font_family_setting.dart | 3 +++ .../settings_appearance/theme_setting_entry_template.dart | 5 ++++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/font/customize_font_toolbar_item.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/font/customize_font_toolbar_item.dart index bf89adbd67..76326f2704 100644 --- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/font/customize_font_toolbar_item.dart +++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/font/customize_font_toolbar_item.dart @@ -16,6 +16,7 @@ final customizeFontToolbarItem = ToolbarItem( cursor: SystemMouseCursors.click, child: FontFamilyDropDown( currentFontFamily: '', + offset: const Offset(0, 12), popoverController: popoverController, onOpen: () => keepEditorFocusNotifier.value += 1, onClose: () => keepEditorFocusNotifier.value -= 1, diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/settings_appearance/font_family_setting.dart b/frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/settings_appearance/font_family_setting.dart index 25bffbcf26..3b13963d7f 100644 --- a/frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/settings_appearance/font_family_setting.dart +++ b/frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/settings_appearance/font_family_setting.dart @@ -60,6 +60,7 @@ class FontFamilyDropDown extends StatefulWidget { this.onFontFamilyChanged, this.child, this.popoverController, + this.offset, }); final String currentFontFamily; @@ -68,6 +69,7 @@ class FontFamilyDropDown extends StatefulWidget { final void Function(String fontFamily)? onFontFamilyChanged; final Widget? child; final PopoverController? popoverController; + final Offset? offset; @override State createState() => _FontFamilyDropDownState(); @@ -87,6 +89,7 @@ class _FontFamilyDropDownState extends State { query.value = ''; widget.onClose?.call(); }, + offset: widget.offset, child: widget.child, popupBuilder: (_) { widget.onOpen?.call(); diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/settings_appearance/theme_setting_entry_template.dart b/frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/settings_appearance/theme_setting_entry_template.dart index 368f551d1d..d86f985c18 100644 --- a/frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/settings_appearance/theme_setting_entry_template.dart +++ b/frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/settings_appearance/theme_setting_entry_template.dart @@ -74,6 +74,7 @@ class ThemeValueDropDown extends StatefulWidget { this.onClose, this.child, this.popoverController, + this.offset, }); final String currentValue; @@ -82,6 +83,7 @@ class ThemeValueDropDown extends StatefulWidget { final void Function()? onClose; final Widget? child; final PopoverController? popoverController; + final Offset? offset; @override State createState() => _ThemeValueDropDownState(); @@ -93,13 +95,14 @@ class _ThemeValueDropDownState extends State { return AppFlowyPopover( key: widget.popoverKey, controller: widget.popoverController, - direction: PopoverDirection.bottomWithRightAligned, + direction: PopoverDirection.bottomWithCenterAligned, popupBuilder: widget.popupBuilder, constraints: const BoxConstraints( minWidth: 80, maxWidth: 160, maxHeight: 400, ), + offset: widget.offset, onClose: widget.onClose, child: widget.child ?? FlowyTextButton(