Emphasize artworks from following artists

This commit is contained in:
wgh19
2024-06-14 12:38:50 +08:00
parent 21fe14f88b
commit 790ed54d5b
4 changed files with 30 additions and 2 deletions

View File

@@ -180,7 +180,9 @@
"Check for updates": "检查更新", "Check for updates": "检查更新",
"Check for updates on startup": "启动时检查更新", "Check for updates on startup": "启动时检查更新",
"I understand pixes is a free unofficial application.": "我了解Pixes是一个免费的非官方应用程序", "I understand pixes is a free unofficial application.": "我了解Pixes是一个免费的非官方应用程序",
"Related Artworks": "相关作品" "Related Artworks": "相关作品",
"Emphasize artworks from following artists": "强调关注画师的作品",
"The border of the artworks will be darker": "作品的边框将被加深"
}, },
"zh_TW": { "zh_TW": {
"Search": "搜索", "Search": "搜索",
@@ -363,6 +365,8 @@
"Check for updates": "檢查更新", "Check for updates": "檢查更新",
"Check for updates on startup": "啟動時檢查更新", "Check for updates on startup": "啟動時檢查更新",
"I understand pixes is a free unofficial application.": "我了解Pixes是一個免費的非官方應用程序", "I understand pixes is a free unofficial application.": "我了解Pixes是一個免費的非官方應用程序",
"Related Artworks": "相關作品" "Related Artworks": "相關作品",
"Emphasize artworks from following artists": "強調關注畫師的作品",
"The border of the artworks will be darker": "作品的邊框將被加深"
} }
} }

View File

@@ -37,6 +37,7 @@ class _Appdata {
], ],
"showOriginalImage": false, "showOriginalImage": false,
"checkUpdate": true, "checkUpdate": true,
"emphasizeArtworksFromFollowingArtists": true,
}; };
bool lock = false; bool lock = false;

View File

@@ -1,4 +1,5 @@
import 'package:fluent_ui/fluent_ui.dart'; import 'package:fluent_ui/fluent_ui.dart';
import 'package:pixes/appdata.dart';
import 'package:pixes/components/animated_image.dart'; import 'package:pixes/components/animated_image.dart';
import 'package:pixes/foundation/app.dart'; import 'package:pixes/foundation/app.dart';
import 'package:pixes/foundation/history.dart'; import 'package:pixes/foundation/history.dart';
@@ -70,6 +71,15 @@ class _IllustWidgetState extends State<IllustWidget> {
child: Card( child: Card(
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
margin: EdgeInsets.zero, margin: EdgeInsets.zero,
borderColor: () {
return widget.illust.author.isFollowed &&
appdata.settings[
'emphasizeArtworksFromFollowingArtists']
? ColorScheme.of(context).primary
: ColorScheme.of(context)
.outlineVariant
.withOpacity(0.64);
}(),
child: GestureDetector( child: GestureDetector(
onTap: widget.onTap ?? onTap: widget.onTap ??
() { () {

View File

@@ -273,6 +273,19 @@ class _SettingsPageState extends State<SettingsPage> {
}); });
appdata.writeData(); appdata.writeData();
})), })),
buildItem(
title: "Emphasize artworks from following artists".tl,
subtitle: "The border of the artworks will be darker".tl,
action: ToggleSwitch(
checked:
appdata.settings['emphasizeArtworksFromFollowingArtists'],
onChanged: (value) {
setState(() {
appdata.settings[
'emphasizeArtworksFromFollowingArtists'] = value;
});
appdata.writeData();
})),
], ],
), ),
); );