Merge pull request #6279 from sahilyeole/feat/list_view
Fix: change view dropdown not working on macos clicking
This commit is contained in:
commit
0c1f3d056a
@ -765,8 +765,6 @@ class PeerViewDropdown extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _PeerViewDropdownState extends State<PeerViewDropdown> {
|
class _PeerViewDropdownState extends State<PeerViewDropdown> {
|
||||||
RelativeRect menuPos = RelativeRect.fromLTRB(0, 0, 0, 0);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final List<PeerUiType> types = [PeerUiType.grid, PeerUiType.tile, PeerUiType.list];
|
final List<PeerUiType> types = [PeerUiType.grid, PeerUiType.tile, PeerUiType.list];
|
||||||
@ -806,6 +804,7 @@ class _PeerViewDropdownState extends State<PeerViewDropdown> {
|
|||||||
))));
|
))));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var menuPos = RelativeRect.fromLTRB(0, 0, 0, 0);
|
||||||
return _hoverAction(
|
return _hoverAction(
|
||||||
context: context,
|
context: context,
|
||||||
child: Tooltip(
|
child: Tooltip(
|
||||||
@ -821,16 +820,14 @@ class _PeerViewDropdownState extends State<PeerViewDropdown> {
|
|||||||
onTapDown: (details) {
|
onTapDown: (details) {
|
||||||
final x = details.globalPosition.dx;
|
final x = details.globalPosition.dx;
|
||||||
final y = details.globalPosition.dy;
|
final y = details.globalPosition.dy;
|
||||||
setState(() {
|
|
||||||
menuPos = RelativeRect.fromLTRB(x, y, x, y);
|
menuPos = RelativeRect.fromLTRB(x, y, x, y);
|
||||||
});
|
|
||||||
},
|
},
|
||||||
onTap: () => showMenu(
|
onTap: () => showMenu(
|
||||||
context: context,
|
context: context,
|
||||||
position: menuPos,
|
position: menuPos,
|
||||||
items: items,
|
items: items,
|
||||||
elevation: 8,
|
elevation: 8,
|
||||||
),
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user