feat: Improve dark mode in document page (#2254)

* chore: update page icon hover color

* chore: update remove icon hover color

* chore: update emoji picker style

* chore: update ai writer dialog button style

* chore: update Dropdown menu item style in code block

* chore: update callout tint color name

* chore: add null assertion in emoji popover
This commit is contained in:
Yijing Huang
2023-04-18 02:42:12 -04:00
committed by GitHub
parent 45d3a74103
commit 782d01274d
10 changed files with 63 additions and 102 deletions

View File

@ -23,10 +23,9 @@ EditorStyle customEditorTheme(BuildContext context) {
fontFamily: 'poppins-Bold',
),
backgroundColor: Theme.of(context).colorScheme.surface,
selectionMenuItemSelectedIconColor:
Theme.of(context).textTheme.bodyMedium?.color,
selectionMenuItemSelectedTextColor:
Theme.of(context).textTheme.bodyMedium?.color,
selectionMenuBackgroundColor: Theme.of(context).cardColor,
selectionMenuItemSelectedIconColor: Theme.of(context).colorScheme.onSurface,
selectionMenuItemSelectedTextColor: Theme.of(context).colorScheme.onSurface,
);
return editorStyle;
}

View File

@ -169,9 +169,8 @@ class _AddCoverButtonState extends State<_AddCoverButton> {
_removeIcon();
},
useIntrinsicWidth: true,
leftIcon: Icon(
leftIcon: const Icon(
Icons.emoji_emotions_outlined,
color: Theme.of(context).iconTheme.color,
size: 18,
),
text: FlowyText.regular(

View File

@ -50,14 +50,14 @@ class _EmojiPopoverState extends State<EmojiPopover> {
],
);
},
config: const Config(
config: Config(
columns: 8,
emojiSizeMax: 28,
bgColor: Colors.transparent,
iconColor: Colors.grey,
iconColorSelected: Color(0xff333333),
indicatorColor: Color(0xff333333),
progressIndicatorColor: Color(0xff333333),
iconColor: Theme.of(context).iconTheme.color!,
iconColorSelected: Theme.of(context).colorScheme.onSurface,
selectedHoverColor: Theme.of(context).colorScheme.secondary,
progressIndicatorColor: Theme.of(context).iconTheme.color!,
buttonMode: ButtonMode.CUPERTINO,
initCategory: Category.RECENT,
),
@ -72,18 +72,16 @@ class _EmojiPopoverState extends State<EmojiPopover> {
return FlowyButton(
onTap: () => widget.removeIcon(),
useIntrinsicWidth: true,
hoverColor: Theme.of(context).colorScheme.onPrimary,
text: Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.end,
children: [
svgWidget("editor/delete"),
const FlowySvg(name: 'editor/delete'),
const SizedBox(
width: 5,
),
FlowyText(
LocaleKeys.document_plugins_cover_removeIcon.tr(),
color: Colors.grey,
),
],
),

View File

@ -34,7 +34,7 @@ class _EmojiIconWidgetState extends State<EmojiIconWidget> {
margin: const EdgeInsets.only(top: 18),
decoration: BoxDecoration(
color: !hover
? Theme.of(context).colorScheme.secondary
? Theme.of(context).colorScheme.inverseSurface
: Colors.transparent,
borderRadius: Corners.s8Border,
),

View File

@ -9,6 +9,8 @@ import 'package:appflowy_editor/appflowy_editor.dart';
import 'package:flowy_infra_ui/style_widget/button.dart';
import 'package:flowy_infra_ui/style_widget/text.dart';
import 'package:flowy_infra_ui/style_widget/text_field.dart';
import 'package:flowy_infra_ui/widget/buttons/primary_button.dart';
import 'package:flowy_infra_ui/widget/buttons/secondary_button.dart';
import 'package:flowy_infra_ui/widget/spacing.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
@ -179,27 +181,13 @@ class _AutoCompletionInputState extends State<_AutoCompletionInput> {
Widget _buildInputFooterWidget(BuildContext context) {
return Row(
children: [
FlowyRichTextButton(
TextSpan(
children: [
TextSpan(
text: LocaleKeys.button_generate.tr(),
style: Theme.of(context).textTheme.bodyMedium,
),
],
),
PrimaryTextButton(
LocaleKeys.button_generate.tr(),
onPressed: () async => await _onGenerate(),
),
const Space(10, 0),
FlowyRichTextButton(
TextSpan(
children: [
TextSpan(
text: LocaleKeys.button_Cancel.tr(),
style: Theme.of(context).textTheme.bodyMedium,
),
],
),
SecondaryTextButton(
LocaleKeys.button_Cancel.tr(),
onPressed: () async => await _onExit(),
),
Expanded(
@ -219,27 +207,13 @@ class _AutoCompletionInputState extends State<_AutoCompletionInput> {
Widget _buildFooterWidget(BuildContext context) {
return Row(
children: [
FlowyRichTextButton(
TextSpan(
children: [
TextSpan(
text: '${LocaleKeys.button_keep.tr()} ',
style: Theme.of(context).textTheme.bodyMedium,
),
],
),
PrimaryTextButton(
LocaleKeys.button_keep.tr(),
onPressed: () => _onExit(),
),
const Space(10, 0),
FlowyRichTextButton(
TextSpan(
children: [
TextSpan(
text: '${LocaleKeys.button_discard.tr()} ',
style: Theme.of(context).textTheme.bodyMedium,
),
],
),
SecondaryTextButton(
LocaleKeys.button_discard.tr(),
onPressed: () => _onDiscard(),
),
],