From 24b8eb70574288c9533a43e66a1b0a339f5138c9 Mon Sep 17 00:00:00 2001 From: Fabian Freund Date: Sat, 14 Feb 2026 20:33:59 +0100 Subject: [PATCH] disable add to home screen in quick tab switcher --- .../browser_modules/bottom_app_bar.dart | 1 + .../presentation/widgets/tab_menu.dart | 41 ++++++++++--------- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/app/lib/features/geckoview/features/browser/presentation/widgets/browser_modules/bottom_app_bar.dart b/app/lib/features/geckoview/features/browser/presentation/widgets/browser_modules/bottom_app_bar.dart index 118681a8..f118d5e9 100644 --- a/app/lib/features/geckoview/features/browser/presentation/widgets/browser_modules/bottom_app_bar.dart +++ b/app/lib/features/geckoview/features/browser/presentation/widgets/browser_modules/bottom_app_bar.dart @@ -586,6 +586,7 @@ class QuickTabSwitcher extends HookConsumerWidget { enableReaderMode: false, enableReloadButton: false, enableNavigationButtons: false, + enableAddToHomeScreen: false, builder: (context, controller, _) { return InkWell( onLongPress: () { diff --git a/app/lib/features/geckoview/features/browser/presentation/widgets/tab_menu.dart b/app/lib/features/geckoview/features/browser/presentation/widgets/tab_menu.dart index 1f98e5b0..b2587694 100644 --- a/app/lib/features/geckoview/features/browser/presentation/widgets/tab_menu.dart +++ b/app/lib/features/geckoview/features/browser/presentation/widgets/tab_menu.dart @@ -59,6 +59,7 @@ class TabMenu extends HookConsumerWidget { final bool enableDesktopMode; final bool enableFetchFeeds; final bool enableAddBookmark; + final bool enableAddToHomeScreen; final bool enableCloneTab; final bool enableContainer; final bool enableShare; @@ -77,6 +78,7 @@ class TabMenu extends HookConsumerWidget { this.enableDesktopMode = true, this.enableFetchFeeds = true, this.enableAddBookmark = true, + this.enableAddToHomeScreen = true, this.enableCloneTab = true, this.enableContainer = true, this.enableShare = true, @@ -197,27 +199,28 @@ class TabMenu extends HookConsumerWidget { ).push(context); }, ), - Consumer( - builder: (context, ref, child) { - final isInstallable = ref.watch(isCurrentTabInstallableProvider); + if (enableAddToHomeScreen) + Consumer( + builder: (context, ref, child) { + final isInstallable = ref.watch(isCurrentTabInstallableProvider); - return Visibility( - visible: isInstallable, - child: MenuItemButton( - closeOnActivate: false, - leadingIcon: const Icon(Icons.add_to_home_screen), - child: const Text('Add to Home Screen'), - onPressed: () async { - await showPwaInstallDialog(context, ref); + return Visibility( + visible: isInstallable, + child: MenuItemButton( + closeOnActivate: false, + leadingIcon: const Icon(Icons.add_to_home_screen), + child: const Text('Add to Home Screen'), + onPressed: () async { + await showPwaInstallDialog(context, ref); - if (context.mounted) { - MenuController.maybeOf(context)?.close(); - } - }, - ), - ); - }, - ), + if (context.mounted) { + MenuController.maybeOf(context)?.close(); + } + }, + ), + ); + }, + ), if (enableCloneTab) SubmenuButton( menuChildren: [