fix: fix icon hover color in dark mode (#2356)

* fix: File and Trash icons brightness in dark mode.
Fixes: #2298

* chore: update hover color in file location

* feat: add foregroundColorOnHover in HoverStyle

* feat: add iconColorOnHover in FlowyIconButton

* chore: update trash page UI

---------

Co-authored-by: Akarsh Jain <akarsh.jain.790@gmail.com>
This commit is contained in:
Yijing Huang
2023-04-26 22:27:07 -05:00
committed by GitHub
parent 857cd9ff55
commit 37ba5d8e43
6 changed files with 46 additions and 34 deletions

View File

@ -4,10 +4,14 @@ class TrashSizes {
static double get fileNameWidth => 320 * scale;
static double get lashModifyWidth => 230 * scale;
static double get createTimeWidth => 230 * scale;
static double get padding => 100 * scale;
// padding between createTime and action icon
static double get padding => 40 * scale;
static double get actionIconWidth => 40 * scale;
static double get totalWidth =>
TrashSizes.fileNameWidth +
TrashSizes.lashModifyWidth +
TrashSizes.createTimeWidth +
TrashSizes.padding;
TrashSizes.padding +
// restore and delete icon
2 * TrashSizes.actionIconWidth;
}

View File

@ -1,7 +1,5 @@
import 'package:flowy_infra/image.dart';
import 'package:flowy_infra_ui/style_widget/icon_button.dart';
import 'package:flowy_infra_ui/style_widget/text.dart';
import 'package:flowy_infra_ui/widget/spacing.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/trash.pb.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
@ -38,23 +36,19 @@ class TrashCell extends StatelessWidget {
),
const Spacer(),
FlowyIconButton(
width: 26,
iconColorOnHover: Theme.of(context).colorScheme.onSurface,
width: TrashSizes.actionIconWidth,
onPressed: onRestore,
iconPadding: const EdgeInsets.all(5),
icon: svgWidget(
"editor/restore",
color: Theme.of(context).iconTheme.color,
),
icon: const FlowySvg(name: 'editor/restore'),
),
const HSpace(20),
FlowyIconButton(
width: 26,
iconColorOnHover: Theme.of(context).colorScheme.onSurface,
width: TrashSizes.actionIconWidth,
onPressed: onDelete,
iconPadding: const EdgeInsets.all(5),
icon: svgWidget(
"editor/delete",
color: Theme.of(context).iconTheme.color,
),
icon: const FlowySvg(name: 'editor/delete'),
),
],
);

View File

@ -96,10 +96,7 @@ class _TrashPageState extends State<TrashPage> {
IntrinsicWidth(
child: FlowyButton(
text: FlowyText.medium(LocaleKeys.trash_restoreAll.tr()),
leftIcon: svgWidget(
'editor/restore',
color: Theme.of(context).iconTheme.color,
),
leftIcon: const FlowySvg(name: 'editor/restore'),
onTap: () => context.read<TrashBloc>().add(
const TrashEvent.restoreAll(),
),
@ -109,10 +106,7 @@ class _TrashPageState extends State<TrashPage> {
IntrinsicWidth(
child: FlowyButton(
text: FlowyText.medium(LocaleKeys.trash_deleteAll.tr()),
leftIcon: svgWidget(
'editor/delete',
color: Theme.of(context).iconTheme.color,
),
leftIcon: const FlowySvg(name: 'editor/delete'),
onTap: () =>
context.read<TrashBloc>().add(const TrashEvent.deleteAll()),
),