Skip to content

Commit 340f27c

Browse files
authored
fix: the settings view of path configuration is not displayed completely (#1647)
1 parent d8958e8 commit 340f27c

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

frontend/app_flowy/lib/workspace/application/settings/settings_location_cubit.dart

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,22 @@ const String kSettingsLocationDefaultLocation =
1212

1313
class SettingsLocation {
1414
SettingsLocation({
15-
this.path,
16-
});
15+
String? path,
16+
}) : _path = path;
1717

18-
String? path;
18+
String? _path;
19+
20+
set path(String? path) {
21+
_path = path;
22+
}
23+
24+
String? get path {
25+
if (Platform.isMacOS) {
26+
// remove the prefix `/Volumes/Macintosh HD/Users/`
27+
return _path?.replaceFirst('/Volumes/Macintosh HD/Users', '');
28+
}
29+
return _path;
30+
}
1931

2032
SettingsLocation copyWith({String? path}) {
2133
return SettingsLocation(

frontend/app_flowy/lib/workspace/presentation/settings/widgets/settings_file_customize_location_view.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class SettingsFileLocationCustomzierState
4040
title: FlowyText.regular(
4141
LocaleKeys.settings_files_defaultLocation.tr(),
4242
fontSize: 15.0,
43+
overflow: TextOverflow.ellipsis,
4344
),
4445
subtitle: Tooltip(
4546
message: LocaleKeys.settings_files_doubleTapToCopy.tr(),
@@ -52,6 +53,7 @@ class SettingsFileLocationCustomzierState
5253
child: FlowyText.regular(
5354
state.path ?? '',
5455
fontSize: 10.0,
56+
overflow: TextOverflow.ellipsis,
5557
),
5658
),
5759
),

0 commit comments

Comments
 (0)