mod: 番剧标题溢出以及没有长标题时显示调整

This commit is contained in:
orz12
2024-05-25 09:15:23 +08:00
parent d125c973dd
commit 32461d90a6

View File

@@ -184,10 +184,13 @@ class _BangumiPanelState extends State<BangumiPanel> {
), ),
const SizedBox(width: 6) const SizedBox(width: 6)
], ],
Text( Expanded(
'' + child: Text(
(widget.pages[i].title ?? "${i + 1}") + widget.pages[i].title ?? '${i + 1}',
'', maxLines: (widget.pages[i].longTitle != null &&
widget.pages[i].longTitle != '')
? 1
: 2,
style: TextStyle( style: TextStyle(
fontSize: 13, fontSize: 13,
color: i == currentIndex color: i == currentIndex
@@ -195,7 +198,7 @@ class _BangumiPanelState extends State<BangumiPanel> {
: Theme.of(context) : Theme.of(context)
.colorScheme .colorScheme
.onSurface), .onSurface),
), )),
const SizedBox(width: 2), const SizedBox(width: 2),
if (widget.pages[i].badge != null) ...[ if (widget.pages[i].badge != null) ...[
const Spacer(), const Spacer(),
@@ -219,17 +222,22 @@ class _BangumiPanelState extends State<BangumiPanel> {
] ]
], ],
), ),
const SizedBox(height: 3), if (widget.pages[i].longTitle != null &&
Text( widget.pages[i].longTitle != '') ...[
widget.pages[i].longTitle!, const SizedBox(height: 3),
maxLines: 1, Text(
style: TextStyle( widget.pages[i].longTitle!,
fontSize: 13, maxLines: 1,
color: i == currentIndex style: TextStyle(
? Theme.of(context).colorScheme.primary fontSize: 13,
: Theme.of(context).colorScheme.onSurface), color: i == currentIndex
overflow: TextOverflow.ellipsis, ? Theme.of(context).colorScheme.primary
) : Theme.of(context)
.colorScheme
.onSurface),
overflow: TextOverflow.ellipsis,
)
]
], ],
), ),
), ),