Add option to hide time and battery info.

This commit is contained in:
pkuislm
2024-11-11 22:40:46 +08:00
parent b3e95d7162
commit 93bf99daa5
4 changed files with 27 additions and 13 deletions

View File

@@ -189,7 +189,8 @@
"Quick Favorite": "快速收藏", "Quick Favorite": "快速收藏",
"Long press on the favorite button to quickly add to this folder": "长按收藏按钮快速添加到这个文件夹", "Long press on the favorite button to quickly add to this folder": "长按收藏按钮快速添加到这个文件夹",
"Added": "已添加", "Added": "已添加",
"Turn page by volume keys": "使用音量键翻页" "Turn page by volume keys": "使用音量键翻页",
"Display time & battery info in reader":"在阅读器中显示时间和电量信息"
}, },
"zh_TW": { "zh_TW": {
"Home": "首頁", "Home": "首頁",
@@ -381,6 +382,7 @@
"Quick Favorite": "快速收藏", "Quick Favorite": "快速收藏",
"Long press on the favorite button to quickly add to this folder": "長按收藏按鈕快速添加到這個文件夾", "Long press on the favorite button to quickly add to this folder": "長按收藏按鈕快速添加到這個文件夾",
"Added": "已添加", "Added": "已添加",
"Turn page by volume keys": "使用音量鍵翻頁" "Turn page by volume keys": "使用音量鍵翻頁",
"Display time & battery info in reader":"在閱讀器中顯示時間和電量信息"
} }
} }

View File

@@ -118,6 +118,7 @@ class _Settings with ChangeNotifier {
'dataVersion': 0, 'dataVersion': 0,
'quickFavorite': null, 'quickFavorite': null,
'enableTurnPageByVolumeKey': true, 'enableTurnPageByVolumeKey': true,
'enableClockAndBatteryInfoInReader': true,
}; };
operator [](String key) { operator [](String key) {

View File

@@ -426,17 +426,21 @@ class _ReaderScaffoldState extends State<_ReaderScaffold> {
} }
Widget buildStatusInfo() { Widget buildStatusInfo() {
return Positioned( if(appdata.settings['enableClockAndBatteryInfoInReader']) {
bottom: 13, return Positioned(
right: 25, bottom: 13,
child: Row( right: 25,
children: [ child: Row(
_ClockWidget(), children: [
const SizedBox(width: 10), _ClockWidget(),
_BatteryWidget(), const SizedBox(width: 10),
], _BatteryWidget(),
), ],
); ),
);
} else {
return const SizedBox.shrink();
}
} }
void openChapterDrawer() { void openChapterDrawer() {

View File

@@ -77,6 +77,13 @@ class _ReaderSettingsState extends State<ReaderSettings> {
widget.onChanged?.call('enableTurnPageByVolumeKey'); widget.onChanged?.call('enableTurnPageByVolumeKey');
}, },
).toSliver(), ).toSliver(),
_SwitchSetting(
title: "Display time & battery info in reader".tl,
settingKey: "enableClockAndBatteryInfoInReader",
onChanged: () {
widget.onChanged?.call("enableClockAndBatteryInfoInReader");
},
).toSliver(),
], ],
); );
} }