Skip to content

Commit

Permalink
feat: extend the expand icon hit test area
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasXu0 committed May 30, 2024
1 parent c550054 commit 55244ab
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ class _SingleMobileInnerViewItemState extends State<SingleMobileInnerViewItem> {
final children = [
// expand icon
_buildLeftIcon(),
const HSpace(6),
// icon
_buildViewIcon(),
const HSpace(8),
Expand Down Expand Up @@ -326,22 +325,23 @@ class _SingleMobileInnerViewItemState extends State<SingleMobileInnerViewItem> {
// show > if the view is expandable.
// show · if the view can't contain child views.
Widget _buildLeftIcon() {
if (isReferencedDatabaseView(widget.view, widget.parentView)) {
return const _DotIconWidget();
}

if (context.read<ViewBloc>().state.view.childViews.isEmpty) {
return HSpace(widget.leftPadding);
}

return GestureDetector(
child: AnimatedRotation(
duration: const Duration(milliseconds: 250),
turns: widget.isExpanded ? 0 : -0.25,
child: const FlowySvg(
FlowySvgs.m_expand_s,
blendMode: null,
),
behavior: HitTestBehavior.opaque,
child: Padding(
padding: const EdgeInsets.only(right: 6.0, top: 6.0, bottom: 6.0),
child: widget.isExpanded
? const FlowySvg(
FlowySvgs.m_expand_s,
blendMode: null,
)
: const FlowySvg(
FlowySvgs.m_collapse_s,
blendMode: null,
),
),
onTap: () {
context
Expand Down
4 changes: 2 additions & 2 deletions frontend/resources/flowy_icons/16x/m_collapse.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 55244ab

Please sign in to comment.