Merge pull request #929 from pangeachat/925-change-bot-style-text-to-use-same-font-as-messages-set-toolbar-min-width-and-height-based-on-audio-activity
925 change bot style text to use same font as messages set toolbar min width and height based on audio activity
This commit is contained in:
commit
8d86c06456
6 changed files with 31 additions and 43 deletions
|
|
@ -23,8 +23,8 @@ abstract class AppConfig {
|
|||
static const bool allowOtherHomeservers = true;
|
||||
static const bool enableRegistration = true;
|
||||
static const double toolbarMaxHeight = 300.0;
|
||||
static const double toolbarMinHeight = 70.0;
|
||||
static const double toolbarMinWidth = 270.0;
|
||||
static const double toolbarMinHeight = 175.0;
|
||||
static const double toolbarMinWidth = 350.0;
|
||||
static const double toolbarButtonsHeight = 50.0;
|
||||
// #Pangea
|
||||
// static const Color primaryColor = Color(0xFF5625BA);
|
||||
|
|
|
|||
|
|
@ -9,11 +9,10 @@ class BotStyle {
|
|||
bool setColor = true,
|
||||
bool big = false,
|
||||
bool italics = false,
|
||||
bool bold = true,
|
||||
bool bold = false,
|
||||
}) {
|
||||
try {
|
||||
final TextStyle botStyle = TextStyle(
|
||||
fontFamily: 'Inconsolata',
|
||||
fontWeight: bold ? FontWeight.w700 : null,
|
||||
fontSize: AppConfig.messageFontSize *
|
||||
AppConfig.fontSizeFactor *
|
||||
|
|
|
|||
|
|
@ -491,6 +491,7 @@ class MessageOverlayController extends State<MessageSelectionOverlay>
|
|||
overLayController: this,
|
||||
tts: tts,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
SizedBox(
|
||||
height: adjustedMessageHeight,
|
||||
child: OverlayMessage(
|
||||
|
|
|
|||
|
|
@ -124,10 +124,6 @@ class MessageToolbar extends StatelessWidget {
|
|||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).cardColor,
|
||||
border: Border.all(
|
||||
width: 2,
|
||||
color: Theme.of(context).colorScheme.primary.withOpacity(0.5),
|
||||
),
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(AppConfig.borderRadius),
|
||||
),
|
||||
|
|
@ -138,11 +134,15 @@ class MessageToolbar extends StatelessWidget {
|
|||
minHeight: AppConfig.toolbarMinHeight,
|
||||
// maxWidth is set by MessageSelectionOverlay
|
||||
),
|
||||
child: SingleChildScrollView(
|
||||
child: AnimatedSize(
|
||||
duration: FluffyThemes.animationDuration,
|
||||
child: toolbarContent(context),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
AnimatedSize(
|
||||
duration: FluffyThemes.animationDuration,
|
||||
child: toolbarContent(context),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -147,35 +147,25 @@ class MessageTranslationCardState extends State<MessageTranslationCard> {
|
|||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 20, 16, 16),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Flexible(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
widget.selection != null
|
||||
? selectionTranslation!
|
||||
: repEvent!.text,
|
||||
style: BotStyle.text(context),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
if (notGoingToTranslate && widget.selection == null)
|
||||
InlineTooltip(
|
||||
instructionsEnum: InstructionsEnum.l1Translation,
|
||||
onClose: () => setState(() {}),
|
||||
),
|
||||
if (widget.selection != null)
|
||||
InlineTooltip(
|
||||
instructionsEnum: InstructionsEnum.clickAgainToDeselect,
|
||||
onClose: () => setState(() {}),
|
||||
),
|
||||
],
|
||||
),
|
||||
Text(
|
||||
widget.selection != null ? selectionTranslation! : repEvent!.text,
|
||||
style: BotStyle.text(context),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
if (notGoingToTranslate && widget.selection == null)
|
||||
InlineTooltip(
|
||||
instructionsEnum: InstructionsEnum.l1Translation,
|
||||
onClose: () => setState(() {}),
|
||||
),
|
||||
if (widget.selection != null)
|
||||
InlineTooltip(
|
||||
instructionsEnum: InstructionsEnum.clickAgainToDeselect,
|
||||
onClose: () => setState(() {}),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import 'package:fluffychat/pangea/controllers/my_analytics_controller.dart';
|
|||
import 'package:fluffychat/pangea/enum/activity_type_enum.dart';
|
||||
import 'package:fluffychat/pangea/models/practice_activities.dart/practice_activity_model.dart';
|
||||
import 'package:fluffychat/pangea/models/practice_activities.dart/practice_activity_record_model.dart';
|
||||
import 'package:fluffychat/pangea/utils/bot_style.dart';
|
||||
import 'package:fluffychat/pangea/widgets/chat/tts_controller.dart';
|
||||
import 'package:fluffychat/pangea/widgets/practice_activity/practice_activity_card.dart';
|
||||
import 'package:fluffychat/pangea/widgets/practice_activity/word_audio_button.dart';
|
||||
|
|
@ -108,10 +109,7 @@ class MultipleChoiceActivityState extends State<MultipleChoiceActivity> {
|
|||
children: [
|
||||
Text(
|
||||
practiceActivity.content.question,
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
style: BotStyle.text(context),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
if (practiceActivity.activityType ==
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue