Release Lunaris 2.0.1 polish update

This commit is contained in:
2026-05-26 18:47:07 +03:00
parent f65efe7cf7
commit af62ddf0da
37 changed files with 2607 additions and 143 deletions
+3 -2
View File
@@ -330,7 +330,7 @@ class _Destination {
'favorites' => 'Избранное',
'viewed' => 'История',
'collections' => 'Коллекции',
'artists' => 'Авторы',
'artists' => 'Артисты',
'providers' => 'Провайдеры',
'settings' => 'Настройки',
_ => label,
@@ -340,7 +340,8 @@ class _Destination {
String mobileLabelFor(bool ru) {
if (!ru) return mobileLabel;
return switch (id) {
'collections' => 'Колл.',
'collections' => 'Доски',
'favorites' => 'Любимое',
_ => labelFor(true),
};
}
+55 -12
View File
@@ -14,6 +14,8 @@ class PostCard extends StatefulWidget {
required this.showBadges,
required this.isFavorite,
required this.isViewed,
required this.isDownloaded,
required this.mediaQualityMode,
required this.onOpen,
required this.onFavorite,
this.onAddToCollection,
@@ -30,6 +32,8 @@ class PostCard extends StatefulWidget {
final bool showBadges;
final bool isFavorite;
final bool isViewed;
final bool isDownloaded;
final MediaQualityMode mediaQualityMode;
final VoidCallback onOpen;
final VoidCallback onFavorite;
final VoidCallback? onAddToCollection;
@@ -54,6 +58,12 @@ class _PostCardState extends State<PostCard> {
? post.width / post.height
: _fallbackAspect(post.fileType);
final mobile = MediaQuery.sizeOf(context).width < 700;
final urls = MediaUrlSelector.feed(
post,
mode: widget.mediaQualityMode,
mobile: mobile,
);
final imageUrl = urls.isEmpty ? post.previewUrl : urls.first;
return MouseRegion(
onEnter: (_) => setState(() => _hovered = true),
onExit: (_) => setState(() => _hovered = false),
@@ -115,18 +125,27 @@ class _PostCardState extends State<PostCard> {
aspectRatio: aspect.clamp(0.28, 2.2),
child: BlurContent(
enabled: widget.blurExplicit && sensitive,
child: CachedNetworkImage(
imageUrl: post.previewUrl.isNotEmpty
? post.previewUrl
: post.sampleUrl,
fit: BoxFit.cover,
placeholder: (context, url) => const LoadingSkeleton(),
errorWidget: (context, url, error) => ColoredBox(
color:
Theme.of(context).colorScheme.surfaceContainerHighest,
child:
const Center(child: Icon(Icons.broken_image_rounded)),
),
child: LayoutBuilder(
builder: (context, constraints) {
final dpr = MediaQuery.devicePixelRatioOf(context);
final cacheWidth =
(constraints.maxWidth * dpr).round().clamp(320, 1800);
return CachedNetworkImage(
imageUrl: imageUrl,
memCacheWidth: cacheWidth,
maxWidthDiskCache: cacheWidth,
fit: BoxFit.cover,
placeholder: (context, url) => const LoadingSkeleton(),
errorWidget: (context, url, error) => ColoredBox(
color: Theme.of(context)
.colorScheme
.surfaceContainerHighest,
child: const Center(
child: Icon(Icons.broken_image_rounded),
),
),
);
},
),
),
),
@@ -152,6 +171,12 @@ class _PostCardState extends State<PostCard> {
bottom: 8,
child: _SeenBadge(),
),
if (widget.isDownloaded)
Positioned(
right: widget.isViewed ? 72 : 8,
bottom: 8,
child: const _DownloadedBadge(),
),
],
if (widget.selected)
Positioned.fill(
@@ -390,6 +415,24 @@ class _SeenBadge extends StatelessWidget {
}
}
class _DownloadedBadge extends StatelessWidget {
const _DownloadedBadge();
@override
Widget build(BuildContext context) {
return DecoratedBox(
decoration: BoxDecoration(
color: Colors.black.withValues(alpha: 0.55),
borderRadius: BorderRadius.circular(6),
),
child: const Padding(
padding: EdgeInsets.symmetric(horizontal: 7, vertical: 3),
child: Icon(Icons.download_done_rounded, size: 13, color: Colors.white),
),
);
}
}
Future<void> showAddToCollectionPicker(
BuildContext context, {
required List<Collection> collections,
@@ -13,6 +13,7 @@ class PostMasonryGrid extends StatelessWidget {
required this.blurExplicit,
required this.showBadges,
required this.nsfwEnabled,
required this.mediaQualityMode,
required this.onOpen,
required this.onFavorite,
this.onAddToCollection,
@@ -23,6 +24,7 @@ class PostMasonryGrid extends StatelessWidget {
this.selectedKeys = const {},
this.favoriteKeys = const {},
this.viewedKeys = const {},
this.downloadedKeys = const {},
this.loading = false,
this.controller,
super.key,
@@ -33,6 +35,7 @@ class PostMasonryGrid extends StatelessWidget {
final bool blurExplicit;
final bool showBadges;
final bool nsfwEnabled;
final MediaQualityMode mediaQualityMode;
final ValueChanged<Post> onOpen;
final ValueChanged<Post> onFavorite;
final ValueChanged<Post>? onAddToCollection;
@@ -43,6 +46,7 @@ class PostMasonryGrid extends StatelessWidget {
final Set<String> selectedKeys;
final Set<String> favoriteKeys;
final Set<String> viewedKeys;
final Set<String> downloadedKeys;
final bool loading;
final ScrollController? controller;
@@ -65,6 +69,8 @@ class PostMasonryGrid extends StatelessWidget {
showBadges: showBadges,
isFavorite: favoriteKeys.contains(post.cacheKey),
isViewed: viewedKeys.contains(post.cacheKey),
isDownloaded: downloadedKeys.contains(post.cacheKey),
mediaQualityMode: mediaQualityMode,
onOpen: () => onOpen(post),
onFavorite: () => onFavorite(post),
onPreview: onPreview == null ? null : () => onPreview!(post),