ENH:big_bed_image_popup automatic hide

jira: STUDIO-11327
Change-Id: I44a43d67ff909768f5e652a687883742ece14737
(cherry picked from commit dbaec237c4e53b9e93901f21274c729d79cce2d5)
This commit is contained in:
zhou.xu 2025-04-03 14:36:54 +08:00 committed by Noisyfox
parent d2754f4c36
commit b9796e8765
3 changed files with 50 additions and 7 deletions

View file

@ -43,6 +43,7 @@ ImageDPIFrame::ImageDPIFrame()
SetSizer(m_sizer_main);
Layout();
Fit();
init_timer();
}
ImageDPIFrame::~ImageDPIFrame() {
@ -65,16 +66,39 @@ void ImageDPIFrame::on_dpi_changed(const wxRect &suggested_rect)
//m_bitmap->Rescale();
}
void ImageDPIFrame::init_timer()
{
m_refresh_timer = new wxTimer();
m_refresh_timer->SetOwner(this);
Bind(wxEVT_TIMER, &ImageDPIFrame::on_timer, this);
}
void ImageDPIFrame::on_timer(wxTimerEvent &event)
{
if (!IsShown()) {//after 1s to show Frame
if (m_timer_count >= 50) {
Show();
Raise();
}
m_timer_count++;
}
}
void ImageDPIFrame::on_show() {
if (IsShown()) {
on_hide();
}
Show();
Raise();
if (m_refresh_timer) {
m_timer_count = 0;
m_refresh_timer->Start(ANIMATION_REFRESH_INTERVAL);
}
}
void ImageDPIFrame::on_hide()
{
if (m_refresh_timer) {
m_refresh_timer->Stop();
}
if (IsShown()) {
Hide();
if (wxGetApp().mainframe != nullptr) {