fix: Popup menu without elevation
This commit is contained in:
parent
9aa9426d86
commit
92fa413156
10 changed files with 80 additions and 30 deletions
|
|
@ -10,6 +10,7 @@ import 'package:fluffychat/config/app_config.dart';
|
|||
import 'package:fluffychat/utils/platform_infos.dart';
|
||||
import 'package:fluffychat/widgets/avatar.dart';
|
||||
import 'package:fluffychat/widgets/matrix.dart';
|
||||
import '../../widgets/m2_popup_menu_button.dart';
|
||||
import 'chat.dart';
|
||||
import 'input_bar.dart';
|
||||
|
||||
|
|
@ -89,7 +90,7 @@ class ChatInputRow extends StatelessWidget {
|
|||
alignment: Alignment.center,
|
||||
clipBehavior: Clip.hardEdge,
|
||||
decoration: const BoxDecoration(),
|
||||
child: PopupMenuButton<String>(
|
||||
child: M2PopupMenuButton<String>(
|
||||
icon: const Icon(Icons.add_outlined),
|
||||
onSelected: controller.onAddPopupMenuButtonSelected,
|
||||
itemBuilder: (BuildContext context) =>
|
||||
|
|
@ -295,7 +296,7 @@ class _ChatAccountPicker extends StatelessWidget {
|
|||
padding: const EdgeInsets.all(8.0),
|
||||
child: FutureBuilder<Profile>(
|
||||
future: controller.sendingClient!.fetchOwnProfile(),
|
||||
builder: (context, snapshot) => PopupMenuButton<String>(
|
||||
builder: (context, snapshot) => M2PopupMenuButton<String>(
|
||||
onSelected: _popupMenuButtonSelected,
|
||||
itemBuilder: (BuildContext context) => clients
|
||||
.map((client) => PopupMenuItem<String>(
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ import 'package:fluffychat/widgets/connection_status_header.dart';
|
|||
import 'package:fluffychat/widgets/matrix.dart';
|
||||
import 'package:fluffychat/widgets/unread_badge_back_button.dart';
|
||||
import '../../utils/stream_extension.dart';
|
||||
import '../../widgets/m2_popup_menu_button.dart';
|
||||
import 'chat_emoji_picker.dart';
|
||||
import 'chat_input_row.dart';
|
||||
|
||||
|
|
@ -65,7 +66,7 @@ class ChatView extends StatelessWidget {
|
|||
tooltip: L10n.of(context)!.pinMessage,
|
||||
),
|
||||
if (controller.selectedEvents.length == 1)
|
||||
PopupMenuButton<_EventContextAction>(
|
||||
M2PopupMenuButton<_EventContextAction>(
|
||||
onSelected: (action) {
|
||||
switch (action) {
|
||||
case _EventContextAction.info:
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import 'package:fluffychat/widgets/content_banner.dart';
|
|||
import 'package:fluffychat/widgets/layouts/max_width_body.dart';
|
||||
import 'package:fluffychat/widgets/matrix.dart';
|
||||
import '../../utils/url_launcher.dart';
|
||||
import '../../widgets/m2_popup_menu_button.dart';
|
||||
|
||||
class ChatDetailsView extends StatelessWidget {
|
||||
final ChatDetailsController controller;
|
||||
|
|
@ -197,7 +198,7 @@ class ChatDetailsView extends StatelessWidget {
|
|||
Text(L10n.of(context)!.setCustomEmotes),
|
||||
onTap: controller.goToEmoteSettings,
|
||||
),
|
||||
PopupMenuButton(
|
||||
M2PopupMenuButton(
|
||||
onSelected: controller.setJoinRulesAction,
|
||||
itemBuilder: (BuildContext context) =>
|
||||
<PopupMenuEntry<JoinRules>>[
|
||||
|
|
@ -231,7 +232,7 @@ class ChatDetailsView extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
),
|
||||
PopupMenuButton(
|
||||
M2PopupMenuButton(
|
||||
onSelected:
|
||||
controller.setHistoryVisibilityAction,
|
||||
itemBuilder: (BuildContext context) =>
|
||||
|
|
@ -284,7 +285,7 @@ class ChatDetailsView extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
if (room.joinRules == JoinRules.public)
|
||||
PopupMenuButton(
|
||||
M2PopupMenuButton(
|
||||
onSelected: controller.setGuestAccessAction,
|
||||
itemBuilder: (BuildContext context) =>
|
||||
<PopupMenuEntry<GuestAccess>>[
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import 'package:fluffychat/widgets/avatar.dart';
|
|||
import 'package:fluffychat/widgets/layouts/max_width_body.dart';
|
||||
import 'package:fluffychat/widgets/matrix.dart';
|
||||
import '../../utils/matrix_sdk_extensions.dart/device_extension.dart';
|
||||
import '../../widgets/m2_popup_menu_button.dart';
|
||||
|
||||
class ChatEncryptionSettingsView extends StatelessWidget {
|
||||
final ChatEncryptionSettingsController controller;
|
||||
|
|
@ -73,7 +74,7 @@ class ChatEncryptionSettingsView extends StatelessWidget {
|
|||
deviceKeys[i].userId !=
|
||||
deviceKeys[i - 1].userId) ...{
|
||||
const Divider(height: 1, thickness: 1),
|
||||
PopupMenuButton(
|
||||
M2PopupMenuButton(
|
||||
onSelected: (dynamic action) => controller
|
||||
.onSelected(context, action, deviceKeys[i]),
|
||||
itemBuilder: (c) {
|
||||
|
|
@ -115,7 +116,7 @@ class ChatEncryptionSettingsView extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
},
|
||||
PopupMenuButton(
|
||||
M2PopupMenuButton(
|
||||
onSelected: (dynamic action) => controller
|
||||
.onSelected(context, action, deviceKeys[i]),
|
||||
itemBuilder: (c) {
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import 'package:vrouter/vrouter.dart';
|
|||
import 'package:fluffychat/widgets/avatar.dart';
|
||||
import 'package:fluffychat/widgets/matrix.dart';
|
||||
import '../../utils/fluffy_share.dart';
|
||||
import '../../widgets/m2_popup_menu_button.dart';
|
||||
import 'chat_list.dart';
|
||||
|
||||
class ClientChooserButton extends StatelessWidget {
|
||||
|
|
@ -191,24 +192,18 @@ class ClientChooserButton extends StatelessWidget {
|
|||
onKeysPressed: () => _previousAccount(matrix, context),
|
||||
child: Container(),
|
||||
),
|
||||
Theme(
|
||||
data: Theme.of(context),
|
||||
child: PopupMenuButton<Object>(
|
||||
shape: Border.all(
|
||||
color: Theme.of(context).dividerColor,
|
||||
),
|
||||
onSelected: (o) => _clientSelected(o, context),
|
||||
itemBuilder: _bundleMenuItems,
|
||||
child: Material(
|
||||
color: Colors.transparent,
|
||||
borderRadius: BorderRadius.circular(99),
|
||||
child: Avatar(
|
||||
mxContent: snapshot.data?.avatarUrl,
|
||||
name: snapshot.data?.displayName ??
|
||||
matrix.client.userID!.localpart,
|
||||
size: 28,
|
||||
fontSize: 12,
|
||||
),
|
||||
M2PopupMenuButton<Object>(
|
||||
onSelected: (o) => _clientSelected(o, context),
|
||||
itemBuilder: _bundleMenuItems,
|
||||
child: Material(
|
||||
color: Colors.transparent,
|
||||
borderRadius: BorderRadius.circular(99),
|
||||
child: Avatar(
|
||||
mxContent: snapshot.data?.avatarUrl,
|
||||
name: snapshot.data?.displayName ??
|
||||
matrix.client.userID!.localpart,
|
||||
size: 28,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import 'package:fluffychat/utils/platform_infos.dart';
|
|||
import 'package:fluffychat/utils/string_color.dart';
|
||||
import 'package:fluffychat/utils/url_launcher.dart';
|
||||
import 'package:fluffychat/widgets/avatar.dart';
|
||||
import '../../widgets/m2_popup_menu_button.dart';
|
||||
|
||||
class StoryView extends StatelessWidget {
|
||||
final StoryPageController controller;
|
||||
|
|
@ -101,7 +102,7 @@ class StoryView extends StatelessWidget {
|
|||
icon: Icon(Icons.adaptive.share_outlined),
|
||||
onPressed: controller.share,
|
||||
),
|
||||
PopupMenuButton<PopupStoryAction>(
|
||||
M2PopupMenuButton<PopupStoryAction>(
|
||||
color: Colors.white,
|
||||
onSelected: controller.onPopupStoryAction,
|
||||
itemBuilder: (context) => [
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import 'package:fluffychat/config/themes.dart';
|
|||
import 'package:fluffychat/utils/fluffy_share.dart';
|
||||
import '../../utils/matrix_sdk_extensions.dart/presence_extension.dart';
|
||||
import '../../widgets/content_banner.dart';
|
||||
import '../../widgets/m2_popup_menu_button.dart';
|
||||
import '../../widgets/matrix.dart';
|
||||
import 'user_bottom_sheet.dart';
|
||||
|
||||
|
|
@ -43,7 +44,7 @@ class UserBottomSheetView extends StatelessWidget {
|
|||
title: Text(user.calcDisplayname()),
|
||||
actions: [
|
||||
if (user.id != client.userID)
|
||||
PopupMenuButton(
|
||||
M2PopupMenuButton(
|
||||
itemBuilder: (_) => [
|
||||
if (controller.widget.onMention != null)
|
||||
PopupMenuItem(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue