mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-12-28 15:45:43 +00:00
fix: incorrect popover position (#7452)
* fix: incorrect popover position * fix: tests --------- Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>
This commit is contained in:
parent
e9371029f3
commit
2dd7e5937f
@ -1,8 +1,7 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:appflowy/generated/flowy_svgs.g.dart';
|
||||
import 'package:flowy_infra_ui/widget/flowy_tooltip.dart';
|
||||
import 'package:flowy_infra_ui/widget/ignore_parent_gesture.dart';
|
||||
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class BlockActionButton extends StatelessWidget {
|
||||
@ -23,15 +22,17 @@ class BlockActionButton extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Widget child = MouseRegion(
|
||||
cursor: Platform.isWindows
|
||||
? SystemMouseCursors.click
|
||||
: SystemMouseCursors.grab,
|
||||
child: IgnoreParentGestureWidget(
|
||||
onPress: onPointerDown,
|
||||
child: GestureDetector(
|
||||
onTap: onTap,
|
||||
behavior: HitTestBehavior.deferToChild,
|
||||
return FlowyTooltip(
|
||||
richMessage: showTooltip ? richMessage : null,
|
||||
child: FlowyIconButton(
|
||||
width: 18.0,
|
||||
hoverColor: Colors.transparent,
|
||||
iconColorOnHover: Theme.of(context).iconTheme.color,
|
||||
onPressed: onTap,
|
||||
icon: MouseRegion(
|
||||
cursor: Platform.isWindows
|
||||
? SystemMouseCursors.click
|
||||
: SystemMouseCursors.grab,
|
||||
child: FlowySvg(
|
||||
svg,
|
||||
size: const Size.square(18.0),
|
||||
@ -40,14 +41,5 @@ class BlockActionButton extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
if (showTooltip) {
|
||||
child = FlowyTooltip(
|
||||
richMessage: richMessage,
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
|
||||
return child;
|
||||
}
|
||||
}
|
||||
|
||||
@ -50,7 +50,6 @@ class _BlockOptionButtonState extends State<BlockOptionButton> {
|
||||
child: BlocBuilder<BlockActionOptionCubit, BlockActionOptionState>(
|
||||
builder: (context, _) => PopoverActionList<PopoverAction>(
|
||||
actions: _buildPopoverActions(context),
|
||||
popoverMutex: PopoverMutex(),
|
||||
animationDuration: Durations.short3,
|
||||
slideDistance: 5,
|
||||
beginScaleFactor: 1.0,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user