Support preview stack
This commit is contained in:
parent
fb437ed5f5
commit
dbb5f758ea
|
|
@ -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));
|
||||||
|
|
|
||||||
|
|
@ -78,24 +78,28 @@ class _EntityListTileState extends State<EntityListTile> {
|
||||||
: handleEntityAction(context, widget.entity, action),
|
: handleEntityAction(context, widget.entity, action),
|
||||||
);
|
);
|
||||||
|
|
||||||
final trailing = IgnorePointer(
|
final trailing = widget.isFilter
|
||||||
ignoring: !isHovered,
|
? SizedBox()
|
||||||
child: IconButton(
|
: IgnorePointer(
|
||||||
icon: Icon(isHovered || isMobile(context)
|
ignoring: !isHovered,
|
||||||
? Icons.chevron_right
|
child: IconButton(
|
||||||
: Icons.filter_list),
|
icon: Icon(isHovered ||
|
||||||
onPressed: () => viewEntity(
|
isMobile(context) ||
|
||||||
entity: widget.entity,
|
state.uiState.previewStack.isNotEmpty
|
||||||
context: context,
|
? Icons.chevron_right
|
||||||
addToStack: isDesktop(context) && !widget.isFilter,
|
: Icons.filter_list),
|
||||||
),
|
onPressed: () => viewEntity(
|
||||||
color: isFilteredBy
|
entity: widget.entity,
|
||||||
? (state.prefState.enableDarkMode
|
context: context,
|
||||||
? Colors.white
|
addToStack: isDesktop(context) && !widget.isFilter,
|
||||||
: Theme.of(context).accentColor)
|
),
|
||||||
: null,
|
color: isFilteredBy
|
||||||
),
|
? (state.prefState.enableDarkMode
|
||||||
);
|
? Colors.white
|
||||||
|
: Theme.of(context).accentColor)
|
||||||
|
: null,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
return MouseRegion(
|
return MouseRegion(
|
||||||
onEnter: (event) => setState(() => _isHovered = true),
|
onEnter: (event) => setState(() => _isHovered = true),
|
||||||
|
|
@ -108,8 +112,10 @@ 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
|
||||||
inspectEntity(context: context, entity: widget.entity),
|
? null
|
||||||
|
: () =>
|
||||||
|
inspectEntity(context: context, entity: widget.entity),
|
||||||
onLongPress: () => inspectEntity(
|
onLongPress: () => inspectEntity(
|
||||||
context: context, entity: widget.entity, longPress: true),
|
context: context, entity: widget.entity, longPress: true),
|
||||||
title: Text(
|
title: Text(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue