mirror of
https://github.com/lifegpc/eh_downloader_flutter.git
synced 2026-07-08 01:30:28 +08:00
feat: 根据设备像素比调整缩略图组件的宽度和高度,改善显示效果
This commit is contained in:
@@ -273,6 +273,7 @@ class _Thumbnail extends State<Thumbnail> {
|
|||||||
final isLoading = _data == null && _error == null;
|
final isLoading = _data == null && _error == null;
|
||||||
final isNsfw = widget._pMeta.isNsfw;
|
final isNsfw = widget._pMeta.isNsfw;
|
||||||
final i18n = AppLocalizations.of(context)!;
|
final i18n = AppLocalizations.of(context)!;
|
||||||
|
final dpr = MediaQuery.of(context).devicePixelRatio;
|
||||||
if (isLoading && !_isLoading) _fetchData();
|
if (isLoading && !_isLoading) _fetchData();
|
||||||
_iconSize ??= Theme.of(context).iconTheme.size;
|
_iconSize ??= Theme.of(context).iconTheme.size;
|
||||||
String? oUri;
|
String? oUri;
|
||||||
@@ -310,8 +311,8 @@ class _Thumbnail extends State<Thumbnail> {
|
|||||||
child: timg)
|
child: timg)
|
||||||
: timg;
|
: timg;
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
width: widget.width.toDouble(),
|
width: widget.width * dpr,
|
||||||
height: widget.height.toDouble(),
|
height: widget.height * dpr,
|
||||||
child: isLoading
|
child: isLoading
|
||||||
? const Center(child: CircularProgressIndicator())
|
? const Center(child: CircularProgressIndicator())
|
||||||
: _data != null
|
: _data != null
|
||||||
|
|||||||
Reference in New Issue
Block a user