add long press actions on contextual buttons; move extension shortcut into contextual; disable reader view button in tab bar;
This commit is contained in:
@@ -27,6 +27,7 @@ import 'package:weblibre/features/geckoview/features/browser/features/contextual
|
||||
import 'package:weblibre/features/geckoview/features/browser/features/contextual_toolbar/presentation/models/contextual_toolbar_scope.dart';
|
||||
import 'package:weblibre/features/geckoview/features/browser/features/contextual_toolbar/presentation/toolbar_button_registry.dart';
|
||||
import 'package:weblibre/features/geckoview/features/browser/features/contextual_toolbar/presentation/widgets/contextual_toolbar.dart';
|
||||
import 'package:weblibre/features/geckoview/features/browser/presentation/widgets/browser_modules/bottom_app_bar.dart';
|
||||
import 'package:weblibre/features/user/data/database/definitions.drift.dart';
|
||||
|
||||
class ContextualToolbarSettingsScreen extends HookConsumerWidget {
|
||||
@@ -273,10 +274,12 @@ class _ToolbarPreviewDelegate extends SliverPersistentHeaderDelegate {
|
||||
|
||||
final List<ToolbarButtonConfig> configs;
|
||||
|
||||
static const _previewHeight = BrowserTabBar.contextualToolabarHeight;
|
||||
|
||||
@override
|
||||
double get minExtent => 56.0;
|
||||
double get minExtent => _previewHeight;
|
||||
@override
|
||||
double get maxExtent => 56.0;
|
||||
double get maxExtent => _previewHeight;
|
||||
|
||||
@override
|
||||
Widget build(
|
||||
@@ -284,9 +287,12 @@ class _ToolbarPreviewDelegate extends SliverPersistentHeaderDelegate {
|
||||
double shrinkOffset,
|
||||
bool overlapsContent,
|
||||
) {
|
||||
return ColoredBox(
|
||||
color: Theme.of(context).colorScheme.surfaceContainer,
|
||||
child: _ToolbarPreview(configs: configs),
|
||||
return SizedBox(
|
||||
height: maxExtent,
|
||||
child: ColoredBox(
|
||||
color: Theme.of(context).colorScheme.surfaceContainer,
|
||||
child: _ToolbarPreview(configs: configs),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -91,7 +91,6 @@ class _ContentViewingSection extends StatelessWidget {
|
||||
SettingSection(name: 'Content Viewing'),
|
||||
_PdfViewerTile(),
|
||||
_EnableReaderModeTile(),
|
||||
_ReaderModeInTabBarTile(),
|
||||
_EnforceReaderModeTile(),
|
||||
],
|
||||
);
|
||||
@@ -416,34 +415,6 @@ class _EnforceReaderModeTile extends HookConsumerWidget {
|
||||
}
|
||||
}
|
||||
|
||||
class _ReaderModeInTabBarTile extends HookConsumerWidget {
|
||||
const _ReaderModeInTabBarTile();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final tabBarReaderView = ref.watch(
|
||||
generalSettingsWithDefaultsProvider.select((s) => s.tabBarReaderView),
|
||||
);
|
||||
|
||||
return SwitchListTile.adaptive(
|
||||
title: const Text('Reader Mode in Tab Bar'),
|
||||
subtitle: const Text(
|
||||
'Show reader mode button in the tab bar instead of only in the tab menu',
|
||||
),
|
||||
secondary: const Icon(MdiIcons.bookHeart),
|
||||
value: tabBarReaderView,
|
||||
onChanged: (value) async {
|
||||
await ref
|
||||
.read(saveGeneralSettingsControllerProvider.notifier)
|
||||
.save(
|
||||
(currentSettings) =>
|
||||
currentSettings.copyWith.tabBarReaderView(value),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _PdfViewerTile extends HookConsumerWidget {
|
||||
const _PdfViewerTile();
|
||||
|
||||
|
||||
@@ -78,7 +78,6 @@ class _TabBarLayoutSection extends StatelessWidget {
|
||||
children: [
|
||||
_TabBarPositionSection(),
|
||||
_TabBarLayoutModeSection(),
|
||||
_ShowExtensionShortcutTile(),
|
||||
_ShowContextualTabBarTile(),
|
||||
_CustomizeToolbarButtonsTile(),
|
||||
_AutoHideTabBarTile(),
|
||||
@@ -256,12 +255,6 @@ class _TabBarPreviewCard extends HookWidget {
|
||||
}
|
||||
|
||||
final mainToolbarActions = <Widget>[
|
||||
if (settings.showExtensionShortcut)
|
||||
IconButton(
|
||||
onPressed: () {},
|
||||
icon: const Icon(MdiIcons.puzzle),
|
||||
tooltip: 'Extensions',
|
||||
),
|
||||
if (showMainToolbarActionButtons) tabCountButton,
|
||||
if (showMainToolbarActionButtons) NavigationMenuButtonView(onTap: () {}),
|
||||
];
|
||||
@@ -639,34 +632,6 @@ class _CustomizeToolbarButtonsTile extends HookConsumerWidget {
|
||||
}
|
||||
}
|
||||
|
||||
class _ShowExtensionShortcutTile extends HookConsumerWidget {
|
||||
const _ShowExtensionShortcutTile();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final showExtensionShortcut = ref.watch(
|
||||
generalSettingsWithDefaultsProvider.select(
|
||||
(s) => s.showExtensionShortcut,
|
||||
),
|
||||
);
|
||||
|
||||
return SwitchListTile.adaptive(
|
||||
title: const Text('Show Extension Shortcut'),
|
||||
subtitle: const Text('Display an extension menu directly on the tab bar'),
|
||||
secondary: const Icon(MdiIcons.puzzleHeart),
|
||||
value: showExtensionShortcut,
|
||||
onChanged: (value) async {
|
||||
await ref
|
||||
.read(saveGeneralSettingsControllerProvider.notifier)
|
||||
.save(
|
||||
(currentSettings) =>
|
||||
currentSettings.copyWith.showExtensionShortcut(value),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _ShowQuickTabSwitcherBarTile extends HookConsumerWidget {
|
||||
const _ShowQuickTabSwitcherBarTile();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user