Skip to content

Commit a4a2a5f

Browse files
committed
fix: the settings view of path configuration is not displayed completely
1 parent 3858836 commit a4a2a5f

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
@@ -41,6 +41,7 @@ class SettingsFileLocationCustomzierState
4141
title: FlowyText.regular(
4242
LocaleKeys.settings_files_defaultLocation.tr(),
4343
fontSize: 15.0,
44+
overflow: TextOverflow.ellipsis,
4445
),
4546
subtitle: Tooltip(
4647
message: LocaleKeys.settings_files_doubleTapToCopy.tr(),
@@ -53,6 +54,7 @@ class SettingsFileLocationCustomzierState
5354
child: FlowyText.regular(
5455
state.path ?? '',
5556
fontSize: 10.0,
57+
overflow: TextOverflow.ellipsis,
5658
),
5759
),
5860
),

0 commit comments

Comments
 (0)