Details page header tweaks (#2752)
* Center header, DM edits * chore: dart formatting --------- Co-authored-by: ggurdin <ggurdin@gmail.com> Co-authored-by: ggurdin <46800240+ggurdin@users.noreply.github.com>
This commit is contained in:
parent
a8d6e7fc8f
commit
05532431aa
2 changed files with 22 additions and 9 deletions
|
|
@ -104,6 +104,7 @@ class PangeaChatDetailsView extends StatelessWidget {
|
|||
controller: controller,
|
||||
room: room,
|
||||
),
|
||||
centerTitle: true,
|
||||
backgroundColor: theme.appBarTheme.backgroundColor,
|
||||
),
|
||||
body: MaxWidthBody(
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/src/widgets/visibility.dart' as visible;
|
||||
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import 'package:matrix/matrix.dart';
|
||||
|
||||
import 'package:fluffychat/pages/chat_details/chat_details.dart';
|
||||
|
|
@ -20,9 +21,12 @@ class ClassNameHeader extends StatelessWidget {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return TextButton.icon(
|
||||
onPressed:
|
||||
room.canSendDefaultStates ? controller.setDisplaynameAction : null,
|
||||
onHover: room.canSendDefaultStates ? controller.hoverEditNameIcon : null,
|
||||
onPressed: !room.isDirectChat && room.canSendDefaultStates
|
||||
? controller.setDisplaynameAction
|
||||
: null,
|
||||
onHover: !room.isDirectChat && room.canSendDefaultStates
|
||||
? controller.hoverEditNameIcon
|
||||
: null,
|
||||
style: TextButton.styleFrom(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 25),
|
||||
),
|
||||
|
|
@ -33,12 +37,20 @@ class ClassNameHeader extends StatelessWidget {
|
|||
color: Theme.of(context).colorScheme.onSurface,
|
||||
),
|
||||
),
|
||||
label: room.nameAndRoomTypeIcon(
|
||||
TextStyle(
|
||||
fontSize: 20,
|
||||
color: Theme.of(context).textTheme.bodyLarge!.color,
|
||||
),
|
||||
),
|
||||
label: room.isDirectChat
|
||||
? Text(
|
||||
L10n.of(context).chatDetails,
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
color: Theme.of(context).textTheme.bodyLarge!.color,
|
||||
),
|
||||
)
|
||||
: room.nameAndRoomTypeIcon(
|
||||
TextStyle(
|
||||
fontSize: 20,
|
||||
color: Theme.of(context).textTheme.bodyLarge!.color,
|
||||
),
|
||||
),
|
||||
// icon: Text(
|
||||
// room.getLocalizedDisplayname(
|
||||
// MatrixLocals(L10n.of(context)),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue