costom tabs setting
This commit is contained in:
@@ -144,6 +144,20 @@ const List<SettingsSectionDefinition> browsingSettingsSections = [
|
||||
keywords: ['intents'],
|
||||
child: _ExternalLinkHandlingSection(),
|
||||
),
|
||||
SettingsEntryDefinition(
|
||||
title: 'Custom Tabs',
|
||||
subtitle:
|
||||
'Let other apps open links in a lightweight in-app tab, instead '
|
||||
'of the main browser',
|
||||
keywords: [
|
||||
'custom tabs',
|
||||
'in-app browser',
|
||||
'chrome custom tabs',
|
||||
'external app',
|
||||
'share',
|
||||
],
|
||||
child: _CustomTabsTile(),
|
||||
),
|
||||
SettingsEntryDefinition(
|
||||
title: 'URL Cleaner',
|
||||
subtitle: 'Tracking removal rules and catalog updates',
|
||||
@@ -821,6 +835,35 @@ class _PullToRefreshTile extends HookConsumerWidget {
|
||||
}
|
||||
}
|
||||
|
||||
class _CustomTabsTile extends HookConsumerWidget {
|
||||
const _CustomTabsTile();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final customTabsEnabled = ref.watch(
|
||||
generalSettingsWithDefaultsProvider.select((s) => s.customTabsEnabled),
|
||||
);
|
||||
|
||||
return SwitchListTile.adaptive(
|
||||
title: const Text('Custom Tabs'),
|
||||
subtitle: const Text(
|
||||
'Let other apps open links in a lightweight in-app tab. When off, '
|
||||
'these links and shared URLs open as normal tabs in the main browser.',
|
||||
),
|
||||
secondary: const Icon(Icons.web_asset),
|
||||
value: customTabsEnabled,
|
||||
onChanged: (value) async {
|
||||
await ref
|
||||
.read(saveGeneralSettingsControllerProvider.notifier)
|
||||
.save(
|
||||
(currentSettings) =>
|
||||
currentSettings.copyWith.customTabsEnabled(value),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _DoubleBackCloseTabTile extends HookConsumerWidget {
|
||||
const _DoubleBackCloseTabTile();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user