Browse Source

fix: several grid ui improvements (#1347)

Richard Shiue 2 years ago
parent
commit
58ad9a260c

+ 1 - 1
frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/date_cell/date_cell.dart

@@ -68,7 +68,7 @@ class _DateCellState extends GridCellState<GridDateCell> {
             controller: _popover,
             triggerActions: PopoverTriggerFlags.none,
             direction: PopoverDirection.bottomWithLeftAligned,
-            constraints: BoxConstraints.loose(const Size(320, 500)),
+            constraints: BoxConstraints.loose(const Size(320, 520)),
             margin: EdgeInsets.zero,
             child: SizedBox.expand(
               child: GestureDetector(

+ 9 - 5
frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/date.dart

@@ -15,6 +15,7 @@ import 'package:flutter/material.dart';
 import 'package:flutter_bloc/flutter_bloc.dart';
 import 'package:appflowy_popover/appflowy_popover.dart';
 import '../../../layout/sizes.dart';
+import '../../common/text_field.dart';
 import '../field_type_option_editor.dart';
 import 'builder.dart';
 
@@ -53,11 +54,14 @@ class DateTypeOptionWidget extends TypeOptionWidget {
         listener: (context, state) =>
             typeOptionContext.typeOption = state.typeOption,
         builder: (context, state) {
-          return Column(children: [
-            _renderDateFormatButton(context, state.typeOption.dateFormat),
-            _renderTimeFormatButton(context, state.typeOption.timeFormat),
-            const _IncludeTimeButton(),
-          ]);
+          return Column(
+            children: [
+              const TypeOptionSeparator(),
+              _renderDateFormatButton(context, state.typeOption.dateFormat),
+              _renderTimeFormatButton(context, state.typeOption.timeFormat),
+              const _IncludeTimeButton(),
+            ],
+          );
         },
       ),
     );

+ 6 - 1
frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/number.dart

@@ -31,7 +31,12 @@ class NumberTypeOptionWidgetBuilder extends TypeOptionWidgetBuilder {
         );
 
   @override
-  Widget? build(BuildContext context) => _widget;
+  Widget? build(BuildContext context) {
+    return Column(children: [
+      const TypeOptionSeparator(),
+      _widget,
+    ]);
+  }
 }
 
 class NumberTypeOptionWidget extends TypeOptionWidget {

+ 7 - 2
frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart

@@ -66,12 +66,17 @@ class OptionTitle extends StatelessWidget {
 
   @override
   Widget build(BuildContext context) {
+    final theme = context.read<AppTheme>();
     return BlocBuilder<SelectOptionTypeOptionBloc, SelectOptionTypeOptionState>(
       builder: (context, state) {
         List<Widget> children = [
-          FlowyText.medium(LocaleKeys.grid_field_optionTitle.tr(), fontSize: 12)
+          FlowyText.medium(
+            LocaleKeys.grid_field_optionTitle.tr(),
+            fontSize: 12,
+            color: theme.shader3,
+          )
         ];
-        if (state.options.isNotEmpty) {
+        if (state.options.isNotEmpty && !state.isEditingOption) {
           children.add(const Spacer());
           children.add(const _OptionTitleButton());
         }