improve ui

This commit is contained in:
wgh19
2024-05-15 12:40:05 +08:00
parent 2826f9f592
commit 51bff418c7
6 changed files with 33 additions and 30 deletions

View File

@@ -120,7 +120,7 @@ mixin _AppRouteTransitionMixin<T> on PageRoute<T> {
parent: animation,
curve: FluentTheme.of(context).animationCurve,
),
child: enableIOSGesture
child: enableIOSGesture && App.isIOS
? IOSBackGestureDetector(
gestureWidth: _kBackGestureWidth,
enabledCallback: () => _isPopGestureEnabled<T>(this),

View File

@@ -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!));

View File

@@ -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<DownloadingPage> {
@override
Widget build(BuildContext context) {
return ScaffoldPage(
padding: EdgeInsets.zero,
content: CustomScrollView(
slivers: [
buildTop(),
@@ -45,15 +47,7 @@ class _DownloadingPageState extends State<DownloadingPage> {
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() {

View File

@@ -146,11 +146,15 @@ class _MainPageState extends State<MainPage> 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()),
),
))),
));
}

View File

@@ -124,6 +124,7 @@ class _SearchPageState extends State<SearchPage> {
onPressed: () {
optionController.showFlyout(
navigatorKey: App.rootNavigatorKey.currentState,
placementMode: FlyoutPlacementMode.bottomCenter,
builder: buildSearchOption,
);
},

View File

@@ -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.
""";
}