mirror of
https://github.com/venera-app/venera.git
synced 2025-09-27 07:47:24 +00:00
add 'Long press to zoom' setting
This commit is contained in:
@@ -167,7 +167,8 @@
|
||||
"Download All": "下载全部",
|
||||
"Order": "顺序",
|
||||
"minAppVersion @version is required": "需要最低App版本 @version",
|
||||
"Remove": "移除"
|
||||
"Remove": "移除",
|
||||
"Long press to zoom": "长按缩放"
|
||||
},
|
||||
"zh_TW": {
|
||||
"Home": "首頁",
|
||||
@@ -337,6 +338,7 @@
|
||||
"Download All": "下載全部",
|
||||
"Order": "順序",
|
||||
"minAppVersion @version is required": "需要最低App版本 @version",
|
||||
"Remove": "移除"
|
||||
"Remove": "移除",
|
||||
"Long press to zoom": "長按縮放"
|
||||
}
|
||||
}
|
@@ -111,6 +111,7 @@ class _Settings with ChangeNotifier {
|
||||
'language': 'system', // system, zh-CN, zh-TW, en-US
|
||||
'cacheSize': 2048, // in MB
|
||||
'downloadThreads': 5,
|
||||
'enableLongPressToZoom': true,
|
||||
};
|
||||
|
||||
operator [](String key) {
|
||||
|
@@ -223,6 +223,9 @@ class _GalleryModeState extends State<_GalleryMode>
|
||||
|
||||
@override
|
||||
void handleLongPressDown(Offset location) {
|
||||
if(!appdata.settings['enableLongPressToZoom']) {
|
||||
return;
|
||||
}
|
||||
var photoViewController = photoViewControllers[reader.page]!;
|
||||
double target = photoViewController.getInitialScale!.call()! * 1.75;
|
||||
var size = MediaQuery.of(context).size;
|
||||
@@ -234,6 +237,9 @@ class _GalleryModeState extends State<_GalleryMode>
|
||||
|
||||
@override
|
||||
void handleLongPressUp(Offset location) {
|
||||
if(!appdata.settings['enableLongPressToZoom']) {
|
||||
return;
|
||||
}
|
||||
var photoViewController = photoViewControllers[reader.page]!;
|
||||
double target = photoViewController.getInitialScale!.call()!;
|
||||
photoViewController.animateScale?.call(target);
|
||||
@@ -509,6 +515,9 @@ class _ContinuousModeState extends State<_ContinuousMode>
|
||||
|
||||
@override
|
||||
void handleLongPressDown(Offset location) {
|
||||
if(!appdata.settings['enableLongPressToZoom']) {
|
||||
return;
|
||||
}
|
||||
double target = photoViewController.getInitialScale!.call()! * 1.75;
|
||||
var size = MediaQuery.of(context).size;
|
||||
photoViewController.animateScale?.call(
|
||||
@@ -519,6 +528,9 @@ class _ContinuousModeState extends State<_ContinuousMode>
|
||||
|
||||
@override
|
||||
void handleLongPressUp(Offset location) {
|
||||
if(!appdata.settings['enableLongPressToZoom']) {
|
||||
return;
|
||||
}
|
||||
double target = photoViewController.getInitialScale!.call()!;
|
||||
photoViewController.animateScale?.call(target);
|
||||
}
|
||||
|
@@ -54,6 +54,13 @@ class _ReaderSettingsState extends State<ReaderSettings> {
|
||||
widget.onChanged?.call("autoPageTurningInterval");
|
||||
},
|
||||
).toSliver(),
|
||||
_SwitchSetting(
|
||||
title: 'Long press to zoom'.tl,
|
||||
settingKey: 'enableLongPressToZoom',
|
||||
onChanged: () {
|
||||
widget.onChanged?.call('enableLongPressToZoom');
|
||||
},
|
||||
).toSliver(),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user