diff --git a/frontend/appflowy_flutter/lib/plugins/database_view/widgets/row/accessory/cell_accessory.dart b/frontend/appflowy_flutter/lib/plugins/database_view/widgets/row/accessory/cell_accessory.dart index eb12292e0f..128dc85416 100644 --- a/frontend/appflowy_flutter/lib/plugins/database_view/widgets/row/accessory/cell_accessory.dart +++ b/frontend/appflowy_flutter/lib/plugins/database_view/widgets/row/accessory/cell_accessory.dart @@ -3,6 +3,7 @@ import 'package:flowy_infra/size.dart'; import 'package:flowy_infra/theme_extension.dart'; import 'package:flowy_infra_ui/style_widget/hover.dart'; +import 'package:flowy_infra_ui/widget/flowy_tooltip.dart'; import 'package:flutter/material.dart'; import 'package:styled_widget/styled_widget.dart'; import 'package:appflowy/generated/locale_keys.g.dart'; @@ -66,7 +67,7 @@ class _PrimaryCellAccessoryState extends State with GridCellAccessoryState { @override Widget build(BuildContext context) { - return Tooltip( + return FlowyTooltip.delayed( message: LocaleKeys.tooltip_openAsPage.tr(), child: SizedBox( width: 26, diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/actions/block_action_button.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/actions/block_action_button.dart index e1d8f6d8f0..a4c8c5cc1c 100644 --- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/actions/block_action_button.dart +++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/actions/block_action_button.dart @@ -1,6 +1,7 @@ import 'dart:io'; import 'package:appflowy/generated/flowy_svgs.g.dart'; +import 'package:flowy_infra_ui/widget/flowy_tooltip.dart'; import 'package:flowy_infra_ui/widget/ignore_parent_gesture.dart'; import 'package:flutter/material.dart'; @@ -20,7 +21,7 @@ class BlockActionButton extends StatelessWidget { Widget build(BuildContext context) { return Align( alignment: Alignment.center, - child: Tooltip( + child: FlowyTooltip.delayed( preferBelow: false, richMessage: richMessage, child: MouseRegion( diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/align_toolbar_item/align_toolbar_item.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/align_toolbar_item/align_toolbar_item.dart index 53cc44d588..61b1c92407 100644 --- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/align_toolbar_item/align_toolbar_item.dart +++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/align_toolbar_item/align_toolbar_item.dart @@ -4,6 +4,7 @@ import 'package:appflowy_editor/appflowy_editor.dart'; import 'package:appflowy_popover/appflowy_popover.dart'; import 'package:easy_localization/easy_localization.dart'; import 'package:flowy_infra_ui/flowy_infra_ui.dart'; +import 'package:flowy_infra_ui/widget/flowy_tooltip.dart'; import 'package:flutter/material.dart'; final alignToolbarItem = ToolbarItem( @@ -155,7 +156,7 @@ class _AlignButton extends StatelessWidget { cursor: SystemMouseCursors.click, child: GestureDetector( onTap: onTap, - child: Tooltip( + child: FlowyTooltip.delayed( message: tooltips, child: FlowySvg( icon, diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/more/more_button.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/more/more_button.dart index 4152cdde8b..fbaadd413d 100644 --- a/frontend/appflowy_flutter/lib/plugins/document/presentation/more/more_button.dart +++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/more/more_button.dart @@ -3,6 +3,7 @@ import 'package:appflowy/generated/locale_keys.g.dart'; import 'package:appflowy/plugins/document/presentation/more/cubit/document_appearance_cubit.dart'; import 'package:appflowy/plugins/document/presentation/more/font_size_switcher.dart'; import 'package:easy_localization/easy_localization.dart'; +import 'package:flowy_infra_ui/widget/flowy_tooltip.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -16,7 +17,6 @@ class DocumentMoreButton extends StatelessWidget { return PopupMenuButton( color: Theme.of(context).colorScheme.surfaceVariant, offset: const Offset(0, 30), - tooltip: LocaleKeys.moreAction_moreOptions.tr(), itemBuilder: (context) { return [ PopupMenuItem( @@ -29,10 +29,13 @@ class DocumentMoreButton extends StatelessWidget { ), ]; }, - child: FlowySvg( - FlowySvgs.details_s, - size: const Size(18, 18), - color: Theme.of(context).iconTheme.color, + child: FlowyTooltip.delayed( + message: LocaleKeys.moreAction_moreOptions.tr(), + child: FlowySvg( + FlowySvgs.details_s, + size: const Size(18, 18), + color: Theme.of(context).iconTheme.color, + ), ), ); } diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/sidebar_top_menu.dart b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/sidebar_top_menu.dart index 09a30947f1..933fb7a943 100644 --- a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/sidebar_top_menu.dart +++ b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/sidebar_top_menu.dart @@ -8,6 +8,7 @@ import 'package:appflowy/workspace/application/menu/menu_bloc.dart'; import 'package:appflowy/workspace/presentation/home/home_sizes.dart'; import 'package:easy_localization/easy_localization.dart'; import 'package:flowy_infra_ui/style_widget/icon_button.dart'; +import 'package:flowy_infra_ui/widget/flowy_tooltip.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -69,7 +70,7 @@ class SidebarTopMenu extends StatelessWidget { ), ], ); - return Tooltip( + return FlowyTooltip.delayed( richMessage: textSpan, child: FlowyIconButton( width: 28, diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/sidebar_user.dart b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/sidebar_user.dart index 6726886e95..d01235d23e 100644 --- a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/sidebar_user.dart +++ b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/sidebar_user.dart @@ -7,6 +7,7 @@ import 'package:appflowy/workspace/presentation/settings/settings_dialog.dart'; import 'package:appflowy_backend/protobuf/flowy-folder2/view.pb.dart'; import 'package:appflowy/workspace/presentation/widgets/user_avatar.dart'; import 'package:flowy_infra_ui/style_widget/text.dart'; +import 'package:flowy_infra_ui/widget/flowy_tooltip.dart'; import 'package:flowy_infra_ui/widget/spacing.dart'; import 'package:appflowy_backend/protobuf/flowy-user/protobuf.dart' show UserProfilePB; @@ -64,7 +65,7 @@ class SidebarUser extends StatelessWidget { Widget _buildSettingsButton(BuildContext context, MenuUserState state) { final userProfile = state.userProfile; - return Tooltip( + return FlowyTooltip.delayed( message: LocaleKeys.settings_menu_open.tr(), child: IconButton( onPressed: () { diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/view/view_item.dart b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/view/view_item.dart index 0cba6df79c..814060ec71 100644 --- a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/view/view_item.dart +++ b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/view/view_item.dart @@ -17,6 +17,7 @@ import 'package:appflowy_backend/protobuf/flowy-folder2/view.pb.dart'; import 'package:easy_localization/easy_localization.dart'; import 'package:flowy_infra_ui/flowy_infra_ui.dart'; import 'package:flowy_infra_ui/style_widget/hover.dart'; +import 'package:flowy_infra_ui/widget/flowy_tooltip.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -338,7 +339,7 @@ class _SingleInnerViewItemState extends State { // + button Widget _buildViewAddButton(BuildContext context) { - return Tooltip( + return FlowyTooltip.delayed( message: LocaleKeys.menuAppHeader_addPageTooltip.tr(), child: ViewAddButton( parentViewId: widget.view.id, @@ -378,7 +379,7 @@ class _SingleInnerViewItemState extends State { // ยทยทยท more action button Widget _buildViewMoreActionButton(BuildContext context) { - return Tooltip( + return FlowyTooltip.delayed( message: LocaleKeys.menuAppHeader_moreButtonToolTip.tr(), child: ViewMoreActionButton( view: widget.view, diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/home/navigation.dart b/frontend/appflowy_flutter/lib/workspace/presentation/home/navigation.dart index a028c19aac..7595d2cca3 100644 --- a/frontend/appflowy_flutter/lib/workspace/presentation/home/navigation.dart +++ b/frontend/appflowy_flutter/lib/workspace/presentation/home/navigation.dart @@ -8,6 +8,7 @@ import 'package:easy_localization/easy_localization.dart'; import 'package:flowy_infra/size.dart'; import 'package:flowy_infra_ui/style_widget/icon_button.dart'; import 'package:flowy_infra_ui/style_widget/text.dart'; +import 'package:flowy_infra_ui/widget/flowy_tooltip.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:provider/provider.dart'; @@ -65,7 +66,7 @@ class FlowyNavigation extends StatelessWidget { if (state.isMenuCollapsed) { return RotationTransition( turns: const AlwaysStoppedAnimation(180 / 360), - child: Tooltip( + child: FlowyTooltip.delayed( richMessage: sidebarTooltipTextSpan( context, LocaleKeys.sideBar_openSidebar.tr(), diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/settings_appearance/brightness_setting.dart b/frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/settings_appearance/brightness_setting.dart index a0c8cebdc6..0a2fd2c9b4 100644 --- a/frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/settings_appearance/brightness_setting.dart +++ b/frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/settings_appearance/brightness_setting.dart @@ -6,6 +6,7 @@ import 'package:appflowy/workspace/application/appearance.dart'; import 'package:appflowy_popover/appflowy_popover.dart'; import 'package:easy_localization/easy_localization.dart'; import 'package:flowy_infra_ui/flowy_infra_ui.dart'; +import 'package:flowy_infra_ui/widget/flowy_tooltip.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -16,7 +17,7 @@ class BrightnessSetting extends StatelessWidget { const BrightnessSetting({required this.currentThemeMode, super.key}); @override - Widget build(BuildContext context) => Tooltip( + Widget build(BuildContext context) => FlowyTooltip.delayed( richMessage: themeModeTooltipTextSpan( context, LocaleKeys.settings_appearance_themeMode_label.tr(), diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/settings_file_customize_location_view.dart b/frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/settings_file_customize_location_view.dart index 0cd56ee818..2e3f7c3121 100644 --- a/frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/settings_file_customize_location_view.dart +++ b/frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/settings_file_customize_location_view.dart @@ -6,6 +6,7 @@ import 'package:flowy_infra/file_picker/file_picker_service.dart'; import 'package:appflowy/workspace/application/settings/settings_location_cubit.dart'; import 'package:flowy_infra_ui/style_widget/hover.dart'; import 'package:flowy_infra_ui/widget/buttons/secondary_button.dart'; +import 'package:flowy_infra_ui/widget/flowy_tooltip.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -163,7 +164,7 @@ class _ChangeStoragePathButton extends StatefulWidget { class _ChangeStoragePathButtonState extends State<_ChangeStoragePathButton> { @override Widget build(BuildContext context) { - return Tooltip( + return FlowyTooltip.delayed( message: LocaleKeys.settings_files_changeLocationTooltips.tr(), child: SecondaryTextButton( LocaleKeys.settings_files_change.tr(), diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/settings_user_view.dart b/frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/settings_user_view.dart index c4c08883fb..acfbb1cccc 100644 --- a/frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/settings_user_view.dart +++ b/frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/settings_user_view.dart @@ -9,7 +9,6 @@ import 'package:appflowy/user/application/auth/auth_service.dart'; import 'package:appflowy/util/debounce.dart'; import 'package:appflowy/workspace/application/user/settings_user_bloc.dart'; import 'package:appflowy/workspace/presentation/widgets/dialogs.dart'; -import 'package:appflowy/workspace/presentation/widgets/flowy_tooltip.dart'; import 'package:appflowy/workspace/presentation/widgets/user_avatar.dart'; import 'package:appflowy_backend/protobuf/flowy-user/protobuf.dart'; import 'package:collection/collection.dart'; @@ -17,6 +16,7 @@ import 'package:easy_localization/easy_localization.dart'; import 'package:flowy_infra/size.dart'; import 'package:flowy_infra_ui/flowy_infra_ui.dart'; import 'package:flowy_infra_ui/style_widget/hover.dart'; +import 'package:flowy_infra_ui/widget/flowy_tooltip.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -217,7 +217,7 @@ class SettingsUserView extends StatelessWidget { required bool hasIcon, required Widget child, }) => - FlowyTooltip.delayedTooltip( + FlowyTooltip.delayed( message: LocaleKeys.settings_user_tooltipSelectIcon.tr(), child: Stack( children: [ diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/sync_setting_view.dart b/frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/sync_setting_view.dart index 41661038be..39ad66a4d5 100644 --- a/frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/sync_setting_view.dart +++ b/frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/sync_setting_view.dart @@ -9,6 +9,7 @@ import 'package:easy_localization/easy_localization.dart'; import 'package:flowy_infra/size.dart'; import 'package:flowy_infra_ui/flowy_infra_ui.dart'; import 'package:flowy_infra_ui/widget/error_page.dart'; +import 'package:flowy_infra_ui/widget/flowy_tooltip.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -105,7 +106,7 @@ class EnableEncrypt extends StatelessWidget { const VSpace(6), SizedBox( height: 40, - child: Tooltip( + child: FlowyTooltip.delayed( message: LocaleKeys.settings_menu_clickToCopySecret.tr(), child: FlowyButton( disable: !(state.config.enableEncrypt), diff --git a/frontend/appflowy_flutter/packages/flowy_infra_ui/lib/style_widget/button.dart b/frontend/appflowy_flutter/packages/flowy_infra_ui/lib/style_widget/button.dart index a11ffe9879..daef47f052 100644 --- a/frontend/appflowy_flutter/packages/flowy_infra_ui/lib/style_widget/button.dart +++ b/frontend/appflowy_flutter/packages/flowy_infra_ui/lib/style_widget/button.dart @@ -1,6 +1,7 @@ import 'package:flowy_infra/size.dart'; import 'package:flowy_infra_ui/style_widget/hover.dart'; import 'package:flowy_infra_ui/style_widget/text.dart'; +import 'package:flowy_infra_ui/widget/flowy_tooltip.dart'; import 'package:flowy_infra_ui/widget/ignore_parent_gesture.dart'; import 'package:flowy_infra_ui/widget/spacing.dart'; import 'package:flutter/material.dart'; @@ -194,7 +195,7 @@ class FlowyTextButton extends StatelessWidget { ); if (tooltip != null) { - child = Tooltip( + child = FlowyTooltip.delayed( message: tooltip!, child: child, ); @@ -283,7 +284,7 @@ class FlowyRichTextButton extends StatelessWidget { ); if (tooltip != null) { - child = Tooltip( + child = FlowyTooltip.delayed( message: tooltip!, child: child, ); diff --git a/frontend/appflowy_flutter/packages/flowy_infra_ui/lib/style_widget/icon_button.dart b/frontend/appflowy_flutter/packages/flowy_infra_ui/lib/style_widget/icon_button.dart index 31c370b99d..9cc9dee372 100644 --- a/frontend/appflowy_flutter/packages/flowy_infra_ui/lib/style_widget/icon_button.dart +++ b/frontend/appflowy_flutter/packages/flowy_infra_ui/lib/style_widget/icon_button.dart @@ -1,5 +1,6 @@ import 'package:flowy_infra/size.dart'; import 'package:flowy_infra_ui/style_widget/hover.dart'; +import 'package:flowy_infra_ui/widget/flowy_tooltip.dart'; import 'package:flowy_svg/flowy_svg.dart'; import 'package:flutter/material.dart'; @@ -57,7 +58,7 @@ class FlowyIconButton extends StatelessWidget { height: size.height, ), decoration: decoration, - child: Tooltip( + child: FlowyTooltip.delayed( preferBelow: preferBelow, message: tooltipMessage, richMessage: richTooltipText, diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/widgets/flowy_tooltip.dart b/frontend/appflowy_flutter/packages/flowy_infra_ui/lib/widget/flowy_tooltip.dart similarity index 81% rename from frontend/appflowy_flutter/lib/workspace/presentation/widgets/flowy_tooltip.dart rename to frontend/appflowy_flutter/packages/flowy_infra_ui/lib/widget/flowy_tooltip.dart index ad3b456093..fabca2c54b 100644 --- a/frontend/appflowy_flutter/lib/workspace/presentation/widgets/flowy_tooltip.dart +++ b/frontend/appflowy_flutter/packages/flowy_infra_ui/lib/widget/flowy_tooltip.dart @@ -3,16 +3,18 @@ import 'package:flutter/material.dart'; const _tooltipWaitDuration = Duration(milliseconds: 300); class FlowyTooltip { - static Tooltip delayedTooltip({ + static Tooltip delayed({ String? message, InlineSpan? richMessage, bool? preferBelow, + Duration? showDuration, Widget? child, }) { return Tooltip( waitDuration: _tooltipWaitDuration, message: message, richMessage: richMessage, + showDuration: showDuration, preferBelow: preferBelow, child: child, ); diff --git a/frontend/scripts/install_dev_env/install_macos.sh b/frontend/scripts/install_dev_env/install_macos.sh index c5d5223afc..c9cf2c6cce 100755 --- a/frontend/scripts/install_dev_env/install_macos.sh +++ b/frontend/scripts/install_dev_env/install_macos.sh @@ -90,4 +90,4 @@ cargo install --force duckscript_cli # Check prerequisites printMessage "Checking prerequisites." -cargo make appflowy-flutter-deps-tools +cargo make appflowy-flutter-deps-tools \ No newline at end of file