Fix buttons in detail pane not scrollable

This commit is contained in:
Ming Ming 2021-08-29 02:45:28 +08:00
parent 0a546a29df
commit afaea7a337

View file

@ -113,43 +113,46 @@ class _ViewerDetailPaneState extends State<ViewerDetailPane> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( SingleChildScrollView(
children: [ scrollDirection: Axis.horizontal,
if (widget.album != null && child: Row(
widget.album!.albumFile?.isOwned(widget.account.username) == children: [
true && if (widget.album != null &&
widget.album!.provider is AlbumStaticProvider) widget.album!.albumFile?.isOwned(widget.account.username) ==
true &&
widget.album!.provider is AlbumStaticProvider)
_DetailPaneButton(
icon: Icons.remove_outlined,
label: L10n.of(context).removeFromAlbumTooltip,
onPressed: () => _onRemoveFromAlbumPressed(context),
),
if (widget.album != null &&
widget.album!.albumFile?.isOwned(widget.account.username) ==
true)
_DetailPaneButton(
icon: Icons.photo_album_outlined,
label: L10n.of(context).useAsAlbumCoverTooltip,
onPressed: () => _onSetAlbumCoverPressed(context),
),
_DetailPaneButton( _DetailPaneButton(
icon: Icons.remove_outlined, icon: Icons.playlist_add_outlined,
label: L10n.of(context).removeFromAlbumTooltip, label: L10n.of(context).addToAlbumTooltip,
onPressed: () => _onRemoveFromAlbumPressed(context), onPressed: () => _onAddToAlbumPressed(context),
), ),
if (widget.album != null && if (widget.file.isArchived == true)
widget.album!.albumFile?.isOwned(widget.account.username) == _DetailPaneButton(
true) icon: Icons.unarchive_outlined,
_DetailPaneButton( label: L10n.of(context).unarchiveTooltip,
icon: Icons.photo_album_outlined, onPressed: () => _onUnarchivePressed(context),
label: L10n.of(context).useAsAlbumCoverTooltip, )
onPressed: () => _onSetAlbumCoverPressed(context), else
), _DetailPaneButton(
_DetailPaneButton( icon: Icons.archive_outlined,
icon: Icons.playlist_add_outlined, label: L10n.of(context).archiveTooltip,
label: L10n.of(context).addToAlbumTooltip, onPressed: () => _onArchivePressed(context),
onPressed: () => _onAddToAlbumPressed(context), ),
), ],
if (widget.file.isArchived == true) ),
_DetailPaneButton(
icon: Icons.unarchive_outlined,
label: L10n.of(context).unarchiveTooltip,
onPressed: () => _onUnarchivePressed(context),
)
else
_DetailPaneButton(
icon: Icons.archive_outlined,
label: L10n.of(context).archiveTooltip,
onPressed: () => _onArchivePressed(context),
),
],
), ),
Padding( Padding(
padding: const EdgeInsets.symmetric(horizontal: 32), padding: const EdgeInsets.symmetric(horizontal: 32),