fix: the settings view of path configuration is not displayed completely

This commit is contained in:
Lucas.Xu 2023-01-04 15:10:11 +08:00
parent 515cd50ac4
commit 2006d35a50
2 changed files with 17 additions and 3 deletions

View File

@ -12,10 +12,22 @@ const String kSettingsLocationDefaultLocation =
class SettingsLocation {
SettingsLocation({
this.path,
});
String? path,
}) : _path = path;
String? path;
String? _path;
set path(String? path) {
_path = path;
}
String? get path {
if (Platform.isMacOS) {
// remove the prefix `/Volumes/Macintosh HD/Users/`
return _path?.replaceFirst('/Volumes/Macintosh HD/Users', '');
}
return _path;
}
SettingsLocation copyWith({String? path}) {
return SettingsLocation(

View File

@ -40,6 +40,7 @@ class SettingsFileLocationCustomzierState
title: FlowyText.regular(
LocaleKeys.settings_files_defaultLocation.tr(),
fontSize: 15.0,
overflow: TextOverflow.ellipsis,
),
subtitle: Tooltip(
message: LocaleKeys.settings_files_doubleTapToCopy.tr(),
@ -52,6 +53,7 @@ class SettingsFileLocationCustomzierState
child: FlowyText.regular(
state.path ?? '',
fontSize: 10.0,
overflow: TextOverflow.ellipsis,
),
),
),