diff --git a/lib/components/page_route.dart b/lib/components/page_route.dart index 919f647..69bd497 100644 --- a/lib/components/page_route.dart +++ b/lib/components/page_route.dart @@ -120,7 +120,7 @@ mixin _AppRouteTransitionMixin on PageRoute { parent: animation, curve: FluentTheme.of(context).animationCurve, ), - child: enableIOSGesture + child: enableIOSGesture && App.isIOS ? IOSBackGestureDetector( gestureWidth: _kBackGestureWidth, enabledCallback: () => _isPopGestureEnabled(this), diff --git a/lib/network/network.dart b/lib/network/network.dart index 3407a26..90c1a1b 100644 --- a/lib/network/network.dart +++ b/lib/network/network.dart @@ -111,7 +111,7 @@ class Network { if(res.statusCode != 200) { var data = res.data ?? ""; if(data.contains("Invalid refresh token")) { - throw "Failed to refresh token. Plaese logout and re-login"; + throw "Failed to refresh token. Please log out."; } } var account = Account.fromJson(json.decode(res.data!)); diff --git a/lib/pages/downloading_page.dart b/lib/pages/downloading_page.dart index 9dda021..74e9274 100644 --- a/lib/pages/downloading_page.dart +++ b/lib/pages/downloading_page.dart @@ -1,5 +1,6 @@ import 'package:fluent_ui/fluent_ui.dart'; import 'package:pixes/components/md.dart'; +import 'package:pixes/components/title_bar.dart'; import 'package:pixes/foundation/app.dart'; import 'package:pixes/foundation/image_provider.dart'; import 'package:pixes/network/download.dart'; @@ -32,6 +33,7 @@ class _DownloadingPageState extends State { @override Widget build(BuildContext context) { return ScaffoldPage( + padding: EdgeInsets.zero, content: CustomScrollView( slivers: [ buildTop(), @@ -45,15 +47,7 @@ class _DownloadingPageState extends State { Widget buildTop() { int bytesPerSecond = DownloadManager().bytesPerSecond; - return SliverToBoxAdapter( - child: SizedBox( - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 16), - child: Text("${"Speed".tl}: ${bytesToText(bytesPerSecond)}/s", - style: const TextStyle(fontSize: 22, fontWeight: FontWeight.bold)), - ), - ), - ); + return SliverTitleBar(title: "${"Speed".tl}: ${bytesToText(bytesPerSecond)}/s"); } Widget buildContent() { diff --git a/lib/pages/main_page.dart b/lib/pages/main_page.dart index e9b70a9..ce70adf 100644 --- a/lib/pages/main_page.dart +++ b/lib/pages/main_page.dart @@ -146,11 +146,15 @@ class _MainPageState extends State with WindowListener { paneBodyBuilder: (pane, child) => NavigatorPopHandler( key: const Key("navigator"), onPop: () => navigatorKey.currentState?.pop(), - child: Navigator( - key: navigatorKey, - onGenerateRoute: (settings) => AppPageRoute( - builder: (context) => const RecommendationPage()), - ))), + child: MediaQuery.removePadding( + context: context, + removeTop: true, + child: Navigator( + key: navigatorKey, + onGenerateRoute: (settings) => AppPageRoute( + builder: (context) => const RecommendationPage()), + ), + ))), )); } diff --git a/lib/pages/search_page.dart b/lib/pages/search_page.dart index 8d6db13..1976d2d 100644 --- a/lib/pages/search_page.dart +++ b/lib/pages/search_page.dart @@ -124,6 +124,7 @@ class _SearchPageState extends State { onPressed: () { optionController.showFlyout( navigatorKey: App.rootNavigatorKey.currentState, + placementMode: FlyoutPlacementMode.bottomCenter, builder: buildSearchOption, ); }, diff --git a/lib/pages/settings_page.dart b/lib/pages/settings_page.dart index d8d6d4f..129f9dd 100644 --- a/lib/pages/settings_page.dart +++ b/lib/pages/settings_page.dart @@ -208,7 +208,7 @@ class __SetDownloadPathPageState extends State<_SetDownloadPathPage> { } class _SetDownloadSubPathPage extends StatefulWidget { - const _SetDownloadSubPathPage({super.key}); + const _SetDownloadSubPathPage(); @override State<_SetDownloadSubPathPage> createState() => @@ -227,7 +227,7 @@ class __SetDownloadSubPathPageState extends State<_SetDownloadSubPathPage> { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - TitleBar(title: "Download Subpath".tl), + TitleBar(title: "Download subpath".tl), Text("Rule".tl) .padding(const EdgeInsets.symmetric(vertical: 8, horizontal: 16)), TextBox( @@ -246,7 +246,9 @@ class __SetDownloadSubPathPageState extends State<_SetDownloadSubPathPage> { trailing: ToggleSwitch( checked: appdata.settings["useTranslatedNameForDownload"], onChanged: (value) { - appdata.settings["useTranslatedNameForDownload"] = value; + setState(() { + appdata.settings["useTranslatedNameForDownload"] = value; + }); appdata.writeSettings(); }, ), @@ -270,7 +272,7 @@ class __SetDownloadSubPathPageState extends State<_SetDownloadSubPathPage> { const SizedBox( height: 16, ), - Text(_instruction).paddingHorizontal(16) + SelectableText(_instruction).paddingHorizontal(16) ], ), ); @@ -284,22 +286,24 @@ class __SetDownloadSubPathPageState extends State<_SetDownloadSubPathPage> { } String get _instruction => """ -${"Edit the rule of where to store a image.".tl} -${"Note: The rule should contain file name.".tl} +${"Edit the rule for where to save an image.".tl} +${"Note: The rule should include the filename.".tl} -${"Some keyword will be replaced as following rule:"} - \${title} -> ${"Title of the actwork".tl} +${"Some keywords will be replaced by the following rule:"} + \${title} -> ${"Title of the work".tl} \${author} -> ${"Name of the author".tl} - \${id} -> ${"Actwork ID".tl} + \${id} -> ${"Artwork ID".tl} \${index} -> ${"Index of the image in the artwork".tl} \${ext} -> ${"File extension".tl} - ${"Tags: Tags will be sorted with \"Weights of tags\" setting and be replaced with following rule".tl} - ${"The final text will be affect by the setting og \"Use translated tag name\"".tl} + +${"Tags: Tags will be sorted by the \"Weights of tags\" setting and replaced by the following rule:".tl} +${"The final text will be affected by the \"Use translated tag name\" setting.".tl} \${tag0} -> ${"The first tag of the artwork".tl} - \${tag1} -> ${"The sencondary tag of the artwork".tl} + \${tag1} -> ${"The second tag of the artwork".tl} + ... ${"Weights of the tags".tl}: -Filled with tags. The tags should be splited with a space. The tag in the front have higher weight. -It is required to use originlal name instead of translated name. +Filled with tags. The tags should be separated by a space. The tag in front has higher weight. +It is required to use the original name instead of the translated name. """; }