disable add to home screen in quick tab switcher

This commit is contained in:
Fabian Freund
2026-02-14 20:33:59 +01:00
parent 7a77611272
commit 24b8eb7057
2 changed files with 23 additions and 19 deletions
@@ -586,6 +586,7 @@ class QuickTabSwitcher extends HookConsumerWidget {
enableReaderMode: false, enableReaderMode: false,
enableReloadButton: false, enableReloadButton: false,
enableNavigationButtons: false, enableNavigationButtons: false,
enableAddToHomeScreen: false,
builder: (context, controller, _) { builder: (context, controller, _) {
return InkWell( return InkWell(
onLongPress: () { onLongPress: () {
@@ -59,6 +59,7 @@ class TabMenu extends HookConsumerWidget {
final bool enableDesktopMode; final bool enableDesktopMode;
final bool enableFetchFeeds; final bool enableFetchFeeds;
final bool enableAddBookmark; final bool enableAddBookmark;
final bool enableAddToHomeScreen;
final bool enableCloneTab; final bool enableCloneTab;
final bool enableContainer; final bool enableContainer;
final bool enableShare; final bool enableShare;
@@ -77,6 +78,7 @@ class TabMenu extends HookConsumerWidget {
this.enableDesktopMode = true, this.enableDesktopMode = true,
this.enableFetchFeeds = true, this.enableFetchFeeds = true,
this.enableAddBookmark = true, this.enableAddBookmark = true,
this.enableAddToHomeScreen = true,
this.enableCloneTab = true, this.enableCloneTab = true,
this.enableContainer = true, this.enableContainer = true,
this.enableShare = true, this.enableShare = true,
@@ -197,27 +199,28 @@ class TabMenu extends HookConsumerWidget {
).push(context); ).push(context);
}, },
), ),
Consumer( if (enableAddToHomeScreen)
builder: (context, ref, child) { Consumer(
final isInstallable = ref.watch(isCurrentTabInstallableProvider); builder: (context, ref, child) {
final isInstallable = ref.watch(isCurrentTabInstallableProvider);
return Visibility( return Visibility(
visible: isInstallable, visible: isInstallable,
child: MenuItemButton( child: MenuItemButton(
closeOnActivate: false, closeOnActivate: false,
leadingIcon: const Icon(Icons.add_to_home_screen), leadingIcon: const Icon(Icons.add_to_home_screen),
child: const Text('Add to Home Screen'), child: const Text('Add to Home Screen'),
onPressed: () async { onPressed: () async {
await showPwaInstallDialog(context, ref); await showPwaInstallDialog(context, ref);
if (context.mounted) { if (context.mounted) {
MenuController.maybeOf(context)?.close(); MenuController.maybeOf(context)?.close();
} }
}, },
), ),
); );
}, },
), ),
if (enableCloneTab) if (enableCloneTab)
SubmenuButton( SubmenuButton(
menuChildren: [ menuChildren: [