quick tab switcher options hide hsitory; hide when no results;

This commit is contained in:
Fabian Freund
2026-02-27 14:04:21 +01:00
parent d25229cb95
commit 60838b446d
17 changed files with 477 additions and 58 deletions
@@ -82,6 +82,7 @@ class _TabBarLayoutSection extends StatelessWidget {
_TabListShowFaviconsTile(),
_ShowQuickTabSwitcherBarTile(),
_QuickTabSwitcherModeSection(),
_QuickTabSwitcherHistorySuggestionsTile(),
_QuickTabSwitcherShowTitlesTile(),
],
);
@@ -125,6 +126,43 @@ class _QuickTabSwitcherShowTitlesTile extends HookConsumerWidget {
}
}
class _QuickTabSwitcherHistorySuggestionsTile extends HookConsumerWidget {
const _QuickTabSwitcherHistorySuggestionsTile();
@override
Widget build(BuildContext context, WidgetRef ref) {
final showHistorySuggestions = ref.watch(
generalSettingsWithDefaultsProvider.select(
(s) => s.quickTabSwitcherShowHistorySuggestions,
),
);
final tabBarShowQuickTabSwitcherBar = ref.watch(
generalSettingsWithDefaultsProvider.select(
(s) => s.tabBarShowQuickTabSwitcherBar,
),
);
return SwitchListTile.adaptive(
title: const Text('History Fallback in Quick Tab Switcher'),
subtitle: const Text(
'Use browsing history suggestions when no tab chips are available',
),
secondary: const Icon(MdiIcons.history),
value: showHistorySuggestions,
onChanged: tabBarShowQuickTabSwitcherBar
? (value) async {
await ref
.read(saveGeneralSettingsControllerProvider.notifier)
.save(
(currentSettings) => currentSettings.copyWith
.quickTabSwitcherShowHistorySuggestions(value),
);
}
: null,
);
}
}
class _GesturesSection extends StatelessWidget {
const _GesturesSection();