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": "快速收藏",
"Long press on the favorite button to quickly add to this folder": "长按收藏按钮快速添加到这个文件夹",
"Added": "已添加",
"Turn page by volume keys": "使用音量键翻页"
"Turn page by volume keys": "使用音量键翻页",
"Display time & battery info in reader":"在阅读器中显示时间和电量信息"
},
"zh_TW": {
"Home": "首頁",
@@ -381,6 +382,7 @@
"Quick Favorite": "快速收藏",
"Long press on the favorite button to quickly add to this folder": "長按收藏按鈕快速添加到這個文件夾",
"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,
'quickFavorite': null,
'enableTurnPageByVolumeKey': true,
'enableClockAndBatteryInfoInReader': true,
};
operator [](String key) {

View File

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

View File

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