Skip to content

Commit

Permalink
TW-2099: Fix menu background color
Browse files Browse the repository at this point in the history
  • Loading branch information
nqhhdev committed Oct 22, 2024
1 parent e77c0fd commit a5a7853
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 16 deletions.
16 changes: 13 additions & 3 deletions lib/pages/chat_blank/chat_blank.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:fluffychat/resource/image_paths.dart';
import 'package:fluffychat/utils/extension/build_context_extension.dart';
import 'package:fluffychat/utils/string_extension.dart';
import 'package:fluffychat/widgets/matrix.dart';
import 'package:fluffychat/widgets/mixins/popup_menu_widget_style.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
Expand Down Expand Up @@ -114,18 +115,27 @@ class _ChatBlankRichText extends StatelessWidget with GoToGroupChatMixin {
MenuItemButton(
leadingIcon: const Icon(Icons.chat),
onPressed: goToNewPrivateChat,
child: Text(L10n.of(context)!.newDirectMessage),
child: Text(
L10n.of(context)!.newDirectMessage,
style: PopupMenuWidgetStyle.defaultItemTextStyle(context),
),
),
MenuItemButton(
leadingIcon: const Icon(Icons.group),
onPressed: () => goToNewGroupChat(
innerNavigatorContext(),
),
child: Text(L10n.of(context)!.newChat),
child: Text(
L10n.of(context)!.newChat,
style: PopupMenuWidgetStyle.defaultItemTextStyle(context),
),
),
],
style: const MenuStyle(
style: MenuStyle(
alignment: Alignment.topLeft,
backgroundColor: WidgetStatePropertyAll(
PopupMenuWidgetStyle.defaultMenuColor(context),
),
),
builder: (context, menuController, _) {
return InkWell(
Expand Down
6 changes: 6 additions & 0 deletions lib/pages/chat_details/chat_details_edit_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import 'package:fluffychat/utils/matrix_sdk_extensions/matrix_locals.dart';
import 'package:fluffychat/utils/platform_infos.dart';
import 'package:fluffychat/widgets/avatar/avatar.dart';
import 'package:fluffychat/widgets/context_menu_builder_ios_paste_without_permission.dart';
import 'package:fluffychat/widgets/mixins/popup_menu_widget_style.dart';
import 'package:fluffychat/widgets/stream_image_view.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
Expand Down Expand Up @@ -119,6 +120,11 @@ class ChatDetailsEditView extends StatelessWidget {
builder: (context, _, __) {
return MenuAnchor(
controller: controller.menuController,
style: MenuStyle(
backgroundColor: WidgetStatePropertyAll(
PopupMenuWidgetStyle.defaultMenuColor(context),
),
),
alignmentOffset: ChatDetailEditViewStyle
.contextMenuAlignmentOffset(context),
builder: (
Expand Down
20 changes: 17 additions & 3 deletions lib/pages/chat_list/chat_list_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'package:fluffychat/pages/chat_list/chat_list_bottom_navigator_style.dart
import 'package:fluffychat/pages/chat_list/chat_list_header.dart';
import 'package:fluffychat/pages/chat_list/chat_list_view_style.dart';
import 'package:fluffychat/utils/responsive/responsive_utils.dart';
import 'package:fluffychat/widgets/mixins/popup_menu_widget_style.dart';
import 'package:fluffychat/widgets/twake_components/twake_fab.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
Expand Down Expand Up @@ -88,17 +89,30 @@ class ChatListView extends StatelessWidget {
menuChildren: [
MenuItemButton(
leadingIcon: const Icon(Icons.chat),
child: Text(L10n.of(context)!.newDirectMessage),
child: Text(
L10n.of(context)!.newDirectMessage,
style: PopupMenuWidgetStyle.defaultItemTextStyle(
context,
),
),
onPressed: () => controller.goToNewPrivateChat(),
),
MenuItemButton(
leadingIcon: const Icon(Icons.group),
onPressed: () => controller.goToNewGroupChat(context),
child: Text(L10n.of(context)!.newGroupChat),
child: Text(
L10n.of(context)!.newGroupChat,
style: PopupMenuWidgetStyle.defaultItemTextStyle(
context,
),
),
),
],
style: const MenuStyle(
style: MenuStyle(
alignment: Alignment.topLeft,
backgroundColor: WidgetStatePropertyAll(
PopupMenuWidgetStyle.defaultMenuColor(context),
),
),
builder: (context, menuController, child) {
return TwakeFloatingActionButton(
Expand Down
13 changes: 4 additions & 9 deletions lib/pages/image_viewer/context_menu_item_image_viewer.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:fluffychat/pages/image_viewer/context_menu_item_image_viewer_style.dart';
import 'package:fluffychat/widgets/mixins/popup_menu_widget_style.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';

Expand All @@ -9,8 +10,6 @@ class ContextMenuItemImageViewer extends StatelessWidget {

final String? imagePath;

final Color? color;

final bool haveDivider;

final VoidCallback? onTap;
Expand All @@ -19,7 +18,6 @@ class ContextMenuItemImageViewer extends StatelessWidget {
super.key,
this.icon,
this.imagePath,
this.color,
this.haveDivider = true,
this.onTap,
required this.title,
Expand All @@ -43,23 +41,20 @@ class ContextMenuItemImageViewer extends StatelessWidget {
if (icon != null)
Icon(
icon,
color: color ?? Theme.of(context).colorScheme.onSurface,
color: Theme.of(context).colorScheme.onSurface,
),
if (imagePath != null)
SvgPicture.asset(
imagePath!,
colorFilter: ColorFilter.mode(
color ?? Theme.of(context).colorScheme.onSurface,
Theme.of(context).colorScheme.onSurface,
BlendMode.srcIn,
),
),
ContextMenuItemImageViewerStyle.paddingBetweenItems,
Text(
title,
style: Theme.of(context).textTheme.bodyLarge?.copyWith(
color: color ??
Theme.of(context).colorScheme.onSurface,
),
style: PopupMenuWidgetStyle.defaultItemTextStyle(context),
overflow: TextOverflow.ellipsis,
),
],
Expand Down
8 changes: 7 additions & 1 deletion lib/pages/image_viewer/media_viewer_app_bar_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:fluffychat/pages/image_viewer/image_viewer_style.dart';
import 'package:fluffychat/pages/image_viewer/media_viewer_app_bar.dart';
import 'package:fluffychat/pages/image_viewer/media_viewer_app_bar_style.dart';
import 'package:fluffychat/utils/platform_infos.dart';
import 'package:fluffychat/widgets/mixins/popup_menu_widget_style.dart';
import 'package:flutter/material.dart';
import 'package:linagora_design_flutter/colors/linagora_sys_colors.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
Expand Down Expand Up @@ -85,8 +86,13 @@ class MediaViewerAppbarView extends StatelessWidget {
child: Directionality(
textDirection: TextDirection.rtl,
child: MenuAnchor(
style: const MenuStyle(
style: MenuStyle(
alignment: Alignment.bottomRight,
backgroundColor: WidgetStatePropertyAll(
PopupMenuWidgetStyle.defaultMenuColor(
context,
),
),
),
controller: controller.menuController,
menuChildren: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import 'package:fluffychat/presentation/multiple_account/twake_chat_presentation
import 'package:fluffychat/utils/platform_infos.dart';
import 'package:fluffychat/widgets/avatar/avatar.dart';
import 'package:fluffychat/widgets/avatar/avatar_style.dart';
import 'package:fluffychat/widgets/mixins/popup_menu_widget_style.dart';
import 'package:fluffychat/widgets/stream_image_view.dart';
import 'package:flutter/material.dart';
import 'package:linagora_design_flutter/linagora_design_flutter.dart';
Expand Down Expand Up @@ -168,6 +169,11 @@ class SettingsProfileViewMobile extends StatelessWidget {
right: SettingsProfileViewMobileStyle.positionedRightSize,
child: MenuAnchor(
controller: menuController,
style: MenuStyle(
backgroundColor: WidgetStatePropertyAll(
PopupMenuWidgetStyle.defaultMenuColor(context),
),
),
builder: (
BuildContext context,
MenuController menuController,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'package:fluffychat/presentation/extensions/client_extension.dart';
import 'package:fluffychat/presentation/model/pick_avatar_state.dart';
import 'package:fluffychat/widgets/avatar/avatar.dart';
import 'package:fluffychat/widgets/avatar/avatar_style.dart';
import 'package:fluffychat/widgets/mixins/popup_menu_widget_style.dart';
import 'package:fluffychat/widgets/stream_image_view.dart';
import 'package:flutter/material.dart';
import 'package:linagora_design_flutter/linagora_design_flutter.dart';
Expand Down Expand Up @@ -153,6 +154,13 @@ class SettingsProfileViewWeb extends StatelessWidget {
.positionedRightSize,
child: MenuAnchor(
controller: menuController,
style: MenuStyle(
backgroundColor: WidgetStatePropertyAll(
PopupMenuWidgetStyle.defaultMenuColor(
context,
),
),
),
builder: (
BuildContext context,
MenuController menuController,
Expand Down

0 comments on commit a5a7853

Please sign in to comment.