feat (Editor): Add an option to set the editor font family (#1078)
* feat (Editor): Add an option to set the editor font family Add the `editorFontFamily` property to the settings storage and implement font family selection functionality on editor-related pages. Also, update all pages that use the editor settings to support the newly added font family option. * refactor(editor): Optimize the logic for editor font settings Standardize the method for retrieving font settings on the editor page to avoid redundant calls to the `fetch()` method. Extract the font retrieval logic into variables or anonymous functions to improve code readability and performance.
This commit is contained in:
@@ -11,7 +11,7 @@ import 'package:server_box/data/model/sftp/worker.dart';
|
||||
import 'package:server_box/data/provider/server/all.dart';
|
||||
import 'package:server_box/data/provider/sftp.dart';
|
||||
import 'package:server_box/data/res/misc.dart';
|
||||
import 'package:server_box/data/store/setting.dart';
|
||||
import 'package:server_box/data/res/store.dart';
|
||||
import 'package:server_box/view/page/storage/sftp.dart';
|
||||
import 'package:server_box/view/page/storage/sftp_mission.dart';
|
||||
|
||||
@@ -366,9 +366,13 @@ extension _OnTapFile on _LocalFilePageState {
|
||||
context.showSnackBar(libL10n.saved);
|
||||
setStateSafe(() {});
|
||||
},
|
||||
closeAfterSave: SettingStore.instance.closeAfterSave.fetch(),
|
||||
softWrap: SettingStore.instance.editorSoftWrap.fetch(),
|
||||
enableHighlight: SettingStore.instance.editorHighlight.fetch(),
|
||||
closeAfterSave: Stores.setting.closeAfterSave.fetch(),
|
||||
softWrap: Stores.setting.editorSoftWrap.fetch(),
|
||||
enableHighlight: Stores.setting.editorHighlight.fetch(),
|
||||
fontFamily: () {
|
||||
final font = Stores.setting.editorFontFamily.fetch();
|
||||
return font.isEmpty ? null : font;
|
||||
}(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user