fix: the settings view of path configuration is not displayed completely (#1647)

This commit is contained in:
Lucas.Xu 2023-01-04 19:41:31 +08:00 committed by GitHub
parent d8958e82c8
commit 340f27cf87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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,
),
),
),