From b020322a3a9db98a2877612285a41939db936064 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Mon, 1 Oct 2012 15:21:18 -0700 Subject: [PATCH] Update the size of the karaoke syllable bar when the window is resized. Updates #1516. --- aegisub/src/audio_karaoke.cpp | 7 ++++++- aegisub/src/audio_karaoke.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/aegisub/src/audio_karaoke.cpp b/aegisub/src/audio_karaoke.cpp index a88fb914d..2acd0536f 100644 --- a/aegisub/src/audio_karaoke.cpp +++ b/aegisub/src/audio_karaoke.cpp @@ -95,7 +95,7 @@ AudioKaraoke::AudioKaraoke(wxWindow *parent, agi::Context *c) split_font.SetFaceName(OPT_GET("Audio/Karaoke/Font Face")->GetString()); split_font.SetPointSize(OPT_GET("Audio/Karaoke/Font Size")->GetInt()); - Bind(wxEVT_SIZE, bind(&AudioKaraoke::Refresh, this, false, (const wxRect*)0)); + split_area->Bind(wxEVT_SIZE, &AudioKaraoke::OnSize, this); split_area->Bind(wxEVT_PAINT, &AudioKaraoke::OnPaint, this); split_area->Bind(wxEVT_LEFT_DOWN, &AudioKaraoke::OnMouse, this); split_area->Bind(wxEVT_LEFT_UP, &AudioKaraoke::OnMouse, this); @@ -153,6 +153,11 @@ void AudioKaraoke::SetEnabled(bool en) { } } +void AudioKaraoke::OnSize(wxSizeEvent &evt) { + RenderText(); + Refresh(false); +} + void AudioKaraoke::OnPaint(wxPaintEvent &) { int w, h; split_area->GetClientSize(&w, &h); diff --git a/aegisub/src/audio_karaoke.h b/aegisub/src/audio_karaoke.h index 3ec06b465..014eff65d 100644 --- a/aegisub/src/audio_karaoke.h +++ b/aegisub/src/audio_karaoke.h @@ -138,6 +138,7 @@ class AudioKaraoke : public wxWindow, private SelectionListener { void OnFileChanged(int type); void OnMouse(wxMouseEvent &event); void OnPaint(wxPaintEvent &event); + void OnSize(wxSizeEvent &event); void OnSelectedSetChanged(Selection const&, Selection const&) { } void OnAudioOpened(); void OnAudioClosed();