Skip to content

Commit

Permalink
Support hiding the quick back to top FAB
Browse files Browse the repository at this point in the history
支持隐藏快速回顶按钮
  • Loading branch information
jiangtian616 committed Feb 28, 2024
1 parent d7fbc1f commit c233596
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
4 changes: 4 additions & 0 deletions changelog/v7.4.12+163.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- 支持隐藏快速回顶按钮
------------------------------------------------------------------------------------------

- Support hiding the quick back to top FAB
4 changes: 2 additions & 2 deletions lib/src/mixin/scroll_to_top_logic_mixin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ mixin Scroll2TopLogicMixin on GetxController {
scroll2TopState.isScrollingDown = false;
}

// if always show FAB, we don't need to update
if (PreferenceSetting.hideScroll2TopButton.value == Scroll2TopButtonModeEnum.never) {
// if always or never show FAB, we don't need to update
if (PreferenceSetting.hideScroll2TopButton.value == Scroll2TopButtonModeEnum.never || PreferenceSetting.hideScroll2TopButton.value == Scroll2TopButtonModeEnum.always) {
return false;
}

Expand Down
4 changes: 4 additions & 0 deletions lib/src/pages/setting/preference/setting_preference_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,10 @@ class SettingPreferencePage extends StatelessWidget {
child: Text('never'.tr),
value: Scroll2TopButtonModeEnum.never,
),
DropdownMenuItem(
child: Text('always'.tr),
value: Scroll2TopButtonModeEnum.always,
),
],
),
);
Expand Down
2 changes: 1 addition & 1 deletion lib/src/setting/preference_setting.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import '../service/storage_service.dart';
import '../utils/locale_util.dart';
import '../utils/log.dart';

enum Scroll2TopButtonModeEnum { scrollUp, scrollDown, never }
enum Scroll2TopButtonModeEnum { scrollUp, scrollDown, never, always }

enum TagSearchBehaviour { inheritAll, inheritPartially, none }

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: jhentai
description: A flutter app for E-Hentai/EXHentai

publish_to: 'none'
version: 7.4.12+162
version: 7.4.12+163

environment:
sdk: '>=3.0.0 <4.0.0'
Expand Down

0 comments on commit c233596

Please sign in to comment.