opt.: ssh terminal ux (#778)
This commit is contained in:
@@ -9,8 +9,8 @@ extension _App on _AppSettingsPageState {
|
||||
_buildAppColor(),
|
||||
_buildCheckUpdate(),
|
||||
PlatformPublicSettings.buildBioAuth(),
|
||||
_buildAppMore(),
|
||||
if (specific != null) specific,
|
||||
_buildAppMore(),
|
||||
];
|
||||
|
||||
return Column(children: children.map((e) => e.cardx).toList());
|
||||
@@ -200,20 +200,6 @@ extension _App on _AppSettingsPageState {
|
||||
}
|
||||
}
|
||||
|
||||
Widget _buildTermFontSize() {
|
||||
return ListTile(
|
||||
leading: const Icon(MingCute.font_size_line),
|
||||
// title: Text(l10n.fontSize),
|
||||
// subtitle: Text(l10n.termFontSizeTip, style: UIs.textGrey),
|
||||
title: TipText(l10n.fontSize, l10n.termFontSizeTip),
|
||||
trailing: ValBuilder(
|
||||
listenable: _setting.termFontSize.listenable(),
|
||||
builder: (val) => Text(val.toString(), style: UIs.text15),
|
||||
),
|
||||
onTap: () => _showFontSizeDialog(_setting.termFontSize),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildLocale() {
|
||||
return ListTile(
|
||||
leading: const Icon(IonIcons.language),
|
||||
|
||||
@@ -90,23 +90,21 @@ extension _Editor on _AppSettingsPageState {
|
||||
title: Text(l10n.fontSize),
|
||||
trailing: ValBuilder(
|
||||
listenable: _setting.editorFontSize.listenable(),
|
||||
builder: (val) => Text(
|
||||
val.toString(),
|
||||
style: UIs.text15,
|
||||
),
|
||||
builder: (val) => Text(val.toString(), style: UIs.text15),
|
||||
),
|
||||
onTap: () => _showFontSizeDialog(_setting.editorFontSize),
|
||||
);
|
||||
}
|
||||
|
||||
void _showFontSizeDialog(HiveProp<double> property) {
|
||||
final ctrl = TextEditingController(text: property.fetch().toString());
|
||||
void onSave() {
|
||||
context.pop();
|
||||
final fontSize = double.tryParse(_editorTextSizeCtrl.text);
|
||||
final fontSize = double.tryParse(ctrl.text);
|
||||
if (fontSize == null) {
|
||||
context.showRoundDialog(
|
||||
title: libL10n.fail,
|
||||
child: Text('Parsed failed: ${_editorTextSizeCtrl.text}'),
|
||||
child: Text('Parsed failed: ${ctrl.text}'),
|
||||
);
|
||||
return;
|
||||
}
|
||||
@@ -116,7 +114,7 @@ extension _Editor on _AppSettingsPageState {
|
||||
context.showRoundDialog(
|
||||
title: l10n.fontSize,
|
||||
child: Input(
|
||||
controller: _editorTextSizeCtrl,
|
||||
controller: ctrl,
|
||||
autoFocus: true,
|
||||
type: TextInputType.number,
|
||||
icon: Icons.font_download,
|
||||
|
||||
@@ -79,6 +79,18 @@ extension _SSH on _AppSettingsPageState {
|
||||
RNodes.app.notify();
|
||||
}
|
||||
|
||||
Widget _buildTermFontSize() {
|
||||
return ListTile(
|
||||
leading: const Icon(MingCute.font_size_line),
|
||||
title: TipText(l10n.fontSize, l10n.termFontSizeTip),
|
||||
trailing: ValBuilder(
|
||||
listenable: _setting.termFontSize.listenable(),
|
||||
builder: (val) => Text(val.toString(), style: UIs.text15),
|
||||
),
|
||||
onTap: () => _showFontSizeDialog(_setting.termFontSize),
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _pickBgImage() async {
|
||||
final path = await Pfs.pickFilePath();
|
||||
if (path == null) return;
|
||||
|
||||
@@ -111,8 +111,6 @@ final class _AppSettingsPageState extends State<AppSettingsPage> {
|
||||
late final _sshOpacityCtrl = TextEditingController(text: _setting.sshBgOpacity.fetch().toString());
|
||||
late final _sshBlurCtrl = TextEditingController(text: _setting.sshBlurRadius.fetch().toString());
|
||||
late final _textScalerCtrl = TextEditingController(text: _setting.textFactor.toString());
|
||||
|
||||
late final _editorTextSizeCtrl = TextEditingController(text: _setting.editorFontSize.get().toString());
|
||||
late final _serverLogoCtrl = TextEditingController(text: _setting.serverLogoUrl.fetch());
|
||||
|
||||
@override
|
||||
|
||||
Reference in New Issue
Block a user