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