Skip to content

Commit

Permalink
fix: pop when open reading page more settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Anxcye committed Sep 3, 2024
1 parent 5e74833 commit a9d5974
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 6 deletions.
1 change: 0 additions & 1 deletion lib/page/book_notes_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ class _BookNotesPageState extends State<BookNotesPage> {
children: [
bookInfo(context, widget.book, widget.numberOfNotes),
const SizedBox(height: 170),
Text(widget.book.title),
BookNotesList(
book: widget.book,
reading: false,
Expand Down
5 changes: 5 additions & 0 deletions lib/page/book_player/epub_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -240,13 +240,18 @@ class EpubPlayerState extends State<EpubPlayer> with TickerProviderStateMixin {

String cfi = widget.cfi ?? widget.book.lastReadPosition;

String fontName = Prefs().font.name;
String fontPath = Prefs().font.path;

await controller.evaluateJavascript(
source: webviewInitialVariable(
allAnnotations,
url,
cfi,
bookStyle,
textColor,
fontName,
fontPath,
backgroundColor,
));
}
Expand Down
2 changes: 0 additions & 2 deletions lib/page/reading_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,6 @@ class ReadingPageState extends State<ReadingPage> with WidgetsBindingObserver {
leading: IconButton(
icon: const Icon(Icons.arrow_back),
onPressed: () {
// close bottom bar
Navigator.pop(context);
// close reading page
Navigator.pop(context);
},
Expand Down
2 changes: 2 additions & 0 deletions lib/service/book.dart
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ Future<void> getBookMetadata(
cfi,
Prefs().bookStyle,
textColor,
Prefs().font.name,
Prefs().font.path,
backgroundColor,
importing: true,
));
Expand Down
5 changes: 3 additions & 2 deletions lib/utils/webView/webview_initial_variable.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ String webviewInitialVariable(
String cfi,
BookStyle bookStyle,
String textColor,
String fontName,
String fontPath,
String backgroundColor, {
bool? importing,
}) {
importing ?? false;
String fontName = Prefs().font.name;
String fontPath = Prefs().font.path;


return '''
console.log(navigator.userAgent)
Expand Down
4 changes: 3 additions & 1 deletion lib/widgets/reading_page/more_settings/more_settings.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:anx_reader/l10n/generated/L10n.dart';
import 'package:anx_reader/main.dart';
import 'package:anx_reader/page/reading_page.dart';
import 'package:anx_reader/widgets/reading_page/more_settings/other_settings.dart';
import 'package:anx_reader/widgets/reading_page/more_settings/style_settings.dart';
import 'package:contentsize_tabbarview/contentsize_tabbarview.dart';
Expand All @@ -9,7 +10,8 @@ enum ReadingSettings { theme, style }

void showMoreSettings(ReadingSettings settings) {
BuildContext context = navigatorKey.currentContext!;
Navigator.of(context).pop();
// Navigator.of(context).pop();
readingPageKey.currentState!.showOrHideAppBarAndBottomBar(false);
TabController? tabController = TabController(
length: 2,
vsync: Navigator.of(context),
Expand Down

0 comments on commit a9d5974

Please sign in to comment.