fix speech-to-text inline tooltip overflow (#1100)
This commit is contained in:
parent
e013ffb2f6
commit
ddeb55a337
3 changed files with 48 additions and 43 deletions
|
|
@ -118,21 +118,9 @@ class ITBarState extends State<ITBar> with SingleTickerProviderStateMixin {
|
|||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
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)
|
||||
Expanded(
|
||||
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),
|
||||
if (showITInstructionsTooltip)
|
||||
const InlineTooltip(
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ class InlineTooltipState extends State<InlineTooltip>
|
|||
color: Theme.of(context).colorScheme.onSurface,
|
||||
height: 1.5,
|
||||
),
|
||||
textAlign: TextAlign.left,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@ class MessageSpeechToTextCardState extends State<MessageSpeechToTextCard> {
|
|||
|
||||
//TODO: find better icons
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(8),
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
|
|
@ -178,34 +178,41 @@ class MessageSpeechToTextCardState extends State<MessageSpeechToTextCard> {
|
|||
RichText(
|
||||
text: _buildTranscriptText(context),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
IconNumberWidget(
|
||||
icon: Symbols.target,
|
||||
number:
|
||||
"${selectedToken?.confidence ?? speechToTextResponse!.transcript.confidence}%",
|
||||
toolTip: L10n.of(context)!.accuracy,
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
IconNumberWidget(
|
||||
icon: Icons.speed,
|
||||
number: wordsPerMinuteString != null
|
||||
? "$wordsPerMinuteString"
|
||||
: "??",
|
||||
toolTip: L10n.of(context)!.wordsPerMinute,
|
||||
),
|
||||
],
|
||||
),
|
||||
const Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
InlineTooltip(
|
||||
instructionsEnum: InstructionsEnum.speechToText,
|
||||
),
|
||||
],
|
||||
),
|
||||
if (widget.messageEvent.senderId == Matrix.of(context).client.userID)
|
||||
Column(
|
||||
children: [
|
||||
const SizedBox(height: 16),
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
IconNumberWidget(
|
||||
icon: Symbols.target,
|
||||
number:
|
||||
"${selectedToken?.confidence ?? speechToTextResponse!.transcript.confidence}%",
|
||||
toolTip: L10n.of(context)!.accuracy,
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
IconNumberWidget(
|
||||
icon: Icons.speed,
|
||||
number: wordsPerMinuteString != null
|
||||
? "$wordsPerMinuteString"
|
||||
: "??",
|
||||
toolTip: L10n.of(context)!.wordsPerMinute,
|
||||
),
|
||||
],
|
||||
),
|
||||
const Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Expanded(
|
||||
child: InlineTooltip(
|
||||
instructionsEnum: InstructionsEnum.speechToText,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue