opt.: server batch delete & fullscreen

This commit is contained in:
lollipopkit
2023-12-20 14:02:59 +08:00
parent 6924290626
commit 7283c968ae
3 changed files with 12 additions and 36 deletions

View File

@@ -163,7 +163,7 @@ class SettingStore extends PersistentStore {
/// Otherwise, display them on the top of server detail page /// Otherwise, display them on the top of server detail page
late final moveOutServerTabFuncBtns = property( late final moveOutServerTabFuncBtns = property(
'moveOutServerTabFuncBtns', 'moveOutServerTabFuncBtns',
true, false,
); );
/// Whether use `rm -r` to delete directory on SFTP /// Whether use `rm -r` to delete directory on SFTP
@@ -199,10 +199,6 @@ class SettingStore extends PersistentStore {
/// Show tip of suspend /// Show tip of suspend
late final showSuspendTip = property('showSuspendTip', true); late final showSuspendTip = property('showSuspendTip', true);
/// Server func btns display name
late final serverFuncBtnsDisplayName =
property('serverFuncBtnsDisplayName', false);
/// Webdav sync /// Webdav sync
late final webdavSync = property('webdavSync', false); late final webdavSync = property('webdavSync', false);
late final webdavUrl = property('webdavUrl', ''); late final webdavUrl = property('webdavUrl', '');

View File

@@ -151,7 +151,9 @@ class _SettingPageState extends State<SettingPage> {
_buildSFTP(), _buildSFTP(),
_buildTitle(l10n.editor), _buildTitle(l10n.editor),
_buildEditor(), _buildEditor(),
if (isDesktop) _buildTitle(l10n.fullScreen), /// Fullscreen Mode is designed for old mobile phone which can be
/// used as a status screen, so it's only available on mobile phone.
if (!isDesktop) _buildTitle(l10n.fullScreen),
if (!isDesktop) _buildFullScreen(), if (!isDesktop) _buildFullScreen(),
const SizedBox(height: 37), const SizedBox(height: 37),
], ],
@@ -901,7 +903,9 @@ class _SettingPageState extends State<SettingPage> {
title: Text(l10n.choose), title: Text(l10n.choose),
child: SingleChildScrollView( child: SingleChildScrollView(
child: StatefulBuilder(builder: (ctx, setState) { child: StatefulBuilder(builder: (ctx, setState) {
final all = Stores.server.box.keys.map( final keys = Stores.server.box.keys.toList();
keys.removeWhere((element) => element == BoxX.lastModifiedKey);
final all = keys.map(
(e) => TextButton( (e) => TextButton(
onPressed: () => context.showRoundDialog( onPressed: () => context.showRoundDialog(
title: Text(l10n.attention), title: Text(l10n.attention),
@@ -978,24 +982,10 @@ class _SettingPageState extends State<SettingPage> {
} }
Widget _buildServerFuncBtns() { Widget _buildServerFuncBtns() {
return ExpandTile( return ListTile(
title: Text(l10n.serverFuncBtns),
subtitle: Text(
'${l10n.location} / ${l10n.displayName}',
style: UIs.textSize13Grey,
),
children: [
ListTile(
title: Text(l10n.location), title: Text(l10n.location),
subtitle: subtitle: Text(l10n.moveOutServerFuncBtnsHelp, style: UIs.textSize13Grey),
Text(l10n.moveOutServerFuncBtnsHelp, style: UIs.textSize13Grey),
trailing: StoreSwitch(prop: _setting.moveOutServerTabFuncBtns), trailing: StoreSwitch(prop: _setting.moveOutServerTabFuncBtns),
),
ListTile(
title: Text(l10n.displayName),
trailing: StoreSwitch(prop: _setting.serverFuncBtnsDisplayName),
),
],
); );
} }

View File

@@ -14,7 +14,6 @@ import 'package:toolbox/data/model/pkg/manager.dart';
import 'package:toolbox/data/model/server/dist.dart'; import 'package:toolbox/data/model/server/dist.dart';
import 'package:toolbox/data/res/path.dart'; import 'package:toolbox/data/res/path.dart';
import 'package:toolbox/data/res/provider.dart'; import 'package:toolbox/data/res/provider.dart';
import 'package:toolbox/data/res/store.dart';
import '../../core/route.dart'; import '../../core/route.dart';
import '../../core/utils/server.dart'; import '../../core/utils/server.dart';
@@ -100,16 +99,7 @@ class ServerFuncBtns extends StatelessWidget {
onPressed: () => _onTapMoreBtns(e, spi, context), onPressed: () => _onTapMoreBtns(e, spi, context),
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
tooltip: e.name, tooltip: e.name,
icon: Stores.setting.serverFuncBtnsDisplayName.fetch() icon: Icon(e.icon, size: iconSize ?? 15),
? Column(
children: [
Icon(e.icon, size: iconSize ?? 15),
Text(e.toStr,
style: const TextStyle(
fontSize: 7, color: Colors.grey))
],
)
: Icon(e.icon, size: iconSize ?? 15),
), ),
) )
.toList(), .toList(),