mirror of
https://github.com/wgh136/pixes.git
synced 2025-09-27 12:57:24 +00:00
improve ui
This commit is contained in:
@@ -1,6 +1,9 @@
|
|||||||
import 'package:flutter/material.dart' as md;
|
import 'package:flutter/material.dart' as md;
|
||||||
|
|
||||||
typedef MdIcons = md.Icons;
|
typedef MdIcons = md.Icons;
|
||||||
|
typedef MdTheme = md.Theme;
|
||||||
|
typedef MdThemeData = md.ThemeData;
|
||||||
|
typedef MdColorScheme = md.ColorScheme;
|
||||||
|
|
||||||
class ColorScheme {
|
class ColorScheme {
|
||||||
static md.ColorScheme of(md.BuildContext context) {
|
static md.ColorScheme of(md.BuildContext context) {
|
||||||
|
@@ -3,6 +3,7 @@ import "dart:ui";
|
|||||||
import "package:fluent_ui/fluent_ui.dart";
|
import "package:fluent_ui/fluent_ui.dart";
|
||||||
import "package:flutter/services.dart";
|
import "package:flutter/services.dart";
|
||||||
import "package:pixes/appdata.dart";
|
import "package:pixes/appdata.dart";
|
||||||
|
import "package:pixes/components/md.dart";
|
||||||
import "package:pixes/components/message.dart";
|
import "package:pixes/components/message.dart";
|
||||||
import "package:pixes/foundation/app.dart";
|
import "package:pixes/foundation/app.dart";
|
||||||
import "package:pixes/foundation/log.dart";
|
import "package:pixes/foundation/log.dart";
|
||||||
@@ -99,7 +100,21 @@ class MyApp extends StatelessWidget {
|
|||||||
throw "widget is null";
|
throw "widget is null";
|
||||||
}
|
}
|
||||||
|
|
||||||
return OverlayWidget(child);
|
return MdTheme(
|
||||||
|
data: MdThemeData.from(
|
||||||
|
colorScheme: MdColorScheme.fromSeed(
|
||||||
|
seedColor: FluentTheme.of(context).accentColor,
|
||||||
|
brightness: FluentTheme.of(context).brightness,
|
||||||
|
),
|
||||||
|
useMaterial3: true
|
||||||
|
),
|
||||||
|
child: DefaultTextStyle.merge(
|
||||||
|
style: TextStyle(
|
||||||
|
fontFamily: App.isWindows ? 'font' : null,
|
||||||
|
),
|
||||||
|
child: OverlayWidget(child),
|
||||||
|
),
|
||||||
|
);
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@@ -173,7 +173,7 @@ class Illust {
|
|||||||
final int restrict;
|
final int restrict;
|
||||||
final IllustAuthor author;
|
final IllustAuthor author;
|
||||||
final List<Tag> tags;
|
final List<Tag> tags;
|
||||||
final String createDate;
|
final DateTime createDate;
|
||||||
final int pageCount;
|
final int pageCount;
|
||||||
final int width;
|
final int width;
|
||||||
final int height;
|
final int height;
|
||||||
@@ -220,7 +220,7 @@ class Illust {
|
|||||||
tags = (json['tags'] as List)
|
tags = (json['tags'] as List)
|
||||||
.map((e) => Tag(e['name'], e['translated_name']))
|
.map((e) => Tag(e['name'], e['translated_name']))
|
||||||
.toList(),
|
.toList(),
|
||||||
createDate = json['create_date'],
|
createDate = DateTime.parse(json['create_date']),
|
||||||
pageCount = json['page_count'],
|
pageCount = json['page_count'],
|
||||||
width = json['width'],
|
width = json['width'],
|
||||||
height = json['height'],
|
height = json['height'],
|
||||||
|
@@ -314,7 +314,12 @@ class _BottomBarState extends State<_BottomBar> with TickerProviderStateMixin{
|
|||||||
buildStats(),
|
buildStats(),
|
||||||
buildTags(),
|
buildTags(),
|
||||||
buildMoreActions(),
|
buildMoreActions(),
|
||||||
SelectableText("${"Artwork ID".tl}: ${widget.illust.id}\n${"Artist ID".tl}: ${widget.illust.author.id}", style: TextStyle(color: ColorScheme.of(context).outline),).paddingLeft(4),
|
SelectableText(
|
||||||
|
"${"Artwork ID".tl}: ${widget.illust.id}\n"
|
||||||
|
"${"Artist ID".tl}: ${widget.illust.author.id}\n"
|
||||||
|
"${widget.illust.createDate.toString().split('.').first}",
|
||||||
|
style: TextStyle(color: ColorScheme.of(context).outline),)
|
||||||
|
.paddingLeft(4),
|
||||||
SizedBox(height: 8 + context.padding.bottom,)
|
SizedBox(height: 8 + context.padding.bottom,)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
@@ -2,7 +2,6 @@ import "dart:async";
|
|||||||
|
|
||||||
import "package:fluent_ui/fluent_ui.dart";
|
import "package:fluent_ui/fluent_ui.dart";
|
||||||
import "package:flutter/foundation.dart";
|
import "package:flutter/foundation.dart";
|
||||||
import "package:flutter/material.dart" as md;
|
|
||||||
import "package:pixes/appdata.dart";
|
import "package:pixes/appdata.dart";
|
||||||
import "package:pixes/components/md.dart";
|
import "package:pixes/components/md.dart";
|
||||||
import "package:pixes/foundation/app.dart";
|
import "package:pixes/foundation/app.dart";
|
||||||
@@ -79,91 +78,84 @@ class _MainPageState extends State<MainPage> with WindowListener {
|
|||||||
content: LoginPage(() => setState(() {})),
|
content: LoginPage(() => setState(() {})),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return md.Theme(
|
return DefaultSelectionStyle.merge(
|
||||||
data: md.ThemeData.from(
|
selectionColor: FluentTheme.of(context).selectionColor.withOpacity(0.4),
|
||||||
useMaterial3: true,
|
child: NavigationView(
|
||||||
colorScheme: md.ColorScheme.fromSeed(
|
appBar: buildAppBar(context, navigatorKey),
|
||||||
seedColor: FluentTheme.of(context).accentColor.withOpacity(1),
|
pane: NavigationPane(
|
||||||
brightness: FluentTheme.of(context).brightness,
|
selected: index,
|
||||||
)),
|
onChanged: (value) {
|
||||||
child: DefaultSelectionStyle.merge(
|
setState(() {
|
||||||
selectionColor: FluentTheme.of(context).selectionColor.withOpacity(0.4),
|
index = value;
|
||||||
child: NavigationView(
|
});
|
||||||
appBar: buildAppBar(context, navigatorKey),
|
navigate(value);
|
||||||
pane: NavigationPane(
|
},
|
||||||
selected: index,
|
items: [
|
||||||
onChanged: (value) {
|
UserPane(),
|
||||||
setState(() {
|
PaneItem(
|
||||||
index = value;
|
icon: const Icon(MdIcons.search, size: 20,),
|
||||||
});
|
title: Text('Search'.tl),
|
||||||
navigate(value);
|
body: const SizedBox.shrink(),
|
||||||
},
|
|
||||||
items: [
|
|
||||||
UserPane(),
|
|
||||||
PaneItem(
|
|
||||||
icon: const Icon(MdIcons.search, size: 20,),
|
|
||||||
title: Text('Search'.tl),
|
|
||||||
body: const SizedBox.shrink(),
|
|
||||||
),
|
|
||||||
PaneItem(
|
|
||||||
icon: const Icon(MdIcons.downloading, size: 20,),
|
|
||||||
title: Text('Downloading'.tl),
|
|
||||||
body: const SizedBox.shrink(),
|
|
||||||
),
|
|
||||||
PaneItem(
|
|
||||||
icon: const Icon(MdIcons.download, size: 20,),
|
|
||||||
title: Text('Downloaded'.tl),
|
|
||||||
body: const SizedBox.shrink(),
|
|
||||||
),
|
|
||||||
PaneItemSeparator(),
|
|
||||||
PaneItemHeader(header: Text("Artwork".tl).paddingBottom(4).paddingLeft(8)),
|
|
||||||
PaneItem(
|
|
||||||
icon: const Icon(MdIcons.explore_outlined, size: 20,),
|
|
||||||
title: Text('Explore'.tl),
|
|
||||||
body: const SizedBox.shrink(),
|
|
||||||
),
|
|
||||||
PaneItem(
|
|
||||||
icon: const Icon(MdIcons.bookmark_outline, size: 20),
|
|
||||||
title: Text('Bookmarks'.tl),
|
|
||||||
body: const SizedBox.shrink(),
|
|
||||||
),
|
|
||||||
PaneItem(
|
|
||||||
icon: const Icon(MdIcons.interests_outlined, size: 20),
|
|
||||||
title: Text('Following'.tl),
|
|
||||||
body: const SizedBox.shrink(),
|
|
||||||
),
|
|
||||||
PaneItem(
|
|
||||||
icon: const Icon(MdIcons.history, size: 20),
|
|
||||||
title: Text('History'.tl),
|
|
||||||
body: const SizedBox.shrink(),
|
|
||||||
),
|
|
||||||
PaneItem(
|
|
||||||
icon: const Icon(MdIcons.leaderboard_outlined, size: 20),
|
|
||||||
title: Text('Ranking'.tl),
|
|
||||||
body: const SizedBox.shrink(),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
footerItems: [
|
|
||||||
PaneItem(
|
|
||||||
icon: const Icon(MdIcons.settings_outlined, size: 20),
|
|
||||||
title: Text('Settings'.tl),
|
|
||||||
body: const SizedBox.shrink(),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
paneBodyBuilder: (pane, child) => NavigatorPopHandler(
|
PaneItem(
|
||||||
key: const Key("navigator"),
|
icon: const Icon(MdIcons.downloading, size: 20,),
|
||||||
onPop: () => navigatorKey.currentState?.pop(),
|
title: Text('Downloading'.tl),
|
||||||
child: MediaQuery.removePadding(
|
body: const SizedBox.shrink(),
|
||||||
context: context,
|
),
|
||||||
removeTop: true,
|
PaneItem(
|
||||||
child: Navigator(
|
icon: const Icon(MdIcons.download, size: 20,),
|
||||||
key: navigatorKey,
|
title: Text('Downloaded'.tl),
|
||||||
onGenerateRoute: (settings) => AppPageRoute(
|
body: const SizedBox.shrink(),
|
||||||
builder: (context) => const RecommendationPage()),
|
),
|
||||||
),
|
PaneItemSeparator(),
|
||||||
))),
|
PaneItemHeader(header: Text("Artwork".tl).paddingBottom(4).paddingLeft(8)),
|
||||||
));
|
PaneItem(
|
||||||
|
icon: const Icon(MdIcons.explore_outlined, size: 20,),
|
||||||
|
title: Text('Explore'.tl),
|
||||||
|
body: const SizedBox.shrink(),
|
||||||
|
),
|
||||||
|
PaneItem(
|
||||||
|
icon: const Icon(MdIcons.bookmark_outline, size: 20),
|
||||||
|
title: Text('Bookmarks'.tl),
|
||||||
|
body: const SizedBox.shrink(),
|
||||||
|
),
|
||||||
|
PaneItem(
|
||||||
|
icon: const Icon(MdIcons.interests_outlined, size: 20),
|
||||||
|
title: Text('Following'.tl),
|
||||||
|
body: const SizedBox.shrink(),
|
||||||
|
),
|
||||||
|
PaneItem(
|
||||||
|
icon: const Icon(MdIcons.history, size: 20),
|
||||||
|
title: Text('History'.tl),
|
||||||
|
body: const SizedBox.shrink(),
|
||||||
|
),
|
||||||
|
PaneItem(
|
||||||
|
icon: const Icon(MdIcons.leaderboard_outlined, size: 20),
|
||||||
|
title: Text('Ranking'.tl),
|
||||||
|
body: const SizedBox.shrink(),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
footerItems: [
|
||||||
|
PaneItem(
|
||||||
|
icon: const Icon(MdIcons.settings_outlined, size: 20),
|
||||||
|
title: Text('Settings'.tl),
|
||||||
|
body: const SizedBox.shrink(),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
paneBodyBuilder: (pane, child) => NavigatorPopHandler(
|
||||||
|
key: const Key("navigator"),
|
||||||
|
onPop: () => navigatorKey.currentState?.pop(),
|
||||||
|
child: MediaQuery.removePadding(
|
||||||
|
context: context,
|
||||||
|
removeTop: true,
|
||||||
|
child: Navigator(
|
||||||
|
key: navigatorKey,
|
||||||
|
onGenerateRoute: (settings) => AppPageRoute(
|
||||||
|
builder: (context) => const RecommendationPage()),
|
||||||
|
),
|
||||||
|
))),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
static final pageBuilders = <Widget Function()>[
|
static final pageBuilders = <Widget Function()>[
|
||||||
|
@@ -410,7 +410,7 @@ ${"Some keywords will be replaced by the following rule:".tl}
|
|||||||
\${index} -> ${"Index of the image in the artwork".tl}
|
\${index} -> ${"Index of the image in the artwork".tl}
|
||||||
\${ext} -> ${"File extension".tl}
|
\${ext} -> ${"File extension".tl}
|
||||||
\${AI} -> ${"Replace with 'AI' if the work was generated by AI, otherwise replace with blank".tl}
|
\${AI} -> ${"Replace with 'AI' if the work was generated by AI, otherwise replace with blank".tl}
|
||||||
\${tag{*}} -> ${"Replace with * if the work have tag *, otherwise replace with blank.".tl}
|
\${tag(*)} -> ${"Replace with * if the work have tag *, otherwise replace with blank.".tl}
|
||||||
|
|
||||||
${"Multiple path separators will be automatically replaced with a single".tl}
|
${"Multiple path separators will be automatically replaced with a single".tl}
|
||||||
""";
|
""";
|
||||||
|
Reference in New Issue
Block a user