move reorder into own menu
This commit is contained in:
+31
-19
@@ -78,6 +78,7 @@ class TabMenu extends HookConsumerWidget {
|
|||||||
final bool enableReloadButton;
|
final bool enableReloadButton;
|
||||||
final bool enableNavigationButtons;
|
final bool enableNavigationButtons;
|
||||||
final bool enableHierarchy;
|
final bool enableHierarchy;
|
||||||
|
final bool enableReorder;
|
||||||
|
|
||||||
const TabMenu({
|
const TabMenu({
|
||||||
super.key,
|
super.key,
|
||||||
@@ -99,6 +100,7 @@ class TabMenu extends HookConsumerWidget {
|
|||||||
this.enableReloadButton = true,
|
this.enableReloadButton = true,
|
||||||
this.enableNavigationButtons = true,
|
this.enableNavigationButtons = true,
|
||||||
this.enableHierarchy = true,
|
this.enableHierarchy = true,
|
||||||
|
this.enableReorder = true,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -613,35 +615,45 @@ class TabMenu extends HookConsumerWidget {
|
|||||||
: null,
|
: null,
|
||||||
child: const Text('Detach from parent'),
|
child: const Text('Detach from parent'),
|
||||||
),
|
),
|
||||||
const Divider(),
|
],
|
||||||
MenuItemButton(
|
child: const Text('Hierarchy'),
|
||||||
leadingIcon: const Icon(MdiIcons.chevronUp),
|
);
|
||||||
onPressed: () async {
|
},
|
||||||
await repo.moveTabAmongSiblings(
|
),
|
||||||
|
if (enableReorder)
|
||||||
|
SubmenuButton(
|
||||||
|
leadingIcon: const Icon(MdiIcons.swapVertical),
|
||||||
|
menuChildren: [
|
||||||
|
MenuItemButton(
|
||||||
|
leadingIcon: const Icon(MdiIcons.chevronUp),
|
||||||
|
onPressed: () async {
|
||||||
|
await ref
|
||||||
|
.read(tabDataRepositoryProvider.notifier)
|
||||||
|
.moveTabAmongSiblings(
|
||||||
selectedTabId,
|
selectedTabId,
|
||||||
down:
|
down:
|
||||||
settings.tabListDirection ==
|
settings.tabListDirection ==
|
||||||
TabDirection.newestFirst,
|
TabDirection.newestFirst,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
child: const Text('Move up'),
|
child: const Text('Move up'),
|
||||||
),
|
),
|
||||||
MenuItemButton(
|
MenuItemButton(
|
||||||
leadingIcon: const Icon(MdiIcons.chevronDown),
|
leadingIcon: const Icon(MdiIcons.chevronDown),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
await repo.moveTabAmongSiblings(
|
await ref
|
||||||
|
.read(tabDataRepositoryProvider.notifier)
|
||||||
|
.moveTabAmongSiblings(
|
||||||
selectedTabId,
|
selectedTabId,
|
||||||
down:
|
down:
|
||||||
settings.tabListDirection !=
|
settings.tabListDirection !=
|
||||||
TabDirection.newestFirst,
|
TabDirection.newestFirst,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
child: const Text('Move down'),
|
child: const Text('Move down'),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
child: const Text('Hierarchy'),
|
child: const Text('Reorder'),
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
if (enableShare)
|
if (enableShare)
|
||||||
SubmenuButton(
|
SubmenuButton(
|
||||||
|
|||||||
Reference in New Issue
Block a user