improve dividers

This commit is contained in:
Fabian Freund
2026-01-30 03:21:23 +01:00
parent aa7cda5708
commit 237cbc9ffa
2 changed files with 61 additions and 59 deletions
@@ -868,8 +868,8 @@ class NavigationMenuButton extends HookConsumerWidget {
leadingIcon: const Icon(Icons.refresh),
child: const Text('Reload'),
),
if (selectedTabId != null) const Divider(),
if (selectedTabId != null && showNavigationButtons)
if (selectedTabId != null && showNavigationButtons) ...[
const Divider(),
Consumer(
builder: (context, ref, child) {
final history = ref.watch(
@@ -906,6 +906,7 @@ class NavigationMenuButton extends HookConsumerWidget {
);
},
),
],
],
);
}
@@ -271,63 +271,6 @@ class TabViewHeader extends HookConsumerWidget {
MenuAnchor(
controller: tabsActionMenuController,
menuChildren: [
MenuItemButton(
leadingIcon: const Icon(MdiIcons.bookmarkPlusOutline),
child: const Text('Bookmark all'),
onPressed: () async {
final choice = await showBookmarkAllDialog(context);
if (choice == null || !context.mounted) return;
final containerId = ref.read(
selectedContainerProvider,
);
final tabData = await ref
.read(tabDataRepositoryProvider.notifier)
.getContainerTabsData(containerId);
if (choice == BookmarkAllChoice.fast) {
if (!context.mounted) return;
final folderGuid = await showSelectFolderDialog(
context,
);
if (folderGuid == null) return;
final repo = ref.read(
bookmarksRepositoryProvider.notifier,
);
for (final tab in tabData) {
if (tab.url != null) {
await repo.addBookmark(
parentGuid: folderGuid,
url: tab.url!,
title: tab.title ?? tab.url.toString(),
);
}
}
if (context.mounted) {
ui_helper.showInfoMessage(
context,
'${tabData.length} bookmark(s) added',
);
}
} else {
for (final tab in tabData) {
if (context.mounted) {
await BookmarkEntryAddRoute(
bookmarkInfo: jsonEncode(
BookmarkInfo(
title: tab.title,
url: tab.url.toString(),
).encode(),
),
).push(context);
}
}
}
},
),
MenuItemButton(
leadingIcon: const Icon(MdiIcons.closeCircle),
child: const Text('Close All Tabs'),
@@ -389,6 +332,64 @@ class TabViewHeader extends HookConsumerWidget {
}
},
),
const Divider(),
MenuItemButton(
leadingIcon: const Icon(MdiIcons.bookmarkPlusOutline),
child: const Text('Bookmark all'),
onPressed: () async {
final choice = await showBookmarkAllDialog(context);
if (choice == null || !context.mounted) return;
final containerId = ref.read(
selectedContainerProvider,
);
final tabData = await ref
.read(tabDataRepositoryProvider.notifier)
.getContainerTabsData(containerId);
if (choice == BookmarkAllChoice.fast) {
if (!context.mounted) return;
final folderGuid = await showSelectFolderDialog(
context,
);
if (folderGuid == null) return;
final repo = ref.read(
bookmarksRepositoryProvider.notifier,
);
for (final tab in tabData) {
if (tab.url != null) {
await repo.addBookmark(
parentGuid: folderGuid,
url: tab.url!,
title: tab.title ?? tab.url.toString(),
);
}
}
if (context.mounted) {
ui_helper.showInfoMessage(
context,
'${tabData.length} bookmark(s) added',
);
}
} else {
for (final tab in tabData) {
if (context.mounted) {
await BookmarkEntryAddRoute(
bookmarkInfo: jsonEncode(
BookmarkInfo(
title: tab.title,
url: tab.url.toString(),
).encode(),
),
).push(context);
}
}
}
},
),
Consumer(
builder: (context, ref, child) {
final selectedContainer = ref.watch(