diff --git a/assets/linux/alpine.png b/assets/linux/alpine.png deleted file mode 100644 index e4e388ab..00000000 Binary files a/assets/linux/alpine.png and /dev/null differ diff --git a/assets/linux/arch.png b/assets/linux/arch.png deleted file mode 100644 index 23d9c257..00000000 Binary files a/assets/linux/arch.png and /dev/null differ diff --git a/assets/linux/armbian.png b/assets/linux/armbian.png deleted file mode 100644 index 83adef2c..00000000 Binary files a/assets/linux/armbian.png and /dev/null differ diff --git a/assets/linux/centos.png b/assets/linux/centos.png deleted file mode 100644 index 64bee1cd..00000000 Binary files a/assets/linux/centos.png and /dev/null differ diff --git a/assets/linux/debian.png b/assets/linux/debian.png deleted file mode 100644 index a8d26f30..00000000 Binary files a/assets/linux/debian.png and /dev/null differ diff --git a/assets/linux/fedora.png b/assets/linux/fedora.png deleted file mode 100644 index 85359fd8..00000000 Binary files a/assets/linux/fedora.png and /dev/null differ diff --git a/assets/linux/kali.png b/assets/linux/kali.png deleted file mode 100644 index 4b2887e3..00000000 Binary files a/assets/linux/kali.png and /dev/null differ diff --git a/assets/linux/linux.psd b/assets/linux/linux.psd deleted file mode 100644 index 5958139d..00000000 Binary files a/assets/linux/linux.psd and /dev/null differ diff --git a/assets/linux/opensuse.png b/assets/linux/opensuse.png deleted file mode 100644 index 6186fba5..00000000 Binary files a/assets/linux/opensuse.png and /dev/null differ diff --git a/assets/linux/rocky.png b/assets/linux/rocky.png deleted file mode 100644 index 19bc0e33..00000000 Binary files a/assets/linux/rocky.png and /dev/null differ diff --git a/assets/linux/ubuntu.png b/assets/linux/ubuntu.png deleted file mode 100644 index d22b8346..00000000 Binary files a/assets/linux/ubuntu.png and /dev/null differ diff --git a/assets/linux/wrt.png b/assets/linux/wrt.png deleted file mode 100644 index bb4f7aaf..00000000 Binary files a/assets/linux/wrt.png and /dev/null differ diff --git a/lib/data/model/server/dist.dart b/lib/data/model/server/dist.dart index 6271d115..06fd0357 100644 --- a/lib/data/model/server/dist.dart +++ b/lib/data/model/server/dist.dart @@ -10,10 +10,6 @@ enum Dist { arch, alpine, rocky; - - String get iconPath { - return 'assets/linux/$name.png'; - } } extension StringX on String { diff --git a/lib/data/provider/virtual_keyboard.dart b/lib/data/provider/virtual_keyboard.dart index 39e17128..5f02efe4 100644 --- a/lib/data/provider/virtual_keyboard.dart +++ b/lib/data/provider/virtual_keyboard.dart @@ -14,6 +14,7 @@ class VirtualKeyboard extends TerminalInputHandler with ChangeNotifier { notifyListeners(); } } + bool _alt = false; bool get alt => _alt; set alt(bool value) { diff --git a/lib/view/page/server/detail.dart b/lib/view/page/server/detail.dart index e1d0f2f4..b9474a1e 100644 --- a/lib/view/page/server/detail.dart +++ b/lib/view/page/server/detail.dart @@ -4,7 +4,6 @@ import 'package:provider/provider.dart'; import 'package:toolbox/core/extension/order.dart'; import 'package:toolbox/data/model/server/cpu.dart'; import 'package:toolbox/data/model/server/disk.dart'; -import 'package:toolbox/data/model/server/dist.dart'; import 'package:toolbox/data/model/server/memory.dart'; import 'package:toolbox/data/model/server/temp.dart'; @@ -77,7 +76,6 @@ class _ServerDetailPageState extends State _cardsOrder.move(oldIndex, newIndex, _setting.detailCardOrder); }); }, - header: _buildLinuxIcon(si.status.sysVer), footer: height13, children: _buildMainList(si.status), ), @@ -102,23 +100,6 @@ class _ServerDetailPageState extends State .toList(); } - Widget _buildLinuxIcon(String sysVer) { - if (!_setting.showDistLogo.fetch()!) return placeholder; - final iconPath = sysVer.dist?.iconPath; - if (iconPath == null) return placeholder; - return ConstrainedBox( - constraints: BoxConstraints( - maxHeight: _media.size.height * 0.13, - maxWidth: _media.size.width * 0.6, - ), - child: Image.asset( - iconPath, - fit: BoxFit.contain, - semanticLabel: _s.showDistLogo, - ), - ); - } - Widget _buildCPUView(Cpus cs) { return RoundRectCard( Padding( diff --git a/lib/view/page/setting.dart b/lib/view/page/setting.dart index 4e9da791..15e76a0f 100644 --- a/lib/view/page/setting.dart +++ b/lib/view/page/setting.dart @@ -305,23 +305,26 @@ class _SettingPageState extends State { onTap: () { startPageKey.currentState?.showButtonMenu(); }, - trailing: ValueBuilder(listenable: _launchPageIdx, build: () => PopupMenuButton( - key: startPageKey, - itemBuilder: (BuildContext context) => items, - initialValue: _launchPageIdx.value, - onSelected: (int idx) { - _launchPageIdx.value = idx; - _setting.launchPage.put(_launchPageIdx.value); - }, - child: ConstrainedBox( - constraints: BoxConstraints(maxWidth: _media.size.width * 0.35), - child: Text( - tabTitleName(context, AppTab.values[_launchPageIdx.value]), - textAlign: TextAlign.right, - style: textSize15, - ), - ), - )), + trailing: ValueBuilder( + listenable: _launchPageIdx, + build: () => PopupMenuButton( + key: startPageKey, + itemBuilder: (BuildContext context) => items, + initialValue: _launchPageIdx.value, + onSelected: (int idx) { + _launchPageIdx.value = idx; + _setting.launchPage.put(_launchPageIdx.value); + }, + child: ConstrainedBox( + constraints: + BoxConstraints(maxWidth: _media.size.width * 0.35), + child: Text( + tabTitleName(context, AppTab.values[_launchPageIdx.value]), + textAlign: TextAlign.right, + style: textSize15, + ), + ), + )), ); } @@ -346,19 +349,22 @@ class _SettingPageState extends State { onTap: () { maxRetryKey.currentState?.showButtonMenu(); }, - trailing: ValueBuilder(build: () => PopupMenuButton( - key: maxRetryKey, - itemBuilder: (BuildContext context) => items, - initialValue: _maxRetryCount.value, - onSelected: (int val) { - _maxRetryCount.value = val; - _setting.maxRetryCount.put(_maxRetryCount.value); - }, - child: Text( - '${_maxRetryCount.value} ${_s.times}', - style: textSize15, + trailing: ValueBuilder( + build: () => PopupMenuButton( + key: maxRetryKey, + itemBuilder: (BuildContext context) => items, + initialValue: _maxRetryCount.value, + onSelected: (int val) { + _maxRetryCount.value = val; + _setting.maxRetryCount.put(_maxRetryCount.value); + }, + child: Text( + '${_maxRetryCount.value} ${_s.times}', + style: textSize15, + ), ), - ), listenable: _maxRetryCount,), + listenable: _maxRetryCount, + ), ); } @@ -382,19 +388,22 @@ class _SettingPageState extends State { onTap: () { themeKey.currentState?.showButtonMenu(); }, - trailing: ValueBuilder(listenable: _nightMode, build: () => PopupMenuButton( - key: themeKey, - itemBuilder: (BuildContext context) => items, - initialValue: _nightMode.value, - onSelected: (int idx) { - _nightMode.value = idx; - _setting.themeMode.put(_nightMode.value); - }, - child: Text( - _buildThemeModeStr(_nightMode.value), - style: textSize15, + trailing: ValueBuilder( + listenable: _nightMode, + build: () => PopupMenuButton( + key: themeKey, + itemBuilder: (BuildContext context) => items, + initialValue: _nightMode.value, + onSelected: (int idx) { + _nightMode.value = idx; + _setting.themeMode.put(_nightMode.value); + }, + child: Text( + _buildThemeModeStr(_nightMode.value), + style: textSize15, + ), ), - ),), + ), ); } @@ -516,40 +525,44 @@ class _SettingPageState extends State { } Widget _buildTermFontSize() { - return ValueBuilder(listenable: _fontSize, build: () => ListTile( - title: Text(_s.fontSize), - trailing: Text( - _fontSize.value.toString(), - style: textSize15, - ), - onTap: () { - final ctrller = TextEditingController(text: _fontSize.value.toString()); - showRoundDialog( - context: context, - title: Text(_s.fontSize), - child: Input( - controller: ctrller, - type: TextInputType.number, - icon: Icons.font_download, - ), - actions: [ - TextButton( - onPressed: () { - context.pop(); - final fontSize = double.tryParse(ctrller.text); - if (fontSize == null) { - showRoundDialog(context: context, child: Text(_s.failed)); - return; - } - _fontSize.value = fontSize; - _setting.termFontSize.put(_fontSize.value); - }, - child: Text(_s.ok), + return ValueBuilder( + listenable: _fontSize, + build: () => ListTile( + title: Text(_s.fontSize), + trailing: Text( + _fontSize.value.toString(), + style: textSize15, + ), + onTap: () { + final ctrller = + TextEditingController(text: _fontSize.value.toString()); + showRoundDialog( + context: context, + title: Text(_s.fontSize), + child: Input( + controller: ctrller, + type: TextInputType.number, + icon: Icons.font_download, ), - ], - ); - }, - ),); + actions: [ + TextButton( + onPressed: () { + context.pop(); + final fontSize = double.tryParse(ctrller.text); + if (fontSize == null) { + showRoundDialog(context: context, child: Text(_s.failed)); + return; + } + _fontSize.value = fontSize; + _setting.termFontSize.put(_fontSize.value); + }, + child: Text(_s.ok), + ), + ], + ); + }, + ), + ); } Widget _buildDiskIgnorePath() { @@ -602,20 +615,22 @@ class _SettingPageState extends State { onTap: () { localeKey.currentState?.showButtonMenu(); }, - trailing: ValueBuilder(listenable: _localeCode, build: () => PopupMenuButton( - key: localeKey, - itemBuilder: (BuildContext context) => items, - initialValue: _localeCode.value, - onSelected: (String idx) { - _localeCode.value = idx; - _setting.locale.put(idx); - _showRestartSnackbar(); - }, - child: Text( - _s.languageName, - style: textSize15, - ), - )), + trailing: ValueBuilder( + listenable: _localeCode, + build: () => PopupMenuButton( + key: localeKey, + itemBuilder: (BuildContext context) => items, + initialValue: _localeCode.value, + onSelected: (String idx) { + _localeCode.value = idx; + _setting.locale.put(idx); + _showRestartSnackbar(); + }, + child: Text( + _s.languageName, + style: textSize15, + ), + )), ); } @@ -638,19 +653,22 @@ class _SettingPageState extends State { ).toList(); return ListTile( title: Text("${_s.editor} ${_s.theme}"), - trailing: ValueBuilder(listenable: _editorTheme, build: () => PopupMenuButton( - key: editorThemeKey, - itemBuilder: (BuildContext context) => items, - initialValue: _editorTheme.value, - onSelected: (String idx) { - _editorTheme.value = idx; - _setting.editorTheme.put(idx); - }, - child: Text( - _editorTheme.value, - style: textSize15, + trailing: ValueBuilder( + listenable: _editorTheme, + build: () => PopupMenuButton( + key: editorThemeKey, + itemBuilder: (BuildContext context) => items, + initialValue: _editorTheme.value, + onSelected: (String idx) { + _editorTheme.value = idx; + _setting.editorTheme.put(idx); + }, + child: Text( + _editorTheme.value, + style: textSize15, + ), ), - ),), + ), onTap: () { editorThemeKey.currentState?.showButtonMenu(); }, diff --git a/pubspec.yaml b/pubspec.yaml index 725f3a27..10e468c3 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -95,7 +95,6 @@ flutter: # To add assets to your application, add an assets section, like this: assets: - assets/app_icon.png - - assets/linux/ # - images/a_dot_burr.jpeg # - images/a_dot_ham.jpeg # An image asset can refer to one or more resolution-specific "variants", see