Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Accommodate long switch channel buttons texts #1828

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions packages/app_center/lib/snapd/snap_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import 'package:ubuntu_widgets/ubuntu_widgets.dart';
import 'package:url_launcher/url_launcher_string.dart';
import 'package:yaru/yaru.dart';

const _kPrimaryButtonMaxWidth = 136.0;
const _kChannelDropdownWidth = 220.0;

typedef SnapInfo = ({Widget label, Widget value});
Expand Down Expand Up @@ -336,11 +335,13 @@ class _SnapActionButtons extends ConsumerWidget {
}

final hasActiveChange = snapData.activeChangeId != null;
final primaryActionButton = SizedBox(
width: _kPrimaryButtonMaxWidth,
final primaryActionButton = Flexible(
child: PushButton.elevated(
onPressed: primaryAction.callback(snapData, snapModel, snapLauncher),
child: Text(primaryAction.label(l10n)),
child: Text(
primaryAction.label(l10n),
overflow: TextOverflow.ellipsis,
),
),
);

Expand Down Expand Up @@ -383,8 +384,8 @@ class _SnapActionButtons extends ConsumerWidget {
snapName: snapModel.snapName,
activeChangeId: snapData.activeChangeId!,
)
: OverflowBar(
overflowSpacing: 8,
: Row(
mainAxisSize: MainAxisSize.min,
children: [
primaryActionButton,
if (snapData.isInstalled && snapData.activeChangeId == null)
Expand Down
Loading