mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: do not rebuild hover on item selection (#3423)
This commit is contained in:
parent
daf9b48c73
commit
b700f95c7f
@ -249,21 +249,23 @@ class SingleInnerViewItem extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _SingleInnerViewItemState extends State<SingleInnerViewItem> {
|
class _SingleInnerViewItemState extends State<SingleInnerViewItem> {
|
||||||
|
bool _isHovering = false;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
if (widget.isFeedback) {
|
if (widget.isFeedback) {
|
||||||
return _buildViewItem(false);
|
return _buildViewItem(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
return FlowyHover(
|
return MouseRegion(
|
||||||
style: HoverStyle(
|
onEnter: (_) => setState(() => _isHovering = true),
|
||||||
hoverColor: Theme.of(context).colorScheme.secondary,
|
onExit: (_) => setState(() => _isHovering = false),
|
||||||
|
child: FlowyHover(
|
||||||
|
isSelected: () =>
|
||||||
|
widget.showActions ||
|
||||||
|
getIt<MenuSharedState>().latestOpenView?.id == widget.view.id,
|
||||||
|
child: _buildViewItem(_isHovering),
|
||||||
),
|
),
|
||||||
buildWhenOnHover: () => !widget.showActions,
|
|
||||||
builder: (_, onHover) => _buildViewItem(onHover),
|
|
||||||
isSelected: () =>
|
|
||||||
widget.showActions ||
|
|
||||||
getIt<MenuSharedState>().latestOpenView?.id == widget.view.id,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user