setting to show close button on new/edit tab screen

This commit is contained in:
Fabian Freund
2026-06-06 08:26:03 +02:00
parent b0ac6c97b0
commit 69aad79b93
6 changed files with 95 additions and 2 deletions
@@ -76,6 +76,21 @@ const List<SettingsSectionDefinition> generalSettingsSections = [
keywords: ['dialogs', 'bottom sheets', 'overlay'],
child: _ShowModalBarrierTile(),
),
SettingsEntryDefinition(
title: 'Show Close Button',
subtitle: 'Add a button to dismiss the search / new-tab page without '
'a back gesture',
keywords: [
'back',
'close',
'dismiss',
'e-ink',
'eink',
'accessibility',
'new tab',
],
child: _ShowSearchCloseButtonTile(),
),
],
),
SettingsSectionDefinition(
@@ -282,6 +297,37 @@ class _ShowModalBarrierTile extends HookConsumerWidget {
}
}
class _ShowSearchCloseButtonTile extends HookConsumerWidget {
const _ShowSearchCloseButtonTile();
@override
Widget build(BuildContext context, WidgetRef ref) {
final showSearchCloseButton = ref.watch(
generalSettingsWithDefaultsProvider.select(
(s) => s.showSearchCloseButton,
),
);
return SwitchListTile.adaptive(
title: const Text('Show Close Button'),
subtitle: const Text(
'Add a button to dismiss the search / new-tab page without a back '
'gesture, useful on devices without a back button',
),
secondary: const Icon(Icons.close),
value: showSearchCloseButton,
onChanged: (value) async {
await ref
.read(saveGeneralSettingsControllerProvider.notifier)
.save(
(currentSettings) =>
currentSettings.copyWith.showSearchCloseButton(value),
);
},
);
}
}
class _PureBlackTile extends HookConsumerWidget {
const _PureBlackTile();