fix speech-to-text inline tooltip overflow (#1100)

pull/1544/head
ggurdin 12 months ago committed by GitHub
parent e013ffb2f6
commit ddeb55a337
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -118,21 +118,9 @@ class ITBarState extends State<ITBar> with SingleTickerProviderStateMixin {
child: Column( child: Column(
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
if (!itController.isEditingSourceText &&
itController.sourceText != null)
SizedBox(width: iconDimension * 3),
if (!itController.isEditingSourceText)
Expanded(
child: itController.sourceText != null
? Text(
itController.sourceText!,
textAlign: TextAlign.center,
)
: const LinearProgressIndicator(),
),
if (itController.isEditingSourceText) if (itController.isEditingSourceText)
Expanded( Expanded(
child: Padding( child: Padding(
@ -205,6 +193,16 @@ class ITBarState extends State<ITBar> with SingleTickerProviderStateMixin {
), ),
], ],
), ),
if (!itController.isEditingSourceText)
Padding(
padding: const EdgeInsets.only(top: 8.0),
child: itController.sourceText != null
? Text(
itController.sourceText!,
textAlign: TextAlign.center,
)
: const LinearProgressIndicator(),
),
const SizedBox(height: 8.0), const SizedBox(height: 8.0),
if (showITInstructionsTooltip) if (showITInstructionsTooltip)
const InlineTooltip( const InlineTooltip(

@ -92,7 +92,7 @@ class InlineTooltipState extends State<InlineTooltip>
color: Theme.of(context).colorScheme.onSurface, color: Theme.of(context).colorScheme.onSurface,
height: 1.5, height: 1.5,
), ),
textAlign: TextAlign.left, textAlign: TextAlign.center,
), ),
), ),
), ),

@ -170,7 +170,7 @@ class MessageSpeechToTextCardState extends State<MessageSpeechToTextCard> {
//TODO: find better icons //TODO: find better icons
return Padding( return Padding(
padding: const EdgeInsets.all(8), padding: const EdgeInsets.all(16),
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
@ -178,34 +178,41 @@ class MessageSpeechToTextCardState extends State<MessageSpeechToTextCard> {
RichText( RichText(
text: _buildTranscriptText(context), text: _buildTranscriptText(context),
), ),
const SizedBox(height: 16), if (widget.messageEvent.senderId == Matrix.of(context).client.userID)
Row( Column(
mainAxisSize: MainAxisSize.min, children: [
children: [ const SizedBox(height: 16),
IconNumberWidget( Row(
icon: Symbols.target, mainAxisSize: MainAxisSize.min,
number: children: [
"${selectedToken?.confidence ?? speechToTextResponse!.transcript.confidence}%", IconNumberWidget(
toolTip: L10n.of(context)!.accuracy, icon: Symbols.target,
), number:
const SizedBox(width: 16), "${selectedToken?.confidence ?? speechToTextResponse!.transcript.confidence}%",
IconNumberWidget( toolTip: L10n.of(context)!.accuracy,
icon: Icons.speed, ),
number: wordsPerMinuteString != null const SizedBox(width: 16),
? "$wordsPerMinuteString" IconNumberWidget(
: "??", icon: Icons.speed,
toolTip: L10n.of(context)!.wordsPerMinute, number: wordsPerMinuteString != null
), ? "$wordsPerMinuteString"
], : "??",
), toolTip: L10n.of(context)!.wordsPerMinute,
const Row( ),
mainAxisSize: MainAxisSize.min, ],
children: [ ),
InlineTooltip( const Row(
instructionsEnum: InstructionsEnum.speechToText, mainAxisSize: MainAxisSize.min,
), children: [
], Expanded(
), child: InlineTooltip(
instructionsEnum: InstructionsEnum.speechToText,
),
),
],
),
],
),
], ],
), ),
); );

Loading…
Cancel
Save