fix: resolve overflow for long lemmas (#1680)
This commit is contained in:
parent
6f213e78a5
commit
ed3ca1fd25
4 changed files with 32 additions and 29 deletions
|
|
@ -26,13 +26,16 @@ class EmojiPracticeButton extends StatelessWidget {
|
|||
Widget build(BuildContext context) {
|
||||
final emoji = token.getEmoji();
|
||||
return _shouldDoActivity || emoji != null
|
||||
? WordZoomActivityButton(
|
||||
icon: emoji == null
|
||||
? const Icon(Icons.add_reaction_outlined)
|
||||
: Text(emoji),
|
||||
isSelected: isSelected,
|
||||
onPressed: onPressed,
|
||||
? SizedBox(
|
||||
width: 30,
|
||||
child: WordZoomActivityButton(
|
||||
icon: emoji == null
|
||||
? const Icon(Icons.add_reaction_outlined)
|
||||
: Text(emoji),
|
||||
isSelected: isSelected,
|
||||
onPressed: onPressed,
|
||||
),
|
||||
)
|
||||
: const SizedBox(width: 60);
|
||||
: const SizedBox(width: 30);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,28 +66,24 @@ class WordAudioButtonState extends State<WordTextWithAudioButton> {
|
|||
decoration: BoxDecoration(
|
||||
color: Colors.transparent,
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
boxShadow: _isHovering
|
||||
? [
|
||||
BoxShadow(
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
blurRadius: 4,
|
||||
spreadRadius: 1,
|
||||
),
|
||||
]
|
||||
: [],
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
widget.text,
|
||||
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
||||
color: _isPlaying
|
||||
? Theme.of(context).colorScheme.secondary
|
||||
: null,
|
||||
fontSize:
|
||||
Theme.of(context).textTheme.titleLarge?.fontSize,
|
||||
),
|
||||
ConstrainedBox(
|
||||
constraints: const BoxConstraints(maxWidth: 180),
|
||||
child: Text(
|
||||
widget.text,
|
||||
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
||||
color: _isPlaying
|
||||
? Theme.of(context).colorScheme.secondary
|
||||
: null,
|
||||
fontSize:
|
||||
Theme.of(context).textTheme.titleLarge?.fontSize,
|
||||
),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
Icon(
|
||||
|
|
@ -100,6 +96,4 @@ class WordAudioButtonState extends State<WordTextWithAudioButton> {
|
|||
),
|
||||
);
|
||||
}
|
||||
|
||||
final bool _isHovering = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,13 @@ class LemmaWidget extends StatelessWidget {
|
|||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(token.lemma.text),
|
||||
ConstrainedBox(
|
||||
constraints: const BoxConstraints(maxWidth: 180),
|
||||
child: Text(
|
||||
token.lemma.text,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
SizedBox(
|
||||
width: 20,
|
||||
|
|
|
|||
|
|
@ -237,7 +237,7 @@ class WordZoomWidgetState extends State<WordZoomWidget> {
|
|||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(width: 40),
|
||||
const SizedBox(width: 30),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue