Support preview stack

This commit is contained in:
Hillel Coren 2020-11-12 20:17:56 +02:00
parent fb437ed5f5
commit dbb5f758ea
2 changed files with 30 additions and 20 deletions

View File

@ -1465,9 +1465,13 @@ void inspectEntity({
bool longPress = false,
}) {
final store = StoreProvider.of<AppState>(context);
final state = store.state;
if (isDesktop(context)) {
if (longPress) {
viewEntity(context: context, entity: entity);
} else if (state.uiState.previewStack.isNotEmpty) {
viewEntity(context: context, entity: entity, addToStack: true);
} else {
store.dispatch(
FilterByEntity(entityType: entity.entityType, entityId: entity.id));

View File

@ -78,10 +78,14 @@ class _EntityListTileState extends State<EntityListTile> {
: handleEntityAction(context, widget.entity, action),
);
final trailing = IgnorePointer(
final trailing = widget.isFilter
? SizedBox()
: IgnorePointer(
ignoring: !isHovered,
child: IconButton(
icon: Icon(isHovered || isMobile(context)
icon: Icon(isHovered ||
isMobile(context) ||
state.uiState.previewStack.isNotEmpty
? Icons.chevron_right
: Icons.filter_list),
onPressed: () => viewEntity(
@ -108,7 +112,9 @@ class _EntityListTileState extends State<EntityListTile> {
isMenu: true,
child: ListTile(
contentPadding: const EdgeInsets.symmetric(horizontal: 16),
onTap: () =>
onTap: isDesktop(context) && widget.isFilter
? null
: () =>
inspectEntity(context: context, entity: widget.entity),
onLongPress: () => inspectEntity(
context: context, entity: widget.entity, longPress: true),