Improve UI of comic source page.

This commit is contained in:
2025-07-23 14:28:40 +08:00
parent c074e7f9d1
commit 6245399810

View File

@@ -191,13 +191,6 @@ class _BodyState extends State<_Body> {
} }
Widget buildCard(BuildContext context) { Widget buildCard(BuildContext context) {
Widget buildButton({
required Widget child,
required VoidCallback onPressed,
}) {
return Button.normal(onPressed: onPressed, child: child).fixHeight(32);
}
return SliverToBoxAdapter( return SliverToBoxAdapter(
child: SizedBox( child: SizedBox(
width: double.infinity, width: double.infinity,
@@ -224,33 +217,33 @@ class _BodyState extends State<_Body> {
}, },
onSubmitted: handleAddSource, onSubmitted: handleAddSource,
).paddingHorizontal(16).paddingBottom(8), ).paddingHorizontal(16).paddingBottom(8),
ListTile( Wrap(
title: Text("Comic Source list".tl), spacing: 8,
trailing: buildButton( runSpacing: 8,
child: Text("View".tl), children: [
onPressed: () { FilledButton.tonalIcon(
showPopUpWidget( icon: Icon(Icons.article_outlined),
App.rootContext, label: Text("Comic Source list".tl),
_ComicSourceList(handleAddSource), onPressed: () {
); showPopUpWidget(
}, App.rootContext,
), _ComicSourceList(handleAddSource),
), );
ListTile( },
title: Text("Use a config file".tl), ),
trailing: buildButton( FilledButton.tonalIcon(
onPressed: _selectFile, icon: Icon(Icons.file_open_outlined),
child: Text("Select".tl), label: Text("Use a config file".tl),
), onPressed: _selectFile,
), ),
ListTile( FilledButton.tonalIcon(
title: Text("Help".tl), icon: Icon(Icons.help_outline),
trailing: buildButton(onPressed: help, child: Text("Open".tl)), label: Text("Help".tl),
), onPressed: help,
ListTile( ),
title: Text("Check updates".tl), _CheckUpdatesButton(),
trailing: _CheckUpdatesButton(), ],
), ).paddingHorizontal(12).paddingVertical(8),
const SizedBox(height: 8), const SizedBox(height: 8),
], ],
), ),
@@ -699,11 +692,15 @@ class _CheckUpdatesButtonState extends State<_CheckUpdatesButton> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Button.normal( return FilledButton.tonalIcon(
icon: isLoading ? SizedBox(
width: 18,
height: 18,
child: CircularProgressIndicator(strokeWidth: 2),
) : Icon(Icons.update),
label: Text("Check updates".tl),
onPressed: check, onPressed: check,
isLoading: isLoading, );
child: Text("Check".tl),
).fixHeight(32);
} }
} }