more text selection and menu bg settings on other message bubbles
continuous-integration/drone/push Build was killed Details

This commit is contained in:
Dan Ballard 2024-02-07 11:42:49 -08:00 committed by Gitea
parent 8d1d9ded5e
commit 48dda98f25
3 changed files with 87 additions and 49 deletions

View File

@ -238,6 +238,18 @@ class FileBubbleState extends State<FileBubble> {
bottomRight: fromMe ? Radius.zero : Radius.circular(borderRadius),
),
),
child: Theme(
data: Theme.of(context).copyWith(
textSelectionTheme: TextSelectionThemeData(
cursorColor: Provider.of<Settings>(context).theme.messageSelectionColor,
selectionColor: Provider.of<Settings>(context).theme.messageSelectionColor,
selectionHandleColor: Provider.of<Settings>(context).theme.messageSelectionColor),
// Horrifying Hack: Flutter doesn't give us direct control over system menus but instead picks BG color from TextButtonThemeData ¯\_(ツ)_/¯
textButtonTheme: TextButtonThemeData(
style: ButtonStyle(backgroundColor: MaterialStateProperty.all(Provider.of<Settings>(context).theme.menuBackgroundColor)),
),
),
child: Padding(
padding: EdgeInsets.all(9.0),
child: Column(
@ -256,7 +268,7 @@ class FileBubbleState extends State<FileBubble> {
wdgDecorations,
messageStatusWidget
]),
));
)));
});
}

View File

@ -100,10 +100,23 @@ class InvitationBubbleState extends State<InvitationBubble> {
//print(constraints.toString()+", "+constraints.maxWidth.toString());
return Center(
widthFactor: 1.0,
child: Theme(
data: Theme.of(context).copyWith(
textSelectionTheme: TextSelectionThemeData(
cursorColor: Provider.of<Settings>(context).theme.messageSelectionColor,
selectionColor: Provider.of<Settings>(context).theme.messageSelectionColor,
selectionHandleColor: Provider.of<Settings>(context).theme.messageSelectionColor),
// Horrifying Hack: Flutter doesn't give us direct control over system menus but instead picks BG color from TextButtonThemeData ¯\_(ツ)_/¯
textButtonTheme: TextButtonThemeData(
style: ButtonStyle(backgroundColor: MaterialStateProperty.all(Provider.of<Settings>(context).theme.menuBackgroundColor)),
),
),
child: Container(
decoration: BoxDecoration(
color: fromMe ? Provider.of<Settings>(context).theme.messageFromMeBackgroundColor : Provider.of<Settings>(context).theme.messageFromOtherBackgroundColor,
border: Border.all(color: fromMe ? Provider.of<Settings>(context).theme.messageFromMeBackgroundColor : Provider.of<Settings>(context).theme.messageFromOtherBackgroundColor, width: 1),
border:
Border.all(color: fromMe ? Provider.of<Settings>(context).theme.messageFromMeBackgroundColor : Provider.of<Settings>(context).theme.messageFromOtherBackgroundColor, width: 1),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(borderRadiousEh),
topRight: Radius.circular(borderRadiousEh),
@ -117,7 +130,8 @@ class InvitationBubbleState extends State<InvitationBubble> {
padding: EdgeInsets.all(9.0),
child: Wrap(runAlignment: WrapAlignment.spaceEvenly, alignment: WrapAlignment.spaceEvenly, runSpacing: 1.0, crossAxisAlignment: WrapCrossAlignment.center, children: [
Center(
widthFactor: 1, child: Padding(padding: EdgeInsets.all(10.0), child: Icon(isGroup && !showGroupInvite ? CwtchIcons.enable_experiments : CwtchIcons.send_invite, size: 32))),
widthFactor: 1,
child: Padding(padding: EdgeInsets.all(10.0), child: Icon(isGroup && !showGroupInvite ? CwtchIcons.enable_experiments : CwtchIcons.send_invite, size: 32))),
Center(
widthFactor: 1.0,
child: Column(
@ -126,7 +140,7 @@ class InvitationBubbleState extends State<InvitationBubble> {
mainAxisSize: MainAxisSize.min,
children: fromMe ? [wdgMessage, wdgDecorations] : [wdgSender, wdgMessage, wdgDecorations]),
)
])))));
]))))));
});
}

View File

@ -143,11 +143,23 @@ class QuotedMessageBubbleState extends State<QuotedMessageBubble> {
),
child: Padding(
padding: EdgeInsets.all(9.0),
child: Theme(
data: Theme.of(context).copyWith(
textSelectionTheme: TextSelectionThemeData(
cursorColor: Provider.of<Settings>(context).theme.messageSelectionColor,
selectionColor: Provider.of<Settings>(context).theme.messageSelectionColor,
selectionHandleColor: Provider.of<Settings>(context).theme.messageSelectionColor),
// Horrifying Hack: Flutter doesn't give us direct control over system menus but instead picks BG color from TextButtonThemeData ¯\_(ツ)_/¯
textButtonTheme: TextButtonThemeData(
style: ButtonStyle(backgroundColor: MaterialStateProperty.all(Provider.of<Settings>(context).theme.menuBackgroundColor)),
),
),
child: Column(
crossAxisAlignment: fromMe ? CrossAxisAlignment.end : CrossAxisAlignment.start,
mainAxisAlignment: fromMe ? MainAxisAlignment.end : MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: fromMe ? [wdgQuote, wdgMessage, wdgDecorations] : [wdgSender, wdgQuote, wdgMessage, wdgDecorations])))));
children: fromMe ? [wdgQuote, wdgMessage, wdgDecorations] : [wdgSender, wdgQuote, wdgMessage, wdgDecorations]))))));
});
}
}