mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: text overflow issue of font family dropdown (#3348)
* fixed text overflow issue of font family dropdown * added tooltip delay * code review fixes: unwanted key removed; tooltip added for all fonts; delay time reduces; * Update frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/settings_appearance/font_family_setting.dart --------- Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>
This commit is contained in:
parent
6ecc3c9076
commit
366e28752c
@ -173,11 +173,14 @@ class _FontFamilyDropDownState extends State<FontFamilyDropDown> {
|
|||||||
TextStyle style,
|
TextStyle style,
|
||||||
) {
|
) {
|
||||||
final buttonFontFamily = parseFontFamilyName(style.fontFamily!);
|
final buttonFontFamily = parseFontFamilyName(style.fontFamily!);
|
||||||
return SizedBox(
|
|
||||||
key: UniqueKey(),
|
return Tooltip(
|
||||||
|
message: buttonFontFamily,
|
||||||
|
waitDuration: const Duration(milliseconds: 150),
|
||||||
|
child: SizedBox(
|
||||||
|
key: ValueKey(buttonFontFamily),
|
||||||
height: 32,
|
height: 32,
|
||||||
child: FlowyButton(
|
child: FlowyButton(
|
||||||
key: Key(buttonFontFamily),
|
|
||||||
onHover: (_) => FocusScope.of(context).unfocus(),
|
onHover: (_) => FocusScope.of(context).unfocus(),
|
||||||
text: FlowyText.medium(
|
text: FlowyText.medium(
|
||||||
parseFontFamilyName(style.fontFamily!),
|
parseFontFamilyName(style.fontFamily!),
|
||||||
@ -196,7 +199,9 @@ class _FontFamilyDropDownState extends State<FontFamilyDropDown> {
|
|||||||
final fontFamily = style.fontFamily!.parseFontFamilyName();
|
final fontFamily = style.fontFamily!.parseFontFamilyName();
|
||||||
if (parseFontFamilyName(widget.currentFontFamily) !=
|
if (parseFontFamilyName(widget.currentFontFamily) !=
|
||||||
buttonFontFamily) {
|
buttonFontFamily) {
|
||||||
context.read<AppearanceSettingsCubit>().setFontFamily(fontFamily);
|
context
|
||||||
|
.read<AppearanceSettingsCubit>()
|
||||||
|
.setFontFamily(fontFamily);
|
||||||
context
|
context
|
||||||
.read<DocumentAppearanceCubit>()
|
.read<DocumentAppearanceCubit>()
|
||||||
.syncFontFamily(fontFamily);
|
.syncFontFamily(fontFamily);
|
||||||
@ -205,6 +210,7 @@ class _FontFamilyDropDownState extends State<FontFamilyDropDown> {
|
|||||||
PopoverContainer.of(context).close();
|
PopoverContainer.of(context).close();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user