From 4578cc51ec7267f1d74fc4d3cb19c042fe55f8d0 Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Fri, 9 Feb 2024 13:34:10 -0800 Subject: [PATCH] Upgrade Cwtch, Fix Android File Sharing, Fixup UI Scaling --- LIBCWTCH-GO.version | 2 +- lib/views/groupsettingsview.dart | 2 +- lib/views/peersettingsview.dart | 6 +- lib/widgets/contactrow.dart | 108 ++++++++++++++++--------------- 4 files changed, 64 insertions(+), 54 deletions(-) diff --git a/LIBCWTCH-GO.version b/LIBCWTCH-GO.version index 7e597873..3062ce16 100644 --- a/LIBCWTCH-GO.version +++ b/LIBCWTCH-GO.version @@ -1 +1 @@ -2024-01-15-10-14-v0.0.10-9-g425c3e6 \ No newline at end of file +2024-02-09-13-23-v0.0.11 \ No newline at end of file diff --git a/lib/views/groupsettingsview.dart b/lib/views/groupsettingsview.dart index e6659289..1334ee41 100644 --- a/lib/views/groupsettingsview.dart +++ b/lib/views/groupsettingsview.dart @@ -48,7 +48,7 @@ class _GroupSettingsViewState extends State { return Scaffold( appBar: AppBar( title: Container( - height: 24, + height: Provider.of(context).fontScaling * 24.0, clipBehavior: Clip.hardEdge, decoration: BoxDecoration(), child: Text(Provider.of(context).nickname + " " + AppLocalizations.of(context)!.conversationSettings)), diff --git a/lib/views/peersettingsview.dart b/lib/views/peersettingsview.dart index ff307427..5920240c 100644 --- a/lib/views/peersettingsview.dart +++ b/lib/views/peersettingsview.dart @@ -49,7 +49,11 @@ class _PeerSettingsViewState extends State { } return Scaffold( appBar: AppBar( - title: Container(height: 24, clipBehavior: Clip.hardEdge, decoration: BoxDecoration(), child: Text(handle + " " + AppLocalizations.of(context)!.conversationSettings)), + title: Container( + height: Provider.of(context).fontScaling * 24.0, + clipBehavior: Clip.hardEdge, + decoration: BoxDecoration(), + child: Text(handle + " " + AppLocalizations.of(context)!.conversationSettings)), ), body: _buildSettingsList(), ); diff --git a/lib/widgets/contactrow.dart b/lib/widgets/contactrow.dart index ef8027c3..c50ece85 100644 --- a/lib/widgets/contactrow.dart +++ b/lib/widgets/contactrow.dart @@ -119,59 +119,65 @@ class _ContactRowState extends State { child: this.cachedMessage == null ? CircularProgressIndicator() : this.cachedMessage!.getPreviewWidget(context), )), Container( - padding: EdgeInsets.all(0), - height: Provider.of(context).fontScaling * 14.0 + 5.0, - child: contact.isInvitation == true - ? Wrap(alignment: WrapAlignment.start, direction: Axis.vertical, children: [ - Padding( - padding: EdgeInsets.all(2), - child: TextButton.icon( - label: Text( - AppLocalizations.of(context)!.tooltipAcceptContactRequest, - style: Provider.of(context).scaleFonts(defaultTextButtonStyle), - ), - icon: Icon( - Icons.favorite, - size: 16, - color: Provider.of(context).theme.mainTextColor, - ), - onPressed: _btnApprove, - )), - Padding( - padding: EdgeInsets.all(2), - child: TextButton.icon( - label: Text( - AppLocalizations.of(context)!.tooltipRejectContactRequest, - style: Provider.of(context).scaleFonts(defaultTextButtonStyle), - ), - style: ButtonStyle( - backgroundColor: MaterialStateProperty.all(Provider.of(context).theme.backgroundPaneColor), - foregroundColor: MaterialStateProperty.all(Provider.of(context).theme.mainTextColor)), - icon: Icon(Icons.delete, size: 16, color: Provider.of(context).theme.mainTextColor), - onPressed: _btnReject, - )) - ]) - : (contact.isBlocked - ? IconButton( - padding: EdgeInsets.zero, - splashRadius: Material.defaultSplashRadius / 2, - iconSize: 16, - icon: Icon(Icons.block, color: Provider.of(context).theme.mainTextColor), - onPressed: () {}, - ) - : Text(prettyDateString(context, widget.messageIndex == null ? contact.lastMessageSentTime : (this.cachedMessage?.getMetadata().timestamp ?? DateTime.now())))), - ), + padding: EdgeInsets.all(0), + height: Provider.of(context).fontScaling * 14.0 + 5.0, + child: contact.isInvitation == true + ? Wrap(alignment: WrapAlignment.start, direction: Axis.vertical, children: [ + Padding( + padding: EdgeInsets.all(2), + child: TextButton.icon( + label: Text( + AppLocalizations.of(context)!.tooltipAcceptContactRequest, + style: Provider.of(context).scaleFonts(defaultTextButtonStyle), + ), + icon: Icon( + Icons.favorite, + size: 16, + color: Provider.of(context).theme.mainTextColor, + ), + onPressed: _btnApprove, + )), + Padding( + padding: EdgeInsets.all(2), + child: TextButton.icon( + label: Text( + AppLocalizations.of(context)!.tooltipRejectContactRequest, + style: Provider.of(context).scaleFonts(defaultTextButtonStyle), + ), + style: ButtonStyle( + backgroundColor: MaterialStateProperty.all(Provider.of(context).theme.backgroundPaneColor), + foregroundColor: MaterialStateProperty.all(Provider.of(context).theme.mainTextColor)), + icon: Icon(Icons.delete, size: 16, color: Provider.of(context).theme.mainTextColor), + onPressed: _btnReject, + )) + ]) + : (contact.isBlocked + ? IconButton( + padding: EdgeInsets.symmetric(vertical: 2.0, horizontal: 0.0), + splashRadius: Material.defaultSplashRadius / 2, + iconSize: 16, + icon: Icon(Icons.block, color: Provider.of(context).theme.mainTextColor), + onPressed: null, + ) + : Text(prettyDateString(context, widget.messageIndex == null ? contact.lastMessageSentTime : (this.cachedMessage?.getMetadata().timestamp ?? DateTime.now())), + style: Provider.of(context).scaleFonts(TextStyle( + fontSize: 12.0, + fontFamily: "Inter", + ))))), Visibility( visible: !Provider.of(context).streamerMode, - child: Text( - contact.onion, - overflow: TextOverflow.ellipsis, - style: Provider.of(context).scaleFonts(TextStyle( - fontSize: 13.0, - fontFamily: "RobotoMono", - color: ((contact.isBlocked ? Provider.of(context).theme.portraitBlockedTextColor : Provider.of(context).theme.mainTextColor) as Color) - .withOpacity(0.8))), - )), + child: Container( + padding: EdgeInsets.all(0), + height: Provider.of(context).fontScaling * 13.0 + 5.0, + child: Text( + contact.onion, + overflow: TextOverflow.ellipsis, + style: Provider.of(context).scaleFonts(TextStyle( + fontSize: 13.0, + fontFamily: "RobotoMono", + color: ((contact.isBlocked ? Provider.of(context).theme.portraitBlockedTextColor : Provider.of(context).theme.mainTextColor) as Color) + .withOpacity(0.8))), + ))), ], ))), Visibility(