readd: double column on server page

This commit is contained in:
lollipopkit
2024-03-06 11:35:24 +08:00
parent 44a431c19f
commit 5baf683278
16 changed files with 49 additions and 17 deletions

View File

@@ -514,6 +514,12 @@ abstract class S {
/// **'Double column mode'**
String get doubleColumnMode;
/// No description provided for @doubleColumnTip.
///
/// In en, this message translates to:
/// **'This option only enables the feature, whether it can actually be enabled depends on the width of the device'**
String get doubleColumnTip;
/// No description provided for @download.
///
/// In en, this message translates to:

View File

@@ -221,6 +221,9 @@ class SDe extends S {
@override
String get doubleColumnMode => 'Doppelspaltiger Modus';
@override
String get doubleColumnTip => 'Diese Option aktiviert nur die Funktion, ob sie tatsächlich aktiviert werden kann, hängt auch von der Breite des Geräts ab';
@override
String get download => 'Download';

View File

@@ -221,6 +221,9 @@ class SEn extends S {
@override
String get doubleColumnMode => 'Double column mode';
@override
String get doubleColumnTip => 'This option only enables the feature, whether it can actually be enabled depends on the width of the device';
@override
String get download => 'Download';

View File

@@ -221,6 +221,9 @@ class SFr extends S {
@override
String get doubleColumnMode => 'Mode double colonne';
@override
String get doubleColumnTip => 'Cette option ne fait que activer la fonction, sa réalisation dépend également de la largeur de l\'appareil.';
@override
String get download => 'Télécharger';

View File

@@ -221,6 +221,9 @@ class SId extends S {
@override
String get doubleColumnMode => 'Mode kolom ganda';
@override
String get doubleColumnTip => 'Opsi ini hanya mengaktifkan fitur, apakah itu benar-benar dapat diaktifkan tergantung pada lebar perangkat';
@override
String get download => 'Unduh';

View File

@@ -221,6 +221,9 @@ class SZh extends S {
@override
String get doubleColumnMode => '双列模式';
@override
String get doubleColumnTip => '此选项仅开启功能,实际是否能开启还取决于设备的宽度';
@override
String get download => '下载';
@@ -1108,6 +1111,9 @@ class SZhTw extends SZh {
@override
String get doubleColumnMode => '雙列模式';
@override
String get doubleColumnTip => '此選項僅開啟功能,實際是否能開啟還取決於設備的寬度';
@override
String get download => '下載';

View File

@@ -43,12 +43,6 @@ class SettingStore extends PersistentStore {
late final diskIgnorePath =
property('diskIgnorePath', Defaults.diskIgnorePath);
/// Use double column servers page on Desktop
late final doubleColumnServersPage = property(
'doubleColumnServersPage',
isDesktop,
);
/// Disk view: amount / IO
late final serverTabPreferDiskAmount = property(
'serverTabPreferDiskAmount',
@@ -245,6 +239,12 @@ class SettingStore extends PersistentStore {
/// Result: use x86pkg_temp's temperature as the temperature
late final preferTemperatureDevs =
listProperty('preferTemperatureDevs', <String>[]);
/// Use double column servers page on Desktop
late final doubleColumnServersPage = property(
'doubleColumnServersPage',
true,
);
// Never show these settings for users
//

View File

@@ -69,6 +69,7 @@
"dockerStatusRunningAndStoppedFmt": "{runningCount} aktiv, {stoppedCount} container gestoppt.",
"dockerStatusRunningFmt": "{count} Container aktiv",
"doubleColumnMode": "Doppelspaltiger Modus",
"doubleColumnTip": "Diese Option aktiviert nur die Funktion, ob sie tatsächlich aktiviert werden kann, hängt auch von der Breite des Geräts ab",
"download": "Download",
"edit": "Bearbeiten",
"editVirtKeys": "Virtuelle Tasten bearbeiten",

View File

@@ -69,6 +69,7 @@
"dockerStatusRunningAndStoppedFmt": "{runningCount} running, {stoppedCount} container stopped.",
"dockerStatusRunningFmt": "{count} container running.",
"doubleColumnMode": "Double column mode",
"doubleColumnTip": "This option only enables the feature, whether it can actually be enabled depends on the width of the device",
"download": "Download",
"edit": "Edit",
"editVirtKeys": "Edit virtual keys",

View File

@@ -69,6 +69,7 @@
"dockerStatusRunningAndStoppedFmt": "{runningCount} en cours d'exécution, {stoppedCount} conteneurs arrêtés.",
"dockerStatusRunningFmt": "{count} conteneurs en cours d'exécution.",
"doubleColumnMode": "Mode double colonne",
"doubleColumnTip": "Cette option ne fait que activer la fonction, sa réalisation dépend également de la largeur de l'appareil.",
"download": "Télécharger",
"edit": "Modifier",
"editVirtKeys": "Modifier les touches virtuelles",

View File

@@ -69,6 +69,7 @@
"dockerStatusRunningAndStoppedFmt": "{runningCount} running, {stoppedCount} container stopped.",
"dockerStatusRunningFmt": "{count} wadah berjalan.",
"doubleColumnMode": "Mode kolom ganda",
"doubleColumnTip": "Opsi ini hanya mengaktifkan fitur, apakah itu benar-benar dapat diaktifkan tergantung pada lebar perangkat",
"download": "Unduh",
"edit": "Edit",
"editVirtKeys": "Edit kunci virtual",

View File

@@ -69,6 +69,7 @@
"dockerStatusRunningAndStoppedFmt": "{runningCount}个正在运行, {stoppedCount}个已停止",
"dockerStatusRunningFmt": "{count}个容器正在运行",
"doubleColumnMode": "双列模式",
"doubleColumnTip": "此选项仅开启功能,实际是否能开启还取决于设备的宽度",
"download": "下载",
"edit": "编辑",
"editVirtKeys": "编辑虚拟按键",

View File

@@ -69,6 +69,7 @@
"dockerStatusRunningAndStoppedFmt": "{runningCount}個正在運行, {stoppedCount}個已停止",
"dockerStatusRunningFmt": "{count}個容器正在運行",
"doubleColumnMode": "雙列模式",
"doubleColumnTip": "此選項僅開啟功能,實際是否能開啟還取決於設備的寬度",
"download": "下載",
"edit": "編輯",
"editVirtKeys": "編輯虛擬按鍵",

View File

@@ -52,7 +52,8 @@ class _ServerPageState extends State<ServerPage>
void didChangeDependencies() {
super.didChangeDependencies();
_media = MediaQuery.of(context);
_useDoubleColumn = _media.useDoubleColumn;
_useDoubleColumn = _media.useDoubleColumn &&
Stores.setting.doubleColumnServersPage.fetch();
}
@override

View File

@@ -191,7 +191,7 @@ class _SettingPageState extends State<SettingPage> {
_buildDeleteServers(),
_buildTextScaler(),
_buildPreferTemperatureDeviceList(),
//if (isDesktop) _buildDoubleColumnServersPage(),
_buildDoubleColumnServersPage(),
].map((e) => CardX(child: e)).toList(),
);
}
@@ -1082,12 +1082,13 @@ class _SettingPageState extends State<SettingPage> {
);
}
// Widget _buildDoubleColumnServersPage() {
// return ListTile(
// title: Text(l10n.doubleColumnMode),
// trailing: StoreSwitch(prop: _setting.doubleColumnServersPage),
// );
// }
Widget _buildDoubleColumnServersPage() {
return ListTile(
title: Text(l10n.doubleColumnMode),
subtitle: Text(l10n.doubleColumnTip, style: UIs.textGrey),
trailing: StoreSwitch(prop: _setting.doubleColumnServersPage),
);
}
Widget _buildPlatformSetting() {
return ListTile(

View File

@@ -162,13 +162,13 @@ Future<void> flutterBuildAndroid() async {
Future<void> flutterBuildLinux() async {
await flutterBuild('linux');
const appDirName = '$appName.AppDir';
const appDirName = 'linux.AppDir';
// mkdir appName.AppDir
await Process.run('mkdir', [appDirName]);
// cp -r build/linux/x64/release/bundle/* appName.AppDir
await Process.run('cp', [
'-r',
'./build/linux/x64/release/bundle/*',
'build/linux/x64/release/bundle/*',
appDirName,
]);
// cp -r assets/app_icon.png ServerBox.AppDir
@@ -196,7 +196,7 @@ Icon=app_icon
Type=Application
Categories=Utility;
''';
await File('$appDirName/$appName.desktop').writeAsString(desktop);
await File('$appDirName/default.desktop').writeAsString(desktop);
// Run appimagetool
await Process.run('sh', ['-c', 'ARCH=x86_64 appimagetool $appDirName']);