Browse Source

fix: padding for edit field (#1400)

Nathan.fooo 2 năm trước cách đây
mục cha
commit
3fbcd928db

+ 17 - 14
frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/select_option_cell/select_option_editor.dart

@@ -53,20 +53,23 @@ class _SelectOptionCellEditorState extends State<SelectOptionCellEditor> {
       )..add(const SelectOptionEditorEvent.initial()),
       )..add(const SelectOptionEditorEvent.initial()),
       child: BlocBuilder<SelectOptionCellEditorBloc, SelectOptionEditorState>(
       child: BlocBuilder<SelectOptionCellEditorBloc, SelectOptionEditorState>(
         builder: (context, state) {
         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),
+                ),
+              ],
+            ),
           );
           );
         },
         },
       ),
       ),

+ 0 - 1
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}'))
         .replaceAll(Characters(''), Characters('\u{200B}'))
         .toString();
         .toString();
     return FlowyButton(
     return FlowyButton(
-      radius: BorderRadius.zero,
       hoverColor: theme.shader6,
       hoverColor: theme.shader6,
       onTap: onTap,
       onTap: onTap,
       leftIcon: svgWidget(field.fieldType.iconName(), color: theme.iconColor),
       leftIcon: svgWidget(field.fieldType.iconName(), color: theme.iconColor),

+ 7 - 4
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(
             return SizedBox(
               width: 160,
               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(),
+                ),
               ),
               ),
             );
             );
           },
           },

+ 4 - 7
frontend/app_flowy/lib/plugins/grid/presentation/widgets/row/row_detail.dart

@@ -59,7 +59,7 @@ class _RowDetailPageState extends State<RowDetailPage> {
           child: Column(
           child: Column(
             children: [
             children: [
               SizedBox(
               SizedBox(
-                height: 40,
+                height: 30,
                 child: Row(
                 child: Row(
                   children: const [Spacer(), _CloseButton()],
                   children: const [Spacer(), _CloseButton()],
                 ),
                 ),
@@ -264,15 +264,14 @@ class _RowDetailCellState extends State<_RowDetailCell> {
       behavior: HitTestBehavior.translucent,
       behavior: HitTestBehavior.translucent,
       onTap: () => cell.beginFocus.notify(),
       onTap: () => cell.beginFocus.notify(),
       child: AccessoryHover(
       child: AccessoryHover(
-        contentPadding:
-            const EdgeInsets.symmetric(horizontal: 10, vertical: 12),
+        contentPadding: const EdgeInsets.symmetric(horizontal: 3, vertical: 3),
         child: cell,
         child: cell,
       ),
       ),
     );
     );
 
 
     return IntrinsicHeight(
     return IntrinsicHeight(
       child: ConstrainedBox(
       child: ConstrainedBox(
-        constraints: const BoxConstraints(minHeight: 40),
+        constraints: const BoxConstraints(minHeight: 30),
         child: Row(
         child: Row(
           crossAxisAlignment: CrossAxisAlignment.stretch,
           crossAxisAlignment: CrossAxisAlignment.stretch,
           mainAxisAlignment: MainAxisAlignment.center,
           mainAxisAlignment: MainAxisAlignment.center,
@@ -287,9 +286,7 @@ class _RowDetailCellState extends State<_RowDetailCell> {
                 child: FieldCellButton(
                 child: FieldCellButton(
                   maxLines: null,
                   maxLines: null,
                   field: widget.cellId.fieldContext.field,
                   field: widget.cellId.fieldContext.field,
-                  onTap: () {
-                    popover.show();
-                  },
+                  onTap: () => popover.show(),
                 ),
                 ),
               ),
               ),
             ),
             ),

+ 2 - 1
frontend/app_flowy/packages/flowy_infra_ui/lib/style_widget/button.dart

@@ -31,7 +31,8 @@ class FlowyButton extends StatelessWidget {
 
 
   @override
   @override
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
-    return InkWell(
+    return GestureDetector(
+      behavior: HitTestBehavior.opaque,
       onTap: onTap,
       onTap: onTap,
       child: FlowyHover(
       child: FlowyHover(
         style: HoverStyle(
         style: HoverStyle(