diff --git a/frontend/appflowy_flutter/lib/core/frameless_window.dart b/frontend/appflowy_flutter/lib/core/frameless_window.dart index fcd955fc93..c322da97aa 100644 --- a/frontend/appflowy_flutter/lib/core/frameless_window.dart +++ b/frontend/appflowy_flutter/lib/core/frameless_window.dart @@ -127,7 +127,7 @@ class MoveWindowDetectorState extends State { onPressed: () => context .read() .add(const HomeSettingEvent.collapseMenu()), - iconPadding: const EdgeInsets.fromLTRB(4, 4, 4, 4), + iconPadding: const EdgeInsets.all(4.0), icon: context.read().state.isMenuCollapsed ? const FlowySvg(FlowySvgs.show_menu_s) : const FlowySvg(FlowySvgs.hide_menu_m), diff --git a/frontend/appflowy_flutter/lib/plugins/database/board/board.dart b/frontend/appflowy_flutter/lib/plugins/database/board/board.dart index 86851c4bbb..f8fb18a561 100644 --- a/frontend/appflowy_flutter/lib/plugins/database/board/board.dart +++ b/frontend/appflowy_flutter/lib/plugins/database/board/board.dart @@ -19,7 +19,7 @@ class BoardPluginBuilder implements PluginBuilder { String get menuName => LocaleKeys.board_menuName.tr(); @override - FlowySvgData get icon => FlowySvgs.board_s; + FlowySvgData get icon => FlowySvgs.icon_board_s; @override PluginType get pluginType => PluginType.board; diff --git a/frontend/appflowy_flutter/lib/plugins/database/calendar/calendar.dart b/frontend/appflowy_flutter/lib/plugins/database/calendar/calendar.dart index 861d9f4303..54667d5f69 100644 --- a/frontend/appflowy_flutter/lib/plugins/database/calendar/calendar.dart +++ b/frontend/appflowy_flutter/lib/plugins/database/calendar/calendar.dart @@ -2,8 +2,8 @@ import 'package:appflowy/generated/flowy_svgs.g.dart'; import 'package:appflowy/generated/locale_keys.g.dart'; import 'package:appflowy/plugins/database/tab_bar/tab_bar_view.dart'; import 'package:appflowy/startup/plugin/plugin.dart'; -import 'package:easy_localization/easy_localization.dart'; import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart'; +import 'package:easy_localization/easy_localization.dart'; class CalendarPluginBuilder extends PluginBuilder { @override @@ -19,7 +19,7 @@ class CalendarPluginBuilder extends PluginBuilder { String get menuName => LocaleKeys.calendar_menuName.tr(); @override - FlowySvgData get icon => FlowySvgs.date_s; + FlowySvgData get icon => FlowySvgs.icon_calendar_s; @override PluginType get pluginType => PluginType.calendar; diff --git a/frontend/appflowy_flutter/lib/plugins/database/grid/grid.dart b/frontend/appflowy_flutter/lib/plugins/database/grid/grid.dart index 1f8816d92b..b43c425a9d 100644 --- a/frontend/appflowy_flutter/lib/plugins/database/grid/grid.dart +++ b/frontend/appflowy_flutter/lib/plugins/database/grid/grid.dart @@ -2,8 +2,8 @@ import 'package:appflowy/generated/flowy_svgs.g.dart'; import 'package:appflowy/generated/locale_keys.g.dart'; import 'package:appflowy/plugins/database/tab_bar/tab_bar_view.dart'; import 'package:appflowy/startup/plugin/plugin.dart'; -import 'package:easy_localization/easy_localization.dart'; import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart'; +import 'package:easy_localization/easy_localization.dart'; class GridPluginBuilder implements PluginBuilder { @override @@ -19,7 +19,7 @@ class GridPluginBuilder implements PluginBuilder { String get menuName => LocaleKeys.grid_menuName.tr(); @override - FlowySvgData get icon => FlowySvgs.grid_s; + FlowySvgData get icon => FlowySvgs.icon_grid_s; @override PluginType get pluginType => PluginType.grid; diff --git a/frontend/appflowy_flutter/lib/plugins/database_document/database_document_plugin.dart b/frontend/appflowy_flutter/lib/plugins/database_document/database_document_plugin.dart index cd709e2154..e415aaa12e 100644 --- a/frontend/appflowy_flutter/lib/plugins/database_document/database_document_plugin.dart +++ b/frontend/appflowy_flutter/lib/plugins/database_document/database_document_plugin.dart @@ -44,7 +44,7 @@ class DatabaseDocumentPluginBuilder extends PluginBuilder { String get menuName => LocaleKeys.document_menuName.tr(); @override - FlowySvgData get icon => FlowySvgs.document_s; + FlowySvgData get icon => FlowySvgs.icon_document_s; @override PluginType get pluginType => PluginType.databaseDocument; diff --git a/frontend/appflowy_flutter/lib/plugins/document/document.dart b/frontend/appflowy_flutter/lib/plugins/document/document.dart index cb48cd1bba..b13ce1221c 100644 --- a/frontend/appflowy_flutter/lib/plugins/document/document.dart +++ b/frontend/appflowy_flutter/lib/plugins/document/document.dart @@ -37,7 +37,7 @@ class DocumentPluginBuilder extends PluginBuilder { String get menuName => LocaleKeys.document_menuName.tr(); @override - FlowySvgData get icon => FlowySvgs.document_s; + FlowySvgData get icon => FlowySvgs.icon_document_s; @override PluginType get pluginType => PluginType.document; @@ -148,7 +148,7 @@ class DocumentPluginWidgetBuilder extends PluginWidgetBuilder ? [ DocumentCollaborators( key: ValueKey('collaborators_${view.id}'), - width: 150, + width: 120, height: 32, view: view, ), diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/header/cover_editor.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/header/cover_editor.dart index aac0713a7d..60211b9024 100644 --- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/header/cover_editor.dart +++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/header/cover_editor.dart @@ -1,14 +1,17 @@ import 'dart:ui'; -import 'package:flutter/material.dart'; - import 'package:appflowy_editor/appflowy_editor.dart'; +import 'package:flutter/material.dart'; const String kLocalImagesKey = 'local_images'; List get builtInAssetImages => [ - "assets/images/app_flowy_abstract_cover_1.jpg", - "assets/images/app_flowy_abstract_cover_2.jpg", + 'assets/images/built_in_cover_images/m_cover_image_1.jpg', + 'assets/images/built_in_cover_images/m_cover_image_2.jpg', + 'assets/images/built_in_cover_images/m_cover_image_3.jpg', + 'assets/images/built_in_cover_images/m_cover_image_4.jpg', + 'assets/images/built_in_cover_images/m_cover_image_5.jpg', + 'assets/images/built_in_cover_images/m_cover_image_6.jpg', ]; class ColorOption { diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/header/desktop_cover.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/header/desktop_cover.dart index 7e576363cd..e8d04d7161 100644 --- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/header/desktop_cover.dart +++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/header/desktop_cover.dart @@ -155,7 +155,7 @@ class _DesktopCoverState extends State { ); case CoverType.asset: return Image.asset( - widget.coverDetails!, + PageStyleCoverImageType.builtInImagePath(detail), fit: BoxFit.cover, ); case CoverType.color: diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/header/document_header_node_widget.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/header/document_header_node_widget.dart index 3a22909744..3ac9067b89 100644 --- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/header/document_header_node_widget.dart +++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/header/document_header_node_widget.dart @@ -28,8 +28,6 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; import 'package:string_validator/string_validator.dart'; -import 'cover_editor.dart'; - const double kCoverHeight = 250.0; const double kIconHeight = 60.0; const double kToolbarHeight = 40.0; // with padding to the top @@ -296,7 +294,7 @@ class _DocumentHeaderToolbarState extends State { leftIconSize: const Size.square(18), onTap: () => widget.onIconOrCoverChanged( cover: PlatformExtension.isDesktopOrWeb - ? (CoverType.asset, builtInAssetImages.first) + ? (CoverType.asset, '1') : (CoverType.color, '0xffe8e0ff'), ), useIntrinsicWidth: true, diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/migration/editor_migration.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/migration/editor_migration.dart index d97e6a5bc6..664e2143b6 100644 --- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/migration/editor_migration.dart +++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/migration/editor_migration.dart @@ -191,7 +191,13 @@ class EditorMigration { } else { switch (coverType) { case CoverType.asset: - // The new version does not support the asset cover. + extra = { + ViewExtKeys.coverKey: { + ViewExtKeys.coverTypeKey: + PageStyleCoverImageType.builtInImage.toString(), + ViewExtKeys.coverValueKey: coverDetails, + }, + }; break; case CoverType.color: extra = { diff --git a/frontend/appflowy_flutter/lib/workspace/application/view/view_ext.dart b/frontend/appflowy_flutter/lib/workspace/application/view/view_ext.dart index 4835c795ba..ca32823d65 100644 --- a/frontend/appflowy_flutter/lib/workspace/application/view/view_ext.dart +++ b/frontend/appflowy_flutter/lib/workspace/application/view/view_ext.dart @@ -41,10 +41,10 @@ class ViewExtKeys { extension ViewExtension on ViewPB { Widget defaultIcon() => FlowySvg( switch (layout) { - ViewLayoutPB.Board => FlowySvgs.board_s, - ViewLayoutPB.Calendar => FlowySvgs.calendar_s, - ViewLayoutPB.Grid => FlowySvgs.grid_s, - ViewLayoutPB.Document => FlowySvgs.document_s, + ViewLayoutPB.Board => FlowySvgs.icon_board_s, + ViewLayoutPB.Calendar => FlowySvgs.icon_calendar_s, + ViewLayoutPB.Grid => FlowySvgs.icon_grid_s, + ViewLayoutPB.Document => FlowySvgs.icon_document_s, ViewLayoutPB.Chat => FlowySvgs.chat_ai_page_s, _ => FlowySvgs.document_s, }, diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/favorites/favorite_folder.dart b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/favorites/favorite_folder.dart index 1e6279f304..a3cb50fd06 100644 --- a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/favorites/favorite_folder.dart +++ b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/favorites/favorite_folder.dart @@ -134,15 +134,22 @@ class FavoriteHeader extends StatelessWidget { @override Widget build(BuildContext context) { - return FlowyButton( - onTap: onPressed, - margin: const EdgeInsets.symmetric(horizontal: 6.0, vertical: 7.0), - leftIcon: const FlowySvg( - FlowySvgs.favorite_header_icon_s, - blendMode: null, + return SizedBox( + height: HomeSizes.newPageSectionHeight, + child: FlowyButton( + onTap: onPressed, + margin: const EdgeInsets.symmetric(horizontal: 4.0, vertical: 3.0), + leftIcon: const FlowySvg( + FlowySvgs.favorite_header_icon_m, + blendMode: null, + ), + leftIconSize: const Size.square(24.0), + iconPadding: 8.0, + text: FlowyText.regular( + LocaleKeys.sideBar_favorites.tr(), + lineHeight: 1.15, + ), ), - iconPadding: 10.0, - text: FlowyText.regular(LocaleKeys.sideBar_favorites.tr()), ); } } diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/folder/_folder_header.dart b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/folder/_folder_header.dart index c5042c4de4..d73060d0b3 100644 --- a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/folder/_folder_header.dart +++ b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/folder/_folder_header.dart @@ -1,4 +1,5 @@ import 'package:appflowy/generated/flowy_svgs.g.dart'; +import 'package:appflowy/workspace/presentation/home/home_sizes.dart'; import 'package:flowy_infra_ui/flowy_infra_ui.dart'; import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; @@ -11,6 +12,7 @@ class FolderHeader extends StatefulWidget { required this.addButtonTooltip, required this.onPressed, required this.onAdded, + required this.isExpanded, }); final String title; @@ -18,6 +20,7 @@ class FolderHeader extends StatefulWidget { final String addButtonTooltip; final VoidCallback onPressed; final VoidCallback onAdded; + final bool isExpanded; @override State createState() => _FolderHeaderState(); @@ -34,24 +37,42 @@ class _FolderHeaderState extends State { @override Widget build(BuildContext context) { - return MouseRegion( - onEnter: (_) => isHovered.value = true, - onExit: (_) => isHovered.value = false, - child: FlowyButton( - onTap: widget.onPressed, - margin: const EdgeInsets.symmetric(horizontal: 6.0), - rightIcon: ValueListenableBuilder( - valueListenable: isHovered, - builder: (context, onHover, child) => - Opacity(opacity: onHover ? 1 : 0, child: child), - child: FlowyIconButton( - tooltipText: widget.addButtonTooltip, - icon: const FlowySvg(FlowySvgs.view_item_add_s), - onPressed: widget.onAdded, + return SizedBox( + height: HomeSizes.workspaceSectionHeight, + child: MouseRegion( + onEnter: (_) => isHovered.value = true, + onExit: (_) => isHovered.value = false, + child: FlowyButton( + onTap: widget.onPressed, + margin: const EdgeInsets.only(left: 6.0, right: 4.0), + rightIcon: ValueListenableBuilder( + valueListenable: isHovered, + builder: (context, onHover, child) => + Opacity(opacity: onHover ? 1 : 0, child: child), + child: FlowyIconButton( + width: 24, + iconPadding: const EdgeInsets.all(4.0), + tooltipText: widget.addButtonTooltip, + icon: const FlowySvg(FlowySvgs.view_item_add_s), + onPressed: widget.onAdded, + ), + ), + iconPadding: 10.0, + text: Row( + children: [ + FlowyText( + widget.title, + lineHeight: 1.15, + ), + const HSpace(4.0), + FlowySvg( + widget.isExpanded + ? FlowySvgs.workspace_drop_down_menu_show_s + : FlowySvgs.workspace_drop_down_menu_hide_s, + ), + ], ), ), - iconPadding: 10.0, - text: FlowyText(widget.title), ), ); } diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/folder/_section_folder.dart b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/folder/_section_folder.dart index bd83e06934..c957a664c2 100644 --- a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/folder/_section_folder.dart +++ b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/folder/_section_folder.dart @@ -76,6 +76,7 @@ class _SectionFolderState extends State { Widget _buildHeader(BuildContext context) { return FolderHeader( title: widget.title, + isExpanded: context.watch().state.isExpanded, expandButtonTooltip: widget.expandButtonTooltip, addButtonTooltip: widget.addButtonTooltip, onPressed: () => diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/footer/sidebar_footer.dart b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/footer/sidebar_footer.dart index 6c16609a33..8af1c0eb9e 100644 --- a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/footer/sidebar_footer.dart +++ b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/footer/sidebar_footer.dart @@ -1,8 +1,12 @@ import 'package:appflowy/generated/flowy_svgs.g.dart'; +import 'package:appflowy/generated/locale_keys.g.dart'; import 'package:appflowy/startup/plugin/plugin.dart'; import 'package:appflowy/startup/startup.dart'; import 'package:appflowy/workspace/application/tabs/tabs_bloc.dart'; +import 'package:appflowy/workspace/presentation/home/home_sizes.dart'; import 'package:appflowy/workspace/presentation/home/menu/menu_shared_state.dart'; +import 'package:easy_localization/easy_localization.dart'; +import 'package:flowy_infra_ui/flowy_infra_ui.dart'; import 'package:flutter/material.dart'; class SidebarFooter extends StatelessWidget { @@ -31,12 +35,20 @@ class SidebarTrashButton extends StatelessWidget { @override Widget build(BuildContext context) { - return ValueListenableBuilder( - valueListenable: getIt().notifier, - builder: (context, value, child) { - return MouseRegion( - cursor: SystemMouseCursors.click, - child: GestureDetector( + return SizedBox( + height: HomeSizes.workspaceSectionHeight, + child: ValueListenableBuilder( + valueListenable: getIt().notifier, + builder: (context, value, child) { + return FlowyButton( + leftIcon: const FlowySvg(FlowySvgs.sidebar_footer_trash_m), + leftIconSize: const Size.square(24.0), + iconPadding: 8.0, + margin: const EdgeInsets.all(4.0), + text: FlowyText.regular( + LocaleKeys.trash_text.tr(), + lineHeight: 1.15, + ), onTap: () { getIt().latestOpenView = null; getIt().add( @@ -45,10 +57,9 @@ class SidebarTrashButton extends StatelessWidget { ), ); }, - child: const FlowySvg(FlowySvgs.sidebar_footer_trash_s), - ), - ); - }, + ); + }, + ), ); } } diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/header/sidebar_top_menu.dart b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/header/sidebar_top_menu.dart index c7dc54126e..240a660966 100644 --- a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/header/sidebar_top_menu.dart +++ b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/header/sidebar_top_menu.dart @@ -23,8 +23,11 @@ import 'package:flutter_bloc/flutter_bloc.dart'; class SidebarTopMenu extends StatelessWidget { const SidebarTopMenu({ super.key, + required this.isSidebarOnHover, }); + final ValueNotifier isSidebarOnHover; + @override Widget build(BuildContext context) { return BlocBuilder( @@ -80,17 +83,26 @@ class SidebarTopMenu extends StatelessWidget { ], ); - return Padding( - padding: const EdgeInsets.only(top: 12.0), - child: FlowyTooltip( - richMessage: textSpan, - child: FlowyIconButton( - width: 24, - onPressed: () => context - .read() - .add(const HomeSettingEvent.collapseMenu()), - iconPadding: const EdgeInsets.all(2), - icon: const FlowySvg(FlowySvgs.hide_menu_s), + return ValueListenableBuilder( + valueListenable: isSidebarOnHover, + builder: (_, value, ___) => Opacity( + opacity: value ? 1 : 0, + child: Padding( + padding: const EdgeInsets.only(top: 12.0, right: 4.0), + child: FlowyTooltip( + richMessage: textSpan, + child: Listener( + onPointerDown: (_) => context + .read() + .add(const HomeSettingEvent.collapseMenu()), + child: FlowyIconButton( + width: 24, + onPressed: () {}, + iconPadding: const EdgeInsets.all(4), + icon: const FlowySvg(FlowySvgs.hide_menu_s), + ), + ), + ), ), ), ); diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/shared/sidebar_folder.dart b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/shared/sidebar_folder.dart index 0e49c2acd6..c27f259b68 100644 --- a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/shared/sidebar_folder.dart +++ b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/shared/sidebar_folder.dart @@ -25,22 +25,21 @@ class SidebarFolder extends StatelessWidget { @override Widget build(BuildContext context) { + const sectionPadding = 16.0; return ValueListenableBuilder( valueListenable: getIt().notifier, builder: (context, value, child) { return Column( children: [ + const VSpace(4.0), // favorite BlocBuilder( builder: (context, state) { if (state.views.isEmpty) { return const SizedBox.shrink(); } - return Padding( - padding: const EdgeInsets.only(top: 16.0, bottom: 10), - child: FavoriteFolder( - views: state.views.map((e) => e.item).toList(), - ), + return FavoriteFolder( + views: state.views.map((e) => e.item).toList(), ); }, ), @@ -56,18 +55,18 @@ class SidebarFolder extends StatelessWidget { children: isCollaborativeWorkspace ? [ // public - const VSpace(10), + const VSpace(sectionPadding), PublicSectionFolder(views: state.section.publicViews), // private - const VSpace(10), + const VSpace(sectionPadding), PrivateSectionFolder( views: state.section.privateViews, ), ] : [ // personal - const VSpace(10), + const VSpace(sectionPadding), PersonalSectionFolder( views: state.section.publicViews, ), @@ -75,6 +74,7 @@ class SidebarFolder extends StatelessWidget { ); }, ), + const VSpace(200), ], ); }, diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/shared/sidebar_new_page_button.dart b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/shared/sidebar_new_page_button.dart index f58a1d43c9..b0b7b17483 100644 --- a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/shared/sidebar_new_page_button.dart +++ b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/shared/sidebar_new_page_button.dart @@ -18,20 +18,20 @@ class SidebarNewPageButton extends StatelessWidget { @override Widget build(BuildContext context) { return Container( - padding: const EdgeInsets.symmetric(horizontal: 12), + padding: const EdgeInsets.symmetric(horizontal: 8), height: HomeSizes.newPageSectionHeight, child: FlowyButton( onTap: () async => _createNewPage(context), leftIcon: const FlowySvg( - FlowySvgs.new_app_s, + FlowySvgs.new_app_m, blendMode: null, ), - iconPadding: 10.0, - text: SizedBox( - height: 18.0, - child: FlowyText.regular( - LocaleKeys.newPageText.tr(), - ), + leftIconSize: const Size.square(24.0), + margin: const EdgeInsets.only(left: 4.0), + iconPadding: 8.0, + text: FlowyText.regular( + LocaleKeys.newPageText.tr(), + lineHeight: 1.15, ), ), ); diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/shared/sidebar_setting.dart b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/shared/sidebar_setting.dart index 20c2338ebc..3e3610a653 100644 --- a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/shared/sidebar_setting.dart +++ b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/shared/sidebar_setting.dart @@ -1,12 +1,9 @@ -import 'package:flutter/material.dart'; - import 'package:appflowy/generated/flowy_svgs.g.dart'; import 'package:appflowy/generated/locale_keys.g.dart'; import 'package:appflowy/plugins/document/application/document_appearance_cubit.dart'; import 'package:appflowy/startup/startup.dart'; import 'package:appflowy/workspace/application/user/user_workspace_bloc.dart'; import 'package:appflowy/workspace/presentation/home/af_focus_manager.dart'; -import 'package:appflowy/workspace/presentation/home/home_sizes.dart'; import 'package:appflowy/workspace/presentation/home/hotkeys.dart'; import 'package:appflowy/workspace/presentation/settings/settings_dialog.dart'; import 'package:appflowy_backend/log.dart'; @@ -16,6 +13,7 @@ import 'package:appflowy_editor/appflowy_editor.dart' hide Log; 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'; import 'package:hotkey_manager/hotkey_manager.dart'; @@ -51,13 +49,15 @@ class UserSettingButton extends StatelessWidget { @override Widget build(BuildContext context) { return SizedBox.square( - dimension: HomeSizes.workspaceSectionHeight, + dimension: 24.0, child: FlowyTooltip( message: LocaleKeys.settings_menu_open.tr(), child: FlowyButton( onTap: () => showSettingsDialog(context, userProfile), + margin: EdgeInsets.zero, text: const FlowySvg( FlowySvgs.settings_s, + opacity: 0.7, ), ), ), diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/sidebar.dart b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/sidebar.dart index 31cdf73685..c7d8e3fbc2 100644 --- a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/sidebar.dart +++ b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/sidebar.dart @@ -189,7 +189,8 @@ class _Sidebar extends StatefulWidget { class _SidebarState extends State<_Sidebar> { final _scrollController = ScrollController(); Timer? _scrollDebounce; - bool isScrolling = false; + bool _isScrolling = false; + final _isHovered = ValueNotifier(false); @override void initState() { @@ -202,79 +203,101 @@ class _SidebarState extends State<_Sidebar> { _scrollDebounce?.cancel(); _scrollController.removeListener(_onScrollChanged); _scrollController.dispose(); + _isHovered.dispose(); super.dispose(); } @override Widget build(BuildContext context) { - const menuHorizontalInset = EdgeInsets.symmetric(horizontal: 12); + const menuHorizontalInset = EdgeInsets.symmetric(horizontal: 8); final userState = context.read().state; - return DecoratedBox( - decoration: BoxDecoration( - color: Theme.of(context).colorScheme.surfaceContainerHighest, - border: Border( - right: BorderSide(color: Theme.of(context).dividerColor), - ), - ), - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - // top menu - const Padding(padding: menuHorizontalInset, child: SidebarTopMenu()), - // user or workspace, setting - Container( - height: HomeSizes.workspaceSectionHeight, - padding: menuHorizontalInset - const EdgeInsets.only(right: 6), - child: - // if the workspaces are empty, show the user profile instead - userState.isCollabWorkspaceOn && userState.workspaces.isNotEmpty - ? SidebarWorkspace(userProfile: widget.userProfile) - : SidebarUser(userProfile: widget.userProfile), + return MouseRegion( + onEnter: (_) => _isHovered.value = true, + onExit: (_) => _isHovered.value = false, + child: DecoratedBox( + decoration: BoxDecoration( + color: Theme.of(context).colorScheme.surfaceContainerHighest, + border: Border( + right: BorderSide(color: Theme.of(context).dividerColor), ), - if (FeatureFlag.search.isOn) ...[ - const VSpace(6), - Container( + ), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + // top menu + Padding( padding: menuHorizontalInset, - height: HomeSizes.searchSectionHeight, - child: const _SidebarSearchButton(), + child: SidebarTopMenu( + isSidebarOnHover: _isHovered, + ), ), - ], - // new page button - const SidebarNewPageButton(), - // scrollable document list - Expanded( - child: Padding( + // user or workspace, setting + Container( + height: HomeSizes.workspaceSectionHeight, padding: menuHorizontalInset - const EdgeInsets.only(right: 6), - child: SingleChildScrollView( - padding: const EdgeInsets.only(right: 6), - controller: _scrollController, - physics: const ClampingScrollPhysics(), - child: SidebarFolder( - userProfile: widget.userProfile, - isHoverEnabled: !isScrolling, + child: + // if the workspaces are empty, show the user profile instead + userState.isCollabWorkspaceOn && + userState.workspaces.isNotEmpty + ? SidebarWorkspace(userProfile: widget.userProfile) + : SidebarUser(userProfile: widget.userProfile), + ), + if (FeatureFlag.search.isOn) ...[ + const VSpace(6), + Container( + padding: menuHorizontalInset, + height: HomeSizes.searchSectionHeight, + child: const _SidebarSearchButton(), + ), + ], + const VSpace(6.0), + // new page button + const SidebarNewPageButton(), + // scrollable document list + const VSpace(12.0), + const Padding( + padding: EdgeInsets.symmetric(horizontal: 12.0), + child: Divider( + color: Color(0x1E1F2329), + height: 0.5, + ), + ), + Expanded( + child: Padding( + padding: menuHorizontalInset - const EdgeInsets.only(right: 6), + child: SingleChildScrollView( + padding: const EdgeInsets.only(right: 6), + controller: _scrollController, + physics: const ClampingScrollPhysics(), + child: SidebarFolder( + userProfile: widget.userProfile, + isHoverEnabled: !_isScrolling, + ), ), ), ), - ), - const VSpace(10), - // trash - const Padding( - padding: menuHorizontalInset, - child: Divider(height: 1.0, color: Color(0x141F2329)), - ), - const VSpace(14), - const Padding( - padding: menuHorizontalInset, - child: SidebarFooter(), - ), - const VSpace(10), - ], + + // trash + Padding( + padding: menuHorizontalInset + + const EdgeInsets.symmetric(horizontal: 4.0), + child: const Divider(height: 1.0, color: Color(0x141F2329)), + ), + const VSpace(8), + Padding( + padding: menuHorizontalInset + + const EdgeInsets.symmetric(horizontal: 4.0), + child: const SidebarFooter(), + ), + const VSpace(14), + ], + ), ), ); } void _onScrollChanged() { - setState(() => isScrolling = true); + setState(() => _isScrolling = true); _scrollDebounce?.cancel(); _scrollDebounce = @@ -283,7 +306,7 @@ class _SidebarState extends State<_Sidebar> { void _setScrollStopped() { if (mounted) { - setState(() => isScrolling = false); + setState(() => _isScrolling = false); } } } diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/workspace/_sidebar_workspace_icon.dart b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/workspace/_sidebar_workspace_icon.dart index d179c4ce0f..6f96e6abc2 100644 --- a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/workspace/_sidebar_workspace_icon.dart +++ b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/workspace/_sidebar_workspace_icon.dart @@ -15,13 +15,17 @@ class WorkspaceIcon extends StatefulWidget { required this.iconSize, required this.fontSize, required this.onSelected, + this.borderRadius = 4, + this.emojiSize, }); final UserWorkspacePB workspace; final double iconSize; final bool enableEdit; final double fontSize; + final double? emojiSize; final void Function(EmojiPickerResult) onSelected; + final double borderRadius; @override State createState() => _WorkspaceIconState(); @@ -38,18 +42,22 @@ class _WorkspaceIconState extends State { alignment: Alignment.center, child: FlowyText.emoji( widget.workspace.icon, - fontSize: widget.iconSize, + fontSize: widget.emojiSize ?? widget.iconSize, ), ) : Container( alignment: Alignment.center, width: widget.iconSize, - height: min(widget.iconSize, 26), + height: min(widget.iconSize, 24), decoration: BoxDecoration( color: ColorGenerator(widget.workspace.name).toColor(), - borderRadius: BorderRadius.circular(4), + borderRadius: BorderRadius.circular(widget.borderRadius), + border: Border.all( + color: const Color(0xa1717171), + width: 0.5, + ), ), - child: FlowyText( + child: FlowyText.semibold( widget.workspace.name.isEmpty ? '' : widget.workspace.name.substring(0, 1), diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/workspace/sidebar_workspace.dart b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/workspace/sidebar_workspace.dart index d1a09afc28..1dddce8ac6 100644 --- a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/workspace/sidebar_workspace.dart +++ b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/workspace/sidebar_workspace.dart @@ -1,4 +1,3 @@ -import 'package:appflowy/generated/flowy_svgs.g.dart'; import 'package:appflowy/generated/locale_keys.g.dart'; import 'package:appflowy/plugins/document/presentation/editor_plugins/openai/widgets/loading.dart'; import 'package:appflowy/workspace/application/user/user_workspace_bloc.dart'; @@ -49,7 +48,9 @@ class _SidebarWorkspaceState extends State { ), ), UserSettingButton(userProfile: widget.userProfile), + const HSpace(8.0), const NotificationButton(), + const HSpace(10.0), ], ); }, @@ -203,12 +204,14 @@ class _SidebarSwitchWorkspaceButtonState height: 30, child: Row( children: [ - const HSpace(6.0), + const HSpace(4.0), WorkspaceIcon( workspace: widget.currentWorkspace, - iconSize: 16, - fontSize: 10, + iconSize: 24, + fontSize: 16, + emojiSize: 18, enableEdit: false, + borderRadius: 8.0, onSelected: (result) => context.read().add( UserWorkspaceEvent.updateWorkspaceIcon( widget.currentWorkspace.workspaceId, @@ -216,23 +219,16 @@ class _SidebarSwitchWorkspaceButtonState ), ), ), - const HSpace(10), + const HSpace(8), Flexible( child: FlowyText.medium( widget.currentWorkspace.name, overflow: TextOverflow.ellipsis, withTooltip: true, + fontSize: 15.0, ), ), const HSpace(4), - ValueListenableBuilder( - valueListenable: _isWorkSpaceMenuExpanded, - builder: (context, value, _) => FlowySvg( - value - ? FlowySvgs.workspace_drop_down_menu_hide_s - : FlowySvgs.workspace_drop_down_menu_show_s, - ), - ), ], ), ), diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/view/view_add_button.dart b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/view/view_add_button.dart index 1cfff3c6e6..3fa23c8f1c 100644 --- a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/view/view_add_button.dart +++ b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/view/view_add_button.dart @@ -50,10 +50,12 @@ class ViewAddButton extends StatelessWidget { return PopoverActionList( direction: PopoverDirection.bottomWithLeftAligned, actions: _actions, - offset: const Offset(0, 4), + offset: const Offset(0, 8), + constraints: const BoxConstraints( + minWidth: 200, + ), buildChild: (popover) { return FlowyIconButton( - hoverColor: Colors.transparent, width: 24, icon: const FlowySvg(FlowySvgs.view_item_add_s), onPressed: () { @@ -122,7 +124,7 @@ class ViewImportActionWrapper extends ActionCell { final DocumentPluginBuilder pluginBuilder; @override - Widget? leftIcon(Color iconColor) => const FlowySvg(FlowySvgs.import_s); + Widget? leftIcon(Color iconColor) => const FlowySvg(FlowySvgs.icon_import_s); @override String get name => LocaleKeys.moreAction_import.tr(); 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 1e58b7703f..cdbbd76e33 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 @@ -422,20 +422,19 @@ class _SingleInnerViewItemState extends State { Widget _buildViewItem(bool onHover, [bool isSelected = false]) { final children = [ + const HSpace(2), // expand icon or placeholder widget.leftIconBuilder?.call(context, widget.view) ?? _buildLeftIcon(), + const HSpace(2), // icon _buildViewIconButton(), const HSpace(6), - // const SizedBox( - // width: 6.0, - // height: 1, - // ), // title Expanded( child: FlowyText.regular( widget.view.name, overflow: TextOverflow.ellipsis, + lineHeight: 1.1, ), ), ]; @@ -447,10 +446,10 @@ class _SingleInnerViewItemState extends State { } else { // ยทยทยท more action button children.add(_buildViewMoreActionButton(context)); - children.add(const HSpace(8.0)); // only support add button for document layout if (widget.view.layout == ViewLayoutPB.Document) { // + button + children.add(const HSpace(8.0)); children.add(_buildViewAddButton(context)); } children.add(const HSpace(4.0)); @@ -500,8 +499,9 @@ class _SingleInnerViewItemState extends State { ? FlowyText.emoji( widget.view.icon.value, fontSize: 16.0, + lineHeight: 1.4, ) - : widget.view.defaultIcon(); + : Opacity(opacity: 0.6, child: widget.view.defaultIcon()); return AppFlowyPopover( offset: const Offset(20, 0), @@ -545,16 +545,18 @@ class _SingleInnerViewItemState extends State { return HSpace(widget.leftPadding); } - final child = GestureDetector( - child: FlowySvg( - widget.isExpanded - ? FlowySvgs.view_item_expand_s - : FlowySvgs.view_item_unexpand_s, - size: const Size.square(16.0), + final child = FlowyHover( + child: GestureDetector( + child: FlowySvg( + widget.isExpanded + ? FlowySvgs.view_item_expand_s + : FlowySvgs.view_item_unexpand_s, + size: const Size.square(16.0), + ), + onTap: () => context + .read() + .add(ViewEvent.setIsExpanded(!widget.isExpanded)), ), - onTap: () => context - .read() - .add(ViewEvent.setIsExpanded(!widget.isExpanded)), ); if (widget.isHovered != null) { diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/home/navigation.dart b/frontend/appflowy_flutter/lib/workspace/presentation/home/navigation.dart index 4201ec5396..55503cd38d 100644 --- a/frontend/appflowy_flutter/lib/workspace/presentation/home/navigation.dart +++ b/frontend/appflowy_flutter/lib/workspace/presentation/home/navigation.dart @@ -91,13 +91,16 @@ class FlowyNavigation extends StatelessWidget { turns: const AlwaysStoppedAnimation(180 / 360), child: FlowyTooltip( richMessage: textSpan, - child: FlowyIconButton( - width: 24, - onPressed: () => context + child: Listener( + onPointerDown: (event) => context .read() .add(const HomeSettingEvent.collapseMenu()), - iconPadding: const EdgeInsets.all(2), - icon: const FlowySvg(FlowySvgs.hide_menu_s), + child: FlowyIconButton( + width: 24, + onPressed: () {}, + iconPadding: const EdgeInsets.all(4), + icon: const FlowySvg(FlowySvgs.hide_menu_s), + ), ), ), ), diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/notifications/widgets/notification_button.dart b/frontend/appflowy_flutter/lib/workspace/presentation/notifications/widgets/notification_button.dart index 08f421951b..e28ebfb1c2 100644 --- a/frontend/appflowy_flutter/lib/workspace/presentation/notifications/widgets/notification_button.dart +++ b/frontend/appflowy_flutter/lib/workspace/presentation/notifications/widgets/notification_button.dart @@ -4,7 +4,6 @@ import 'package:appflowy/startup/startup.dart'; import 'package:appflowy/user/application/reminder/reminder_bloc.dart'; import 'package:appflowy/workspace/application/menu/sidebar_sections_bloc.dart'; import 'package:appflowy/workspace/application/settings/notifications/notification_settings_cubit.dart'; -import 'package:appflowy/workspace/presentation/home/home_sizes.dart'; import 'package:appflowy/workspace/presentation/notifications/notification_dialog.dart'; import 'package:appflowy_popover/appflowy_popover.dart'; import 'package:easy_localization/easy_localization.dart'; @@ -43,9 +42,10 @@ class NotificationButton extends StatelessWidget { popupBuilder: (_) => NotificationDialog(views: views, mutex: mutex), child: SizedBox.square( - dimension: HomeSizes.workspaceSectionHeight, + dimension: 24.0, child: FlowyButton( useIntrinsicWidth: true, + margin: EdgeInsets.zero, text: _buildNotificationIcon(context, state.hasUnreads), ), @@ -62,8 +62,11 @@ class NotificationButton extends StatelessWidget { Widget _buildNotificationIcon(BuildContext context, bool hasUnreads) { return Stack( children: [ - const FlowySvg( - FlowySvgs.notification_s, + const Center( + child: FlowySvg( + FlowySvgs.notification_s, + opacity: 0.7, + ), ), if (hasUnreads) Positioned( diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/widgets/favorite_button.dart b/frontend/appflowy_flutter/lib/workspace/presentation/widgets/favorite_button.dart index 970ee82631..68e8073db3 100644 --- a/frontend/appflowy_flutter/lib/workspace/presentation/widgets/favorite_button.dart +++ b/frontend/appflowy_flutter/lib/workspace/presentation/widgets/favorite_button.dart @@ -33,8 +33,9 @@ class ViewFavoriteButton extends StatelessWidget { child: Padding( padding: const EdgeInsets.all(6), child: FlowySvg( - isFavorite ? FlowySvgs.unfavorite_s : FlowySvgs.favorite_s, + isFavorite ? FlowySvgs.favorited_s : FlowySvgs.favorite_s, size: const Size.square(18), + blendMode: null, ), ), ), diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/widgets/float_bubble/question_bubble.dart b/frontend/appflowy_flutter/lib/workspace/presentation/widgets/float_bubble/question_bubble.dart index 1c8c8d20ff..fde71f9150 100644 --- a/frontend/appflowy_flutter/lib/workspace/presentation/widgets/float_bubble/question_bubble.dart +++ b/frontend/appflowy_flutter/lib/workspace/presentation/widgets/float_bubble/question_bubble.dart @@ -2,14 +2,14 @@ import 'package:appflowy/core/helpers/url_launcher.dart'; import 'package:appflowy/generated/flowy_svgs.g.dart'; import 'package:appflowy/generated/locale_keys.g.dart'; import 'package:appflowy/startup/tasks/rust_sdk.dart'; +import 'package:appflowy/util/theme_extension.dart'; import 'package:appflowy/workspace/presentation/home/toast.dart'; import 'package:appflowy/workspace/presentation/widgets/pop_up_action.dart'; import 'package:appflowy_popover/appflowy_popover.dart'; import 'package:device_info_plus/device_info_plus.dart'; import 'package:easy_localization/easy_localization.dart'; -import 'package:flowy_infra/size.dart'; -import 'package:flowy_infra_ui/style_widget/button.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:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -21,9 +21,8 @@ class QuestionBubble extends StatelessWidget { @override Widget build(BuildContext context) { - return const SizedBox( - width: 30, - height: 30, + return const SizedBox.square( + dimension: 36.0, child: BubbleActionList(), ); } @@ -61,24 +60,55 @@ class _BubbleActionListState extends State { ); actions.add(FlowyVersionDescription()); + final (color, borderColor, shadowColor, iconColor) = + Theme.of(context).isLightMode + ? ( + Colors.white, + const Color(0x2D454849), + const Color(0x14000000), + Colors.black, + ) + : ( + const Color(0xFF242B37), + const Color(0x2DFFFFFF), + const Color(0x14000000), + Colors.white, + ); + return PopoverActionList( direction: PopoverDirection.topWithRightAligned, actions: actions, offset: const Offset(0, -8), buildChild: (controller) { - return FlowyTextButton( - '?', - tooltip: LocaleKeys.questionBubble_help.tr(), - fontWeight: FontWeight.w600, - fontColor: fontColor, - fillColor: fillColor, - hoverColor: Theme.of(context).colorScheme.primary, - mainAxisAlignment: MainAxisAlignment.center, - radius: Corners.s10Border, - onPressed: () { - toggle(); - controller.show(); - }, + return FlowyTooltip( + message: LocaleKeys.questionBubble_help.tr(), + child: MouseRegion( + cursor: SystemMouseCursors.click, + child: GestureDetector( + child: Container( + padding: const EdgeInsets.all(10.0), + decoration: ShapeDecoration( + color: color, + shape: RoundedRectangleBorder( + side: BorderSide(width: 0.50, color: borderColor), + borderRadius: BorderRadius.circular(18), + ), + shadows: [ + BoxShadow( + color: shadowColor, + blurRadius: 20, + offset: const Offset(0, 8), + ), + ], + ), + child: FlowySvg( + FlowySvgs.help_center_s, + color: iconColor, + ), + ), + onTap: () => controller.show(), + ), + ), ); }, onClosed: toggle, diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/widgets/pop_up_action.dart b/frontend/appflowy_flutter/lib/workspace/presentation/widgets/pop_up_action.dart index d4103cc6bf..6abc789223 100644 --- a/frontend/appflowy_flutter/lib/workspace/presentation/widgets/pop_up_action.dart +++ b/frontend/appflowy_flutter/lib/workspace/presentation/widgets/pop_up_action.dart @@ -245,9 +245,10 @@ class HoverButton extends StatelessWidget { HSpace(ActionListSizes.itemHPadding), ], Expanded( - child: FlowyText.medium( + child: FlowyText.regular( name, overflow: TextOverflow.visible, + lineHeight: 1.15, ), ), if (rightIcon != null) ...[ diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/widgets/view_title_bar.dart b/frontend/appflowy_flutter/lib/workspace/presentation/widgets/view_title_bar.dart index b3eddfb52b..18dc91de58 100644 --- a/frontend/appflowy_flutter/lib/workspace/presentation/widgets/view_title_bar.dart +++ b/frontend/appflowy_flutter/lib/workspace/presentation/widgets/view_title_bar.dart @@ -33,6 +33,7 @@ class ViewTitleBar extends StatelessWidget { return const SizedBox.shrink(); } return SingleChildScrollView( + scrollDirection: Axis.horizontal, child: SizedBox( height: 24, child: Row(children: _buildViewTitles(context, ancestors)), @@ -165,11 +166,14 @@ class _ViewTitleState extends State<_ViewTitle> { Widget _buildUnEditableViewTitle(BuildContext context, ViewTitleState state) { return Listener( onPointerDown: (_) => context.read().openPlugin(widget.view), - child: FlowyButton( - useIntrinsicWidth: true, - margin: const EdgeInsets.symmetric(horizontal: 6.0), - onTap: () {}, - text: _buildIconAndName(state), + child: SizedBox( + height: 32.0, + child: FlowyButton( + useIntrinsicWidth: true, + margin: const EdgeInsets.symmetric(horizontal: 6.0), + onTap: () {}, + text: _buildIconAndName(state, false), + ), ), ); } @@ -194,15 +198,18 @@ class _ViewTitleState extends State<_ViewTitle> { emoji: state.icon, ); }, - child: FlowyButton( - useIntrinsicWidth: true, - margin: const EdgeInsets.symmetric(horizontal: 6.0), - text: _buildIconAndName(state), + child: SizedBox( + height: 32.0, + child: FlowyButton( + useIntrinsicWidth: true, + margin: const EdgeInsets.symmetric(horizontal: 6.0), + text: _buildIconAndName(state, true), + ), ), ); } - Widget _buildIconAndName(ViewTitleState state) { + Widget _buildIconAndName(ViewTitleState state, bool isEditable) { return SingleChildScrollView( child: Row( children: [ @@ -211,10 +218,10 @@ class _ViewTitleState extends State<_ViewTitle> { state.icon, fontSize: 14.0, ), - const HSpace(6.0), + const HSpace(4.0), ], - ConstrainedBox( - constraints: const BoxConstraints(), + Opacity( + opacity: isEditable ? 1.0 : 0.5, child: FlowyText.regular( state.name, overflow: TextOverflow.ellipsis, diff --git a/frontend/appflowy_flutter/packages/flowy_infra/lib/colorscheme/default_colorscheme.dart b/frontend/appflowy_flutter/packages/flowy_infra/lib/colorscheme/default_colorscheme.dart index 8f7120fa84..81142383c1 100644 --- a/frontend/appflowy_flutter/packages/flowy_infra/lib/colorscheme/default_colorscheme.dart +++ b/frontend/appflowy_flutter/packages/flowy_infra/lib/colorscheme/default_colorscheme.dart @@ -6,19 +6,19 @@ const _white = Color(0xFFFFFFFF); const _lightHover = Color(0xFFe0f8FF); const _lightSelector = Color(0xFFf2fcFF); const _lightBg1 = Color(0xFFf7f8fc); -const _lightBg2 = Color(0xFFedeef2); +const _lightBg2 = Color(0x0F1F2329); const _lightShader1 = Color(0xFF333333); const _lightShader3 = Color(0xFF828282); const _lightShader5 = Color(0xFFe0e0e0); const _lightShader6 = Color(0xFFf2f2f2); const _lightMain1 = Color(0xFF00bcf0); const _lightTint9 = Color(0xFFe1fbFF); -const _darkShader1 = Color(0xE5FFFFFF); +const _darkShader1 = Color(0xFF131720); const _darkShader2 = Color(0xFF1A202C); const _darkShader3 = Color(0xFF363D49); const _darkShader5 = Color(0xFFBBC3CD); const _darkShader6 = Color(0xFFF2F2F2); -const _darkMain1 = Color(0x19FFFFFF); +const _darkMain1 = Color(0xFF00BCF0); const _darkMain2 = Color(0xFF00BCF0); const _darkInput = Color(0xFF282E3A); diff --git a/frontend/appflowy_flutter/packages/flowy_infra_ui/lib/style_widget/text.dart b/frontend/appflowy_flutter/packages/flowy_infra_ui/lib/style_widget/text.dart index 10065b3dc7..d5d04ddb98 100644 --- a/frontend/appflowy_flutter/packages/flowy_infra_ui/lib/style_widget/text.dart +++ b/frontend/appflowy_flutter/packages/flowy_infra_ui/lib/style_widget/text.dart @@ -166,7 +166,6 @@ class FlowyText extends StatelessWidget { text, maxLines: maxLines, textAlign: textAlign, - strutStyle: strutStyle, style: textStyle, ); } else { diff --git a/frontend/appflowy_flutter/packages/flowy_infra_ui/lib/widget/flowy_tooltip.dart b/frontend/appflowy_flutter/packages/flowy_infra_ui/lib/widget/flowy_tooltip.dart index 57874fad64..382b18fc0e 100644 --- a/frontend/appflowy_flutter/packages/flowy_infra_ui/lib/widget/flowy_tooltip.dart +++ b/frontend/appflowy_flutter/packages/flowy_infra_ui/lib/widget/flowy_tooltip.dart @@ -25,6 +25,7 @@ class FlowyTooltip extends StatelessWidget { final isLightMode = Theme.of(context).brightness == Brightness.light; return Tooltip( margin: margin, + padding: const EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0), decoration: BoxDecoration( color: isLightMode ? const Color(0xE5171717) : const Color(0xE5E5E5E5), borderRadius: BorderRadius.circular(8.0), diff --git a/frontend/appflowy_flutter/packages/flowy_svg/lib/src/flowy_svg.dart b/frontend/appflowy_flutter/packages/flowy_svg/lib/src/flowy_svg.dart index baf08538b8..aa70ee9d1f 100644 --- a/frontend/appflowy_flutter/packages/flowy_svg/lib/src/flowy_svg.dart +++ b/frontend/appflowy_flutter/packages/flowy_svg/lib/src/flowy_svg.dart @@ -23,6 +23,7 @@ class FlowySvg extends StatelessWidget { this.size, this.color, this.blendMode = BlendMode.srcIn, + this.opacity = 1.0, }); /// The data for the flowy svg. Will be generated by the generator in this @@ -46,11 +47,16 @@ class FlowySvg extends StatelessWidget { /// svg widget. final BlendMode? blendMode; + /// The opacity of the svg + /// + /// The default value is 1.0 + final double opacity; + @override Widget build(BuildContext context) { - final iconColor = color ?? Theme.of(context).iconTheme.color; + final iconColor = + (color ?? Theme.of(context).iconTheme.color)?.withOpacity(opacity); final textScaleFactor = MediaQuery.textScalerOf(context).scale(1); - return Transform.scale( scale: textScaleFactor, child: SizedBox( diff --git a/frontend/resources/flowy_icons/16x/favorited.svg b/frontend/resources/flowy_icons/16x/favorited.svg new file mode 100644 index 0000000000..a17f7548cd --- /dev/null +++ b/frontend/resources/flowy_icons/16x/favorited.svg @@ -0,0 +1,3 @@ + + + diff --git a/frontend/resources/flowy_icons/16x/help_center.svg b/frontend/resources/flowy_icons/16x/help_center.svg new file mode 100644 index 0000000000..52766922e9 --- /dev/null +++ b/frontend/resources/flowy_icons/16x/help_center.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/frontend/resources/flowy_icons/16x/icon_board.svg b/frontend/resources/flowy_icons/16x/icon_board.svg new file mode 100644 index 0000000000..9133d535b5 --- /dev/null +++ b/frontend/resources/flowy_icons/16x/icon_board.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/frontend/resources/flowy_icons/16x/icon_calendar.svg b/frontend/resources/flowy_icons/16x/icon_calendar.svg new file mode 100644 index 0000000000..ca65315d3c --- /dev/null +++ b/frontend/resources/flowy_icons/16x/icon_calendar.svg @@ -0,0 +1,3 @@ + + + diff --git a/frontend/resources/flowy_icons/16x/icon_document.svg b/frontend/resources/flowy_icons/16x/icon_document.svg new file mode 100644 index 0000000000..75acd9a2a3 --- /dev/null +++ b/frontend/resources/flowy_icons/16x/icon_document.svg @@ -0,0 +1,4 @@ + + + + diff --git a/frontend/resources/flowy_icons/16x/icon_grid.svg b/frontend/resources/flowy_icons/16x/icon_grid.svg new file mode 100644 index 0000000000..a167a4a6ad --- /dev/null +++ b/frontend/resources/flowy_icons/16x/icon_grid.svg @@ -0,0 +1,3 @@ + + + diff --git a/frontend/resources/flowy_icons/16x/icon_import.svg b/frontend/resources/flowy_icons/16x/icon_import.svg new file mode 100644 index 0000000000..bc8d7c7b72 --- /dev/null +++ b/frontend/resources/flowy_icons/16x/icon_import.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/frontend/resources/flowy_icons/16x/workspace_drop_down_menu_hide.svg b/frontend/resources/flowy_icons/16x/workspace_drop_down_menu_hide.svg index d264b4734e..f6c5884f5b 100644 --- a/frontend/resources/flowy_icons/16x/workspace_drop_down_menu_hide.svg +++ b/frontend/resources/flowy_icons/16x/workspace_drop_down_menu_hide.svg @@ -1,8 +1,3 @@ - - - - - - - + + diff --git a/frontend/resources/flowy_icons/16x/workspace_drop_down_menu_show.svg b/frontend/resources/flowy_icons/16x/workspace_drop_down_menu_show.svg index 4682de7aa7..80ce09be81 100644 --- a/frontend/resources/flowy_icons/16x/workspace_drop_down_menu_show.svg +++ b/frontend/resources/flowy_icons/16x/workspace_drop_down_menu_show.svg @@ -1,8 +1,3 @@ - - - - - - - + + diff --git a/frontend/resources/flowy_icons/24x/favorite_header_icon.svg b/frontend/resources/flowy_icons/24x/favorite_header_icon.svg new file mode 100644 index 0000000000..5b0ddbb6c5 --- /dev/null +++ b/frontend/resources/flowy_icons/24x/favorite_header_icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/frontend/resources/flowy_icons/24x/new_app.svg b/frontend/resources/flowy_icons/24x/new_app.svg new file mode 100644 index 0000000000..77b11173d8 --- /dev/null +++ b/frontend/resources/flowy_icons/24x/new_app.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/frontend/resources/flowy_icons/24x/sidebar_footer_trash.svg b/frontend/resources/flowy_icons/24x/sidebar_footer_trash.svg new file mode 100644 index 0000000000..02122ae127 --- /dev/null +++ b/frontend/resources/flowy_icons/24x/sidebar_footer_trash.svg @@ -0,0 +1,9 @@ + + + + + + + + +