mirror of
https://github.com/immich-app/immich.git
synced 2025-12-23 17:25:11 +03:00
revert: viewer_kebab
This commit is contained in:
@@ -8,9 +8,7 @@ import 'package:immich_mobile/presentation/widgets/action_buttons/base_action_bu
|
|||||||
import 'package:immich_mobile/providers/infrastructure/asset_viewer/current_asset.provider.dart';
|
import 'package:immich_mobile/providers/infrastructure/asset_viewer/current_asset.provider.dart';
|
||||||
|
|
||||||
class ViewerKebabMenu extends ConsumerWidget {
|
class ViewerKebabMenu extends ConsumerWidget {
|
||||||
final VoidCallback onConfigureButtons;
|
const ViewerKebabMenu({super.key});
|
||||||
|
|
||||||
const ViewerKebabMenu({super.key, required this.onConfigureButtons});
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
@@ -19,37 +17,29 @@ class ViewerKebabMenu extends ConsumerWidget {
|
|||||||
return const SizedBox.shrink();
|
return const SizedBox.shrink();
|
||||||
}
|
}
|
||||||
|
|
||||||
final theme = context.themeData;
|
|
||||||
final menuChildren = <Widget>[
|
final menuChildren = <Widget>[
|
||||||
BaseActionButton(
|
BaseActionButton(
|
||||||
label: 'open_bottom_sheet_info'.tr(),
|
label: 'about'.tr(),
|
||||||
iconData: Icons.info_outline,
|
iconData: Icons.info_outline,
|
||||||
|
menuItem: true,
|
||||||
onPressed: () => EventStream.shared.emit(const ViewerOpenBottomSheetEvent()),
|
onPressed: () => EventStream.shared.emit(const ViewerOpenBottomSheetEvent()),
|
||||||
),
|
),
|
||||||
const Divider(height: 0),
|
|
||||||
BaseActionButton(label: 'reorder_buttons'.tr(), iconData: Icons.tune, onPressed: onConfigureButtons),
|
|
||||||
];
|
];
|
||||||
|
|
||||||
return MenuAnchor(
|
return MenuAnchor(
|
||||||
|
consumeOutsideTap: true,
|
||||||
style: MenuStyle(
|
style: MenuStyle(
|
||||||
backgroundColor: WidgetStatePropertyAll(theme.scaffoldBackgroundColor),
|
backgroundColor: WidgetStatePropertyAll(context.themeData.scaffoldBackgroundColor),
|
||||||
elevation: const WidgetStatePropertyAll(4),
|
elevation: const WidgetStatePropertyAll(4),
|
||||||
shape: const WidgetStatePropertyAll(
|
shape: const WidgetStatePropertyAll(
|
||||||
RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(12))),
|
RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(12))),
|
||||||
),
|
),
|
||||||
padding: const WidgetStatePropertyAll(EdgeInsets.symmetric(vertical: 2)),
|
|
||||||
),
|
),
|
||||||
menuChildren: menuChildren,
|
menuChildren: menuChildren,
|
||||||
builder: (context, controller, child) {
|
builder: (context, controller, child) {
|
||||||
return IconButton(
|
return IconButton(
|
||||||
icon: const Icon(Icons.more_vert_rounded),
|
icon: const Icon(Icons.more_vert_rounded),
|
||||||
onPressed: () {
|
onPressed: () => controller.isOpen ? controller.close() : controller.open(),
|
||||||
if (controller.isOpen) {
|
|
||||||
controller.close();
|
|
||||||
} else {
|
|
||||||
controller.open();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user