From 2331b328d80a62379ae0030dd3d6877f5d2a4b7c Mon Sep 17 00:00:00 2001 From: Richard Shiue <71320345+richardshiue@users.noreply.github.com> Date: Mon, 3 Oct 2022 09:58:13 +0800 Subject: [PATCH] feat: elide sidebar text (#1026) --- .../presentation/home/menu/app/header/header.dart | 1 + .../workspace/presentation/home/menu/app/section/item.dart | 2 +- .../lib/workspace/presentation/home/menu/menu_user.dart | 7 ++++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/frontend/app_flowy/lib/workspace/presentation/home/menu/app/header/header.dart b/frontend/app_flowy/lib/workspace/presentation/home/menu/app/header/header.dart index 727b18762b..5724262aa5 100644 --- a/frontend/app_flowy/lib/workspace/presentation/home/menu/app/header/header.dart +++ b/frontend/app_flowy/lib/workspace/presentation/home/menu/app/header/header.dart @@ -99,6 +99,7 @@ class MenuAppHeader extends StatelessWidget { app.name, fontSize: 12, color: theme.textColor, + overflow: TextOverflow.ellipsis, ), ), ), diff --git a/frontend/app_flowy/lib/workspace/presentation/home/menu/app/section/item.dart b/frontend/app_flowy/lib/workspace/presentation/home/menu/app/section/item.dart index 083f7b55db..195c82adcd 100644 --- a/frontend/app_flowy/lib/workspace/presentation/home/menu/app/section/item.dart +++ b/frontend/app_flowy/lib/workspace/presentation/home/menu/app/section/item.dart @@ -82,7 +82,7 @@ class ViewSectionItem extends StatelessWidget { child: FlowyText.regular( state.view.name, fontSize: 12, - overflow: TextOverflow.clip, + overflow: TextOverflow.ellipsis, ), ), ]; diff --git a/frontend/app_flowy/lib/workspace/presentation/home/menu/menu_user.dart b/frontend/app_flowy/lib/workspace/presentation/home/menu/menu_user.dart index 399bbd1f89..12a3114f42 100644 --- a/frontend/app_flowy/lib/workspace/presentation/home/menu/menu_user.dart +++ b/frontend/app_flowy/lib/workspace/presentation/home/menu/menu_user.dart @@ -28,8 +28,9 @@ class MenuUser extends StatelessWidget { children: [ _renderAvatar(context), const HSpace(10), - _renderUserName(context), - const Spacer(), + Expanded( + child: _renderUserName(context), + ), _renderSettingsButton(context), //ToDo: when the user is allowed to create another workspace, //we get the below block back @@ -63,7 +64,7 @@ class MenuUser extends StatelessWidget { if (name.isEmpty) { name = context.read().state.userProfile.email; } - return FlowyText(name, fontSize: 12); + return FlowyText(name, fontSize: 12, overflow: TextOverflow.ellipsis); } Widget _renderSettingsButton(BuildContext context) {