mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 03:06:59 +08:00
allow user to configure window decorations(CSD/SSD) (#1839)
* allow user to configure window decorations(CSD/SSD) * rename piliplus.desktop to com.example.piliplus.desktop * update --------- Co-authored-by: dom <githubaccount56556@proton.me>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:PiliPlus/models/model_owner.dart';
|
||||
import 'package:PiliPlus/models/user/danmaku_rule_adapter.dart';
|
||||
@@ -61,6 +62,11 @@ abstract final class GStorage {
|
||||
]);
|
||||
}
|
||||
|
||||
static Future<File> syncToDisk([_]) {
|
||||
final jsonPath = path.join(appSupportDirPath, 'settings.json');
|
||||
return File(jsonPath).writeAsString(exportAllSettings());
|
||||
}
|
||||
|
||||
static String exportAllSettings() {
|
||||
return Utils.jsonEncoder.convert({
|
||||
setting.name: setting.toMap(),
|
||||
|
||||
@@ -157,7 +157,8 @@ abstract final class SettingBoxKey {
|
||||
showWindowTitleBar = 'showWindowTitleBar',
|
||||
desktopVolume = 'desktopVolume',
|
||||
showTrayIcon = 'showTrayIcon',
|
||||
uiScale = 'uiScale';
|
||||
uiScale = 'uiScale',
|
||||
useSSD = 'useSSD';
|
||||
|
||||
static const String subtitlePreferenceV2 = 'subtitlePreferenceV2',
|
||||
enableDragSubtitle = 'enableDragSubtitle',
|
||||
|
||||
@@ -914,6 +914,9 @@ abstract final class Pref {
|
||||
static bool get showWindowTitleBar =>
|
||||
_setting.get(SettingBoxKey.showWindowTitleBar, defaultValue: true);
|
||||
|
||||
static bool get useSSD =>
|
||||
_setting.get(SettingBoxKey.useSSD, defaultValue: false);
|
||||
|
||||
static double get desktopVolume =>
|
||||
_setting.get(SettingBoxKey.desktopVolume, defaultValue: 1.0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user