From e7a2d12a3c1f0c872d4b01b3ba7936841291c958 Mon Sep 17 00:00:00 2001 From: ggurdin <46800240+ggurdin@users.noreply.github.com> Date: Fri, 4 Apr 2025 11:31:11 -0400 Subject: [PATCH] chore: disable custom message text sizing (#2355) --- .../settings_style/settings_style_view.dart | 26 +-- .../activity_suggestions_area.dart | 155 +++++++++--------- .../toolbar/widgets/message_token_text.dart | 8 +- lib/widgets/matrix.dart | 8 +- 4 files changed, 102 insertions(+), 95 deletions(-) diff --git a/lib/pages/settings_style/settings_style_view.dart b/lib/pages/settings_style/settings_style_view.dart index d234759df..182c9f332 100644 --- a/lib/pages/settings_style/settings_style_view.dart +++ b/lib/pages/settings_style/settings_style_view.dart @@ -323,18 +323,20 @@ class SettingsStyleView extends StatelessWidget { ); }, ), - ListTile( - title: Text(L10n.of(context).fontSize), - trailing: Text('× ${AppConfig.fontSizeFactor}'), - ), - Slider.adaptive( - min: 0.5, - max: 2.5, - divisions: 20, - value: AppConfig.fontSizeFactor, - semanticFormatterCallback: (d) => d.toString(), - onChanged: controller.changeFontSizeFactor, - ), + // #Pangea + // ListTile( + // title: Text(L10n.of(context).fontSize), + // trailing: Text('× ${AppConfig.fontSizeFactor}'), + // ), + // Slider.adaptive( + // min: 0.5, + // max: 2.5, + // divisions: 20, + // value: AppConfig.fontSizeFactor, + // semanticFormatterCallback: (d) => d.toString(), + // onChanged: controller.changeFontSizeFactor, + // ), + // Pangea Divider( color: theme.dividerColor, ), diff --git a/lib/pangea/activity_suggestions/activity_suggestions_area.dart b/lib/pangea/activity_suggestions/activity_suggestions_area.dart index 4231755e6..bd99a7021 100644 --- a/lib/pangea/activity_suggestions/activity_suggestions_area.dart +++ b/lib/pangea/activity_suggestions/activity_suggestions_area.dart @@ -175,88 +175,91 @@ class ActivitySuggestionsAreaState extends State { overflow: TextOverflow.ellipsis, ), ), - Row( - spacing: 8.0, - children: [ - InkWell( - customBorder: const CircleBorder(), - onTap: () => context.go('/homepage/newgroup'), - child: Container( - decoration: BoxDecoration( - color: theme.colorScheme.surfaceContainerHighest, - borderRadius: BorderRadius.circular(36.0), - ), - padding: const EdgeInsets.symmetric( - vertical: 6.0, - horizontal: 10.0, - ), - child: Row( - spacing: 8.0, - mainAxisSize: MainAxisSize.min, - children: [ - CustomizedSvg( - svgUrl: - "${AppConfig.assetsBaseURL}/${ActivitySuggestionsConstants.plusIconPath}", - colorReplacements: { - "#CDBEF9": colorToHex( - Theme.of(context).colorScheme.secondary, - ), - }, - height: 16.0, - width: 16.0, - ), - Text( - isColumnMode - ? L10n.of(context).createOwnChat - : L10n.of(context).chat, - style: theme.textTheme.titleSmall?.copyWith( - fontWeight: FontWeight.bold, + Material( + type: MaterialType.transparency, + child: Row( + spacing: 8.0, + children: [ + InkWell( + customBorder: const CircleBorder(), + onTap: () => context.go('/homepage/newgroup'), + child: Container( + decoration: BoxDecoration( + color: theme.colorScheme.surfaceContainerHighest, + borderRadius: BorderRadius.circular(36.0), + ), + padding: const EdgeInsets.symmetric( + vertical: 6.0, + horizontal: 10.0, + ), + child: Row( + spacing: 8.0, + mainAxisSize: MainAxisSize.min, + children: [ + CustomizedSvg( + svgUrl: + "${AppConfig.assetsBaseURL}/${ActivitySuggestionsConstants.plusIconPath}", + colorReplacements: { + "#CDBEF9": colorToHex( + Theme.of(context).colorScheme.secondary, + ), + }, + height: 16.0, + width: 16.0, ), - ), - ], + Text( + isColumnMode + ? L10n.of(context).createOwnChat + : L10n.of(context).chat, + style: theme.textTheme.titleSmall?.copyWith( + fontWeight: FontWeight.bold, + ), + ), + ], + ), ), ), - ), - InkWell( - customBorder: const CircleBorder(), - onTap: () => context.go('/homepage/planner'), - child: Container( - decoration: BoxDecoration( - color: theme.colorScheme.surfaceContainerHighest, - borderRadius: BorderRadius.circular(36.0), - ), - padding: const EdgeInsets.symmetric( - vertical: 6.0, - horizontal: 10.0, - ), - child: Row( - spacing: 8.0, - mainAxisSize: MainAxisSize.min, - children: [ - CustomizedSvg( - svgUrl: - "${AppConfig.assetsBaseURL}/${ActivitySuggestionsConstants.crayonIconPath}", - colorReplacements: { - "#CDBEF9": colorToHex( - Theme.of(context).colorScheme.secondary, - ), - }, - height: 16.0, - width: 16.0, - ), - Text( - isColumnMode - ? L10n.of(context).makeYourOwnActivity - : L10n.of(context).createActivity, - style: theme.textTheme.titleSmall?.copyWith( - fontWeight: FontWeight.bold, + InkWell( + customBorder: const CircleBorder(), + onTap: () => context.go('/homepage/planner'), + child: Container( + decoration: BoxDecoration( + color: theme.colorScheme.surfaceContainerHighest, + borderRadius: BorderRadius.circular(36.0), + ), + padding: const EdgeInsets.symmetric( + vertical: 6.0, + horizontal: 10.0, + ), + child: Row( + spacing: 8.0, + mainAxisSize: MainAxisSize.min, + children: [ + CustomizedSvg( + svgUrl: + "${AppConfig.assetsBaseURL}/${ActivitySuggestionsConstants.crayonIconPath}", + colorReplacements: { + "#CDBEF9": colorToHex( + Theme.of(context).colorScheme.secondary, + ), + }, + height: 16.0, + width: 16.0, ), - ), - ], + Text( + isColumnMode + ? L10n.of(context).makeYourOwnActivity + : L10n.of(context).createActivity, + style: theme.textTheme.titleSmall?.copyWith( + fontWeight: FontWeight.bold, + ), + ), + ], + ), ), ), - ), - ], + ], + ), ), ], ), diff --git a/lib/pangea/toolbar/widgets/message_token_text.dart b/lib/pangea/toolbar/widgets/message_token_text.dart index 79b9a718d..58e5e8e35 100644 --- a/lib/pangea/toolbar/widgets/message_token_text.dart +++ b/lib/pangea/toolbar/widgets/message_token_text.dart @@ -242,11 +242,11 @@ class MessageTextWidget extends StatelessWidget { ? theme.colorScheme.onPrimary : theme.colorScheme.onSurface; - return RichText( + return Text.rich( softWrap: softWrap ?? true, maxLines: maxLines, overflow: overflow ?? TextOverflow.clip, - text: TextSpan( + TextSpan( children: tokenPositions.mapIndexed((int i, TokenPosition tokenPosition) { final substring = messageCharacters @@ -318,8 +318,8 @@ class MessageTextWidget extends StatelessWidget { onTap: onClick != null ? () => onClick?.call(tokenPosition) : null, - child: RichText( - text: TextSpan( + child: Text.rich( + TextSpan( children: [ if (start.isNotEmpty) LinkifySpan( diff --git a/lib/widgets/matrix.dart b/lib/widgets/matrix.dart index 3f1673033..3f9428704 100644 --- a/lib/widgets/matrix.dart +++ b/lib/widgets/matrix.dart @@ -436,9 +436,11 @@ class MatrixState extends State with WidgetsBindingObserver { } void initSettings() { - AppConfig.fontSizeFactor = - double.tryParse(store.getString(SettingKeys.fontSizeFactor) ?? '') ?? - AppConfig.fontSizeFactor; + // #Pangea + // AppConfig.fontSizeFactor = + // double.tryParse(store.getString(SettingKeys.fontSizeFactor) ?? '') ?? + // AppConfig.fontSizeFactor; + // Pangea# AppConfig.renderHtml = store.getBool(SettingKeys.renderHtml) ?? AppConfig.renderHtml;