diff options
| author | Paul Buetow <paul@buetow.org> | 2026-04-03 10:48:51 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-04-03 10:48:51 +0300 |
| commit | 387ced77126db28ed205868543119768be2e61b3 (patch) | |
| tree | 3ebcff4a8092865d8d0a0676333d69a97e70961f /internal/gui | |
| parent | cf6eb20b00c206578078e342f77a4ee3de380e67 (diff) | |
fix: show full phonetic IPA in audio player bar
Two issues prevented the IPA from being fully displayed:
1. audio_player.go: switched the bottom bar from NewHBox to NewBorder so the
phonetic label fills the centre column instead of being squeezed to its
minimum width between the stop button and the status label. Also enabled
TextWrapWord so very long IPA strings wrap rather than being clipped.
2. phonetic/fetcher.go: raised MaxOutputTokens from 50 to 200 so Gemini 2.5
Flash has enough budget to emit the full IPA bracket pair without truncation.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal/gui')
| -rw-r--r-- | internal/gui/audio_player.go | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/internal/gui/audio_player.go b/internal/gui/audio_player.go index 1f599d9..ddd67d6 100644 --- a/internal/gui/audio_player.go +++ b/internal/gui/audio_player.go @@ -12,7 +12,6 @@ import ( "fyne.io/fyne/v2" "fyne.io/fyne/v2/container" - "fyne.io/fyne/v2/layout" "fyne.io/fyne/v2/theme" "fyne.io/fyne/v2/widget" ttwidget "github.com/dweymouth/fyne-tooltip/widget" @@ -67,12 +66,13 @@ func NewAudioPlayer() *AudioPlayer { p.statusLabel = widget.NewLabel("No audio loaded") - // Create phonetic label + // Create phonetic label — wraps so long IPA strings are never clipped. p.phoneticLabel = widget.NewLabel("") p.phoneticLabel.TextStyle = fyne.TextStyle{ Bold: true, Italic: true, } + p.phoneticLabel.Wrapping = fyne.TextWrapWord // Initially disable controls p.playButton.Disable() @@ -81,17 +81,15 @@ func NewAudioPlayer() *AudioPlayer { p.playBackLabel.Hide() p.stopButton.Disable() - // Create main container with phonetic display - p.container = container.NewHBox( - container.NewVBox( - container.NewHBox(p.playButton, p.playButtonLabel), - container.NewHBox(p.playBackButton, p.playBackLabel), - ), - p.stopButton, - p.phoneticLabel, - layout.NewSpacer(), - p.statusLabel, + // Layout: buttons on the left, status on the right, phonetic fills the middle. + // Using NewBorder so the phonetic label expands horizontally rather than being + // squeezed to its minimum width in an HBox. + buttons := container.NewVBox( + container.NewHBox(p.playButton, p.playButtonLabel), + container.NewHBox(p.playBackButton, p.playBackLabel), ) + leftControls := container.NewHBox(buttons, p.stopButton) + p.container = container.NewBorder(nil, nil, leftControls, p.statusLabel, p.phoneticLabel) p.ExtendBaseWidget(p) return p |
