mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 19:14:42 +08:00
tweaks (#1846)
* opt: live extra * opt: remove addPointer * opt: use ssd * opt: cache svg * opt: localToGlobal * opt: disabled icon * opt: onVideoDetailChange switch * fix --------- Co-authored-by: dom <githubaccount56556@proton.me>
This commit is contained in:
committed by
GitHub
parent
4a3d827f7a
commit
e707764f84
@@ -45,19 +45,19 @@ class _PopupListTileState<T> extends State<PopupListTile<T>> {
|
||||
final _key = PlatformUtils.isDesktop ? null : GlobalKey();
|
||||
|
||||
void _showButtonMenu(TapUpDetails details, T value) {
|
||||
final box = context.findRenderObject() as RenderBox;
|
||||
final offset = box.localToGlobal(box.size.topLeft(.zero));
|
||||
final thisOffset = details.globalPosition - details.localPosition;
|
||||
final double dx;
|
||||
if (PlatformUtils.isDesktop) {
|
||||
dx = details.globalPosition.dx + 1;
|
||||
} else {
|
||||
final box = _key!.currentContext!.findRenderObject() as RenderBox;
|
||||
final offset = box.localToGlobal(box.size.topLeft(.zero));
|
||||
dx = offset.dx;
|
||||
final thisBox = context.findRenderObject() as RenderBox;
|
||||
final titleBox = _key!.currentContext!.findRenderObject() as RenderBox;
|
||||
final titleOffset = titleBox.localToGlobal(.zero, ancestor: thisBox);
|
||||
dx = thisOffset.dx + titleOffset.dx;
|
||||
}
|
||||
showMenu<T?>(
|
||||
context: context,
|
||||
position: RelativeRect.fromLTRB(dx, offset.dy + 5, dx, 0),
|
||||
position: RelativeRect.fromLTRB(dx, thisOffset.dy + 5, dx, 0),
|
||||
items: widget.itemBuilder(context),
|
||||
initialValue: value,
|
||||
requestFocus: false,
|
||||
|
||||
Reference in New Issue
Block a user