Skip to content

Commit

Permalink
feat: add 'show details' action to manage page (#1322)
Browse files Browse the repository at this point in the history
* feat: add 'show details' action to manage page

Just a single item in the dropdown for the MVP

* simplify 'onPressed'
  • Loading branch information
d-loose authored Aug 10, 2023
1 parent 7836196 commit b0f29c2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
8 changes: 1 addition & 7 deletions lib/src/detail/detail_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -292,13 +292,7 @@ class _SnapActionButtons extends ConsumerWidget {
);
}).toList(),
builder: (context, controller, child) => YaruOptionButton(
onPressed: () {
if (controller.isOpen) {
controller.close();
} else {
controller.open();
}
},
onPressed: controller.isOpen ? controller.close : controller.open,
child: const Icon(YaruIcons.view_more_horizontal),
),
);
Expand Down
1 change: 1 addition & 0 deletions lib/src/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"managePageInstalledAndUpdatedLabel": "Installed and updated",
"managePageLabel": "Manage",
"managePageNoUpdatesAvailableDescription": "No updates available. Your applications are all up to date.",
"managePageShowDetailsLabel": "Show details",
"managePageUpdateAllLabel": "Update All",
"managePageUpdatedDaysAgo": "Updated {n} days ago",
"@managePageUpdatedDaysAgo": {
Expand Down
18 changes: 14 additions & 4 deletions lib/src/manage/manage_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -337,10 +337,20 @@ class _ManageSnapTile extends ConsumerWidget {
child: Text(l10n.snapActionOpenLabel),
),
),
// TODO: seconday actions
YaruOptionButton(
onPressed: () {},
child: const Icon(YaruIcons.view_more_horizontal),
MenuAnchor(
menuChildren: [
MenuItemButton(
onPressed: () => StoreNavigator.pushDetail(context, snap.name),
child: Text(
l10n.managePageShowDetailsLabel,
style: Theme.of(context).textTheme.bodyMedium,
),
)
],
builder: (context, controller, child) => YaruOptionButton(
onPressed: controller.isOpen ? controller.close : controller.open,
child: const Icon(YaruIcons.view_more_horizontal),
),
)
],
),
Expand Down

0 comments on commit b0f29c2

Please sign in to comment.