Skip to content

Commit

Permalink
chore: improve popup menu color (#5725)
Browse files Browse the repository at this point in the history
* chore: improve popup menu color

* fix: 100% text wrap into a new line in checklist cell
  • Loading branch information
LucasXu0 authored and suntorytimed committed Jul 12, 2024
1 parent d5b77de commit 79adbd9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:appflowy_editor/appflowy_editor.dart';
import 'package:flowy_infra/theme_extension.dart';
import 'package:flutter/material.dart';
import 'package:percent_indicator/percent_indicator.dart';

import '../../application/cell/bloc/checklist_cell_bloc.dart';

class ChecklistProgressBar extends StatefulWidget {
Expand Down Expand Up @@ -68,7 +68,7 @@ class _ChecklistProgressBarState extends State<ChecklistProgressBar> {
),
),
SizedBox(
width: PlatformExtension.isDesktop ? 36 : 45,
width: 45,
child: Align(
alignment: AlignmentDirectional.centerEnd,
child: Text(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:appflowy/generated/flowy_svgs.g.dart';
import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy/util/theme_extension.dart';
import 'package:appflowy/workspace/application/sidebar/folder/folder_bloc.dart';
import 'package:appflowy/workspace/application/sidebar/space/space_bloc.dart';
import 'package:appflowy/workspace/application/view/view_bloc.dart';
Expand Down Expand Up @@ -268,6 +269,22 @@ enum ConfirmPopupStyle {
cancelAndOk,
}

class ConfirmPopupColor {
static Color titleColor(BuildContext context) {
if (Theme.of(context).isLightMode) {
return const Color(0xFF171717).withOpacity(0.8);
}
return const Color(0xFFffffff).withOpacity(0.8);
}

static Color descriptionColor(BuildContext context) {
if (Theme.of(context).isLightMode) {
return const Color(0xFF171717).withOpacity(0.8);
}
return const Color(0xFFffffff).withOpacity(0.72);
}
}

class ConfirmPopup extends StatefulWidget {
const ConfirmPopup({
super.key,
Expand Down Expand Up @@ -328,6 +345,7 @@ class _ConfirmPopupState extends State<ConfirmPopup> {
widget.title,
fontSize: 14.0,
overflow: TextOverflow.ellipsis,
color: ConfirmPopupColor.titleColor(context),
),
),
const HSpace(6.0),
Expand All @@ -344,7 +362,7 @@ class _ConfirmPopupState extends State<ConfirmPopup> {
return FlowyText.regular(
widget.description,
fontSize: 12.0,
color: Theme.of(context).hintColor,
color: ConfirmPopupColor.descriptionColor(context),
maxLines: 3,
lineHeight: 1.4,
);
Expand Down

0 comments on commit 79adbd9

Please sign in to comment.