fix link button color on dark mode

This commit is contained in:
appflowy 2022-01-28 22:48:15 +08:00
parent beb844da17
commit 1c6b78e7d4
3 changed files with 16 additions and 7 deletions

View File

@ -53,7 +53,15 @@ class _FlowyLinkStyleButtonState extends State<FlowyLinkStyleButton> {
final theme = context.watch<AppTheme>();
final isEnabled = !widget.controller.selection.isCollapsed;
final pressedHandler = isEnabled ? () => _openLinkDialog(context) : null;
final icon = isEnabled ? svg('editor/share') : svg('editor/share', color: theme.shader4);
final icon = isEnabled
? svg(
'editor/share',
color: theme.iconColor,
)
: svg(
'editor/share',
color: theme.disableIconColor,
);
return FlowyIconButton(
onPressed: pressedHandler,

View File

@ -1,7 +1,7 @@
import 'package:flowy_infra/image.dart';
import 'package:flowy_infra/theme.dart';
import 'package:flowy_infra_ui/style_widget/icon_button.dart';
import 'package:flutter/material.dart';
import 'package:flowy_infra/theme.dart';
import 'package:provider/provider.dart';
const double defaultIconSize = 18;
@ -29,9 +29,7 @@ class ToolbarIconButton extends StatelessWidget {
iconPadding: const EdgeInsets.symmetric(horizontal: 4, vertical: 4),
onPressed: onPressed,
width: width,
icon: isToggled == true
? svg(iconName, color: Colors.white)
: svg(iconName),
icon: isToggled == true ? svg(iconName, color: Colors.white) : svg(iconName),
fillColor: isToggled == true ? theme.main1 : theme.shader6,
hoverColor: isToggled == true ? theme.main1 : theme.shader5,
tooltipText: tooltipText,

View File

@ -62,6 +62,7 @@ class AppTheme {
late Color tint9;
late Color textColor;
late Color iconColor;
late Color disableIconColor;
late Color main1;
late Color main2;
@ -110,7 +111,8 @@ class AppTheme {
..main2 = const Color(0xff00b7ea)
..textColor = _black
..iconColor = _black
..shadowColor = _black;
..shadowColor = _black
..disableIconColor = const Color(0xffbdbdbd);
case ThemeType.dark:
return AppTheme(ty: themeType, isDark: true)
@ -144,7 +146,8 @@ class AppTheme {
..main2 = const Color(0xff009cc7)
..textColor = _white
..iconColor = _white
..shadowColor = _white;
..shadowColor = _white
..disableIconColor = const Color(0xff333333);
}
}