add setting to disable automatic clipboard access (#159)
This commit is contained in:
@@ -74,6 +74,7 @@ class _SearchSection extends StatelessWidget {
|
||||
_BangsTile(),
|
||||
_AutocompleteProviderSection(),
|
||||
_MaxSearchHistoryEntriesSection(),
|
||||
_AllowClipboardAccessTile(),
|
||||
],
|
||||
);
|
||||
}
|
||||
@@ -470,3 +471,29 @@ class _AddonCollectionTile extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _AllowClipboardAccessTile extends HookConsumerWidget {
|
||||
const _AllowClipboardAccessTile();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final allowClipboardAccess = ref.watch(
|
||||
generalSettingsWithDefaultsProvider.select((s) => s.allowClipboardAccess),
|
||||
);
|
||||
|
||||
return SwitchListTile.adaptive(
|
||||
title: const Text('Allow clipboard access for suggestions'),
|
||||
subtitle: const Text('Browser can read clipboard to suggest URLs'),
|
||||
secondary: const Icon(MdiIcons.clipboardTextOutline),
|
||||
value: allowClipboardAccess,
|
||||
onChanged: (value) async {
|
||||
await ref
|
||||
.read(saveGeneralSettingsControllerProvider.notifier)
|
||||
.save(
|
||||
(currentSettings) =>
|
||||
currentSettings.copyWith.allowClipboardAccess(value),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user