From 3fbcd928db7e1baf713e9934fa540ac683d3cb43 Mon Sep 17 00:00:00 2001 From: "Nathan.fooo" <86001920+appflowy@users.noreply.github.com> Date: Sun, 30 Oct 2022 19:31:53 +0800 Subject: [PATCH] fix: padding for edit field (#1400) --- .../select_option_editor.dart | 31 ++++++++++--------- .../widgets/header/field_cell.dart | 1 - .../type_option/select_option_editor.dart | 11 ++++--- .../presentation/widgets/row/row_detail.dart | 11 +++---- .../lib/style_widget/button.dart | 3 +- 5 files changed, 30 insertions(+), 27 deletions(-) diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/select_option_cell/select_option_editor.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/select_option_cell/select_option_editor.dart index 2674892cf8..43030f1b68 100644 --- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/select_option_cell/select_option_editor.dart +++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/select_option_cell/select_option_editor.dart @@ -53,20 +53,23 @@ class _SelectOptionCellEditorState extends State { )..add(const SelectOptionEditorEvent.initial()), child: BlocBuilder( builder: (context, state) { - return CustomScrollView( - shrinkWrap: true, - slivers: [ - SliverToBoxAdapter( - child: _TextField(popoverMutex: popoverMutex), - ), - const SliverToBoxAdapter(child: VSpace(6)), - const SliverToBoxAdapter(child: TypeOptionSeparator()), - const SliverToBoxAdapter(child: VSpace(6)), - const SliverToBoxAdapter(child: _Title()), - SliverToBoxAdapter( - child: _OptionList(popoverMutex: popoverMutex), - ), - ], + return Padding( + padding: const EdgeInsets.all(6.0), + child: CustomScrollView( + shrinkWrap: true, + slivers: [ + SliverToBoxAdapter( + child: _TextField(popoverMutex: popoverMutex), + ), + const SliverToBoxAdapter(child: VSpace(6)), + const SliverToBoxAdapter(child: TypeOptionSeparator()), + const SliverToBoxAdapter(child: VSpace(6)), + const SliverToBoxAdapter(child: _Title()), + SliverToBoxAdapter( + child: _OptionList(popoverMutex: popoverMutex), + ), + ], + ), ); }, ), diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/field_cell.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/field_cell.dart index 0ee7462e22..19f3b3f6f1 100755 --- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/field_cell.dart +++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/field_cell.dart @@ -168,7 +168,6 @@ class FieldCellButton extends StatelessWidget { .replaceAll(Characters(''), Characters('\u{200B}')) .toString(); return FlowyButton( - radius: BorderRadius.zero, hoverColor: theme.shader6, onTap: onTap, leftIcon: svgWidget(field.fieldType.iconName(), color: theme.iconColor), diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option_editor.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option_editor.dart index 808c5397d6..9f259dcdc6 100644 --- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option_editor.dart +++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option_editor.dart @@ -63,10 +63,13 @@ class SelectOptionTypeOptionEditor extends StatelessWidget { return SizedBox( width: 160, - child: CustomScrollView( - slivers: slivers, - controller: ScrollController(), - physics: StyledScrollPhysics(), + child: Padding( + padding: const EdgeInsets.all(6.0), + child: CustomScrollView( + slivers: slivers, + controller: ScrollController(), + physics: StyledScrollPhysics(), + ), ), ); }, diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/row/row_detail.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/row/row_detail.dart index 51a161be57..3a6876076d 100644 --- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/row/row_detail.dart +++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/row/row_detail.dart @@ -59,7 +59,7 @@ class _RowDetailPageState extends State { child: Column( children: [ SizedBox( - height: 40, + height: 30, child: Row( children: const [Spacer(), _CloseButton()], ), @@ -264,15 +264,14 @@ class _RowDetailCellState extends State<_RowDetailCell> { behavior: HitTestBehavior.translucent, onTap: () => cell.beginFocus.notify(), child: AccessoryHover( - contentPadding: - const EdgeInsets.symmetric(horizontal: 10, vertical: 12), + contentPadding: const EdgeInsets.symmetric(horizontal: 3, vertical: 3), child: cell, ), ); return IntrinsicHeight( child: ConstrainedBox( - constraints: const BoxConstraints(minHeight: 40), + constraints: const BoxConstraints(minHeight: 30), child: Row( crossAxisAlignment: CrossAxisAlignment.stretch, mainAxisAlignment: MainAxisAlignment.center, @@ -287,9 +286,7 @@ class _RowDetailCellState extends State<_RowDetailCell> { child: FieldCellButton( maxLines: null, field: widget.cellId.fieldContext.field, - onTap: () { - popover.show(); - }, + onTap: () => popover.show(), ), ), ), diff --git a/frontend/app_flowy/packages/flowy_infra_ui/lib/style_widget/button.dart b/frontend/app_flowy/packages/flowy_infra_ui/lib/style_widget/button.dart index f89551626c..5057f206f9 100644 --- a/frontend/app_flowy/packages/flowy_infra_ui/lib/style_widget/button.dart +++ b/frontend/app_flowy/packages/flowy_infra_ui/lib/style_widget/button.dart @@ -31,7 +31,8 @@ class FlowyButton extends StatelessWidget { @override Widget build(BuildContext context) { - return InkWell( + return GestureDetector( + behavior: HitTestBehavior.opaque, onTap: onTap, child: FlowyHover( style: HoverStyle(