Skip to content

Commit

Permalink
Merge pull request #275 from DattatreyaReddy/windows-fix
Browse files Browse the repository at this point in the history
Windows fix
  • Loading branch information
DattatreyaReddy authored Jan 16, 2024
2 parents deb1f31 + d5a59d6 commit 953115b
Show file tree
Hide file tree
Showing 10 changed files with 104 additions and 4 deletions.
1 change: 1 addition & 0 deletions lib/src/constants/db_keys.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ enum DBKeys {
readerMagnifierSize(1.0),
readerNavigationLayout(ReaderNavigationLayout.disabled),
invertTap(false),
quickSearchToggle(true),
swipeToggle(true),
scrollAnimation(true),
showNSFW(true),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ void appUpdateDialog({
}) =>
showDialog(
context: context,
builder: (_) {
builder: (context) {
return AlertDialog(
title: Text(context.l10n!.newUpdateAvailable),
content: Text(context.l10n!.versionAvailable(title, newRelease)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:gap/gap.dart';

import '../../../../utils/extensions/custom_extensions.dart';
import 'widgets/quick_query_result.dart';
Expand Down Expand Up @@ -38,6 +39,7 @@ class QuickSearchScreen extends HookWidget {
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
const Gap(32),
QuickSearchBar(controller: controller),
Flexible(
child: QuickQueryResult(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,24 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';

import '../../../../utils/extensions/custom_extensions.dart';
import '../../../settings/presentation/general/quick_search_toggle/quick_search_toggle_tile.dart';
import '../quick_search/quick_search_screen.dart';

class ShowQuickOpenIntent extends Intent {}

class HideQuickOpenIntent extends Intent {}

class SearchStackScreen extends HookWidget {
class SearchStackScreen extends HookConsumerWidget {
const SearchStackScreen({super.key, this.child});
final Widget? child;
@override
Widget build(BuildContext context) {
Widget build(context, ref) {
final visible = useState(false);
final isQuickSearchEnabled = ref.watch(quickSearchToggleProvider).ifNull();
if (!isQuickSearchEnabled) return child!;
return QuickSearchShortcutWrapper(
visible: visible,
child: Stack(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import '../../../../global_providers/global_providers.dart';
import '../../../../utils/extensions/custom_extensions.dart';
import '../../../../utils/misc/toast/toast.dart';
import '../../../../widgets/radio_list_popup.dart';
import 'quick_search_toggle/quick_search_toggle_tile.dart';

class GeneralScreen extends ConsumerWidget {
const GeneralScreen({super.key});
Expand Down Expand Up @@ -56,6 +57,7 @@ class GeneralScreen extends ConsumerWidget {
}
},
),
const QuickSearchToggleTile(),
],
),
);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Copyright (c) 2022 Contributors to the Suwayomi project
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

import 'package:flutter/material.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';

import '../../../../../constants/db_keys.dart';
import '../../../../../utils/extensions/custom_extensions.dart';
import '../../../../../utils/mixin/shared_preferences_client_mixin.dart';

part 'quick_search_toggle_tile.g.dart';

@riverpod
class QuickSearchToggle extends _$QuickSearchToggle
with SharedPreferenceClientMixin<bool> {
@override
bool? build() => initialize(DBKeys.quickSearchToggle);
}

class QuickSearchToggleTile extends HookConsumerWidget {
const QuickSearchToggleTile({super.key});
@override
Widget build(BuildContext context, WidgetRef ref) {
return SwitchListTile(
controlAffinity: ListTileControlAffinity.trailing,
secondary: const Icon(Icons.search_rounded),
title: Text(context.l10n!.quickSearch),
onChanged: ref.read(quickSearchToggleProvider.notifier).update,
value: ref.watch(quickSearchToggleProvider).ifNull(),
);
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions lib/src/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,9 @@
"@previousChapter": {
"description": "Text for Previous Chapter button in Manga Reader Screen"
},
"@quickSearch": {
"description": "Screen title and Button text of Quick Search screen"
},
"@quickSearchCategory": {
"description": "Quick Open Hint text for Category C with prefill '#C'"
},
Expand Down Expand Up @@ -823,6 +826,7 @@
"pending": "Pending",
"pinchToZoom": "Pinch to Zoom",
"previousChapter": "Previous: {chapterTitle}",
"quickSearch": "Quick Search",
"quickSearchCategory": "Go to Category 'C'",
"quickSearchCategoryManga": "Go to Manga 'M' in Category 'C'",
"quickSearchCategoryMangaChapter": "Go to Chapter Name 'CN' from Manga 'M' in Category 'C'",
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: tachidesk_sorayomi
description: A new Flutter frontend for Tachidesk.

publish_to: "none"
version: 0.5.22+1
version: 0.5.23+1

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

0 comments on commit 953115b

Please sign in to comment.