customize quick tab switcher buttons

This commit is contained in:
Fabian Freund
2026-07-06 17:48:58 +02:00
parent 10052ed3a3
commit 1b1c33dee5
30 changed files with 4763 additions and 133 deletions
@@ -92,6 +92,12 @@ const List<SettingsSectionDefinition> toolbarLayoutSettingsSections = [
],
child: _TabBarStackingModeSection(),
),
SettingsEntryDefinition(
title: 'Customize Switcher Buttons',
subtitle: 'Choose which action buttons appear at the end of the bar',
keywords: ['buttons', 'new tab', 'actions', 'trailing'],
child: _CustomizeQuickSwitcherButtonsTile(),
),
SettingsEntryDefinition(
title: 'Close Buttons on All Tabs',
subtitle: 'Show a close button on every switcher chip',
@@ -328,6 +334,33 @@ class _CustomizeToolbarButtonsTile extends HookConsumerWidget {
}
}
class _CustomizeQuickSwitcherButtonsTile extends HookConsumerWidget {
const _CustomizeQuickSwitcherButtonsTile();
@override
Widget build(BuildContext context, WidgetRef ref) {
final switcherEnabled = ref.watch(
generalSettingsWithDefaultsProvider.select(
(s) => s.effectiveTabBarStackingMode() != TabBarStackingMode.disabled,
),
);
return ListTile(
leading: const Icon(Icons.tune),
title: const Text('Customize Switcher Buttons'),
subtitle: const Text(
'Action buttons pinned at the end of the switcher bar (independent of '
'the contextual toolbar)',
),
trailing: const Icon(Icons.chevron_right),
enabled: switcherEnabled,
onTap: () async {
await const QuickSwitcherToolbarSettingsRoute().push(context);
},
);
}
}
class _TabBarStackingModeSection extends HookConsumerWidget {
const _TabBarStackingModeSection();