add private to bookmark default open setting
This commit is contained in:
+9
-5
@@ -1032,18 +1032,22 @@ class BookmarkListScreen extends HookConsumerWidget {
|
||||
const BrowserRoute().go(context);
|
||||
}
|
||||
case BookmarkOpenSetting.regular:
|
||||
case BookmarkOpenSetting.private:
|
||||
case BookmarkOpenSetting.isolated:
|
||||
final isolated =
|
||||
settings.effectiveBookmarkOpenSetting ==
|
||||
BookmarkOpenSetting.isolated;
|
||||
final effective = settings.effectiveBookmarkOpenSetting;
|
||||
final tabMode = switch (effective) {
|
||||
BookmarkOpenSetting.private => TabMode.private,
|
||||
BookmarkOpenSetting.isolated => TabMode.newIsolated(),
|
||||
_ => TabMode.regular,
|
||||
};
|
||||
|
||||
await ref
|
||||
.read(tabRepositoryProvider.notifier)
|
||||
.addTab(
|
||||
url: url,
|
||||
tabMode: isolated ? TabMode.newIsolated() : TabMode.regular,
|
||||
tabMode: tabMode,
|
||||
selectTab: true,
|
||||
containerSelection: isolated
|
||||
containerSelection: effective == BookmarkOpenSetting.isolated
|
||||
? const TabContainerSelection.unassigned()
|
||||
: const TabContainerSelection.useSelected(),
|
||||
);
|
||||
|
||||
@@ -479,6 +479,15 @@ class _BookmarkOpenBehaviorSection extends HookConsumerWidget {
|
||||
subtitle: Text('Open the bookmark in a regular tab'),
|
||||
secondary: Icon(MdiIcons.tab),
|
||||
),
|
||||
RadioListTile.adaptive(
|
||||
value: BookmarkOpenSetting.private,
|
||||
title: const Text('Private'),
|
||||
subtitle: const Text('Open the bookmark in a private tab'),
|
||||
secondary: Icon(
|
||||
MdiIcons.dominoMask,
|
||||
color: AppColors.of(context).privateTabPurple,
|
||||
),
|
||||
),
|
||||
const RadioListTile.adaptive(
|
||||
value: BookmarkOpenSetting.customTab,
|
||||
title: Text('Custom Tab'),
|
||||
|
||||
@@ -92,7 +92,7 @@ enum TabIntentOpenSetting { regular, private, isolated, ask }
|
||||
/// Determines what happens when a bookmark is tapped in the bookmark list.
|
||||
/// [ask] shows the "open in..." sheet (today's behavior, and the default);
|
||||
/// the other values open the bookmark directly with no intermediate prompt.
|
||||
enum BookmarkOpenSetting { regular, isolated, customTab, ask }
|
||||
enum BookmarkOpenSetting { regular, private, isolated, customTab, ask }
|
||||
|
||||
enum TabDirection { newestFirst, oldestFirst }
|
||||
|
||||
|
||||
@@ -1352,6 +1352,7 @@ const _$TabIntentOpenSettingEnumMap = {
|
||||
|
||||
const _$BookmarkOpenSettingEnumMap = {
|
||||
BookmarkOpenSetting.regular: 'regular',
|
||||
BookmarkOpenSetting.private: 'private',
|
||||
BookmarkOpenSetting.isolated: 'isolated',
|
||||
BookmarkOpenSetting.customTab: 'customTab',
|
||||
BookmarkOpenSetting.ask: 'ask',
|
||||
|
||||
Reference in New Issue
Block a user