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, bool longPress = false,
}) { }) {
final store = StoreProvider.of<AppState>(context); final store = StoreProvider.of<AppState>(context);
final state = store.state;
if (isDesktop(context)) { if (isDesktop(context)) {
if (longPress) { if (longPress) {
viewEntity(context: context, entity: entity); viewEntity(context: context, entity: entity);
} else if (state.uiState.previewStack.isNotEmpty) {
viewEntity(context: context, entity: entity, addToStack: true);
} else { } else {
store.dispatch( store.dispatch(
FilterByEntity(entityType: entity.entityType, entityId: entity.id)); FilterByEntity(entityType: entity.entityType, entityId: entity.id));

View File

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