FIX:Fixed frequent switching of dark mode causing unclear window display

jira: STUDIO-10618
Change-Id: I49ccbb4e59d9865f0e4f4d9cef96fe1e0d011e7b
This commit is contained in:
zhou.xu 2025-02-27 17:15:30 +08:00 committed by lane.wei
parent e542faedca
commit 184143ead7
3 changed files with 13 additions and 9 deletions

View File

@ -44,11 +44,11 @@ BaseTransparentDPIFrame::BaseTransparentDPIFrame(
image_sizer->AddStretchSpacer();
text_sizer->Add(image_sizer);
text_sizer->AddSpacer(FromDIP(5));
auto finish_text = new Label(this, win_text, LB_AUTO_WRAP);
finish_text->SetMinSize(wxSize(FromDIP(win_width - 64), -1));
finish_text->SetMaxSize(wxSize(FromDIP(win_width - 64), -1));
finish_text->SetForegroundColour(wxColour(255, 255, 255, 255));
text_sizer->Add(finish_text, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 0);
m_finish_text = new Label(this, win_text, LB_AUTO_WRAP);
m_finish_text->SetMinSize(wxSize(FromDIP(win_width - 64), -1));
m_finish_text->SetMaxSize(wxSize(FromDIP(win_width - 64), -1));
m_finish_text->SetForegroundColour(wxColour(255, 255, 255, 255));
text_sizer->Add(m_finish_text, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 0);
text_sizer->AddSpacer(FromDIP(20));
m_sizer_main->Add(text_sizer, FromDIP(0), wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxTOP, FromDIP(15));
@ -124,6 +124,7 @@ BaseTransparentDPIFrame::~BaseTransparentDPIFrame() {
bool BaseTransparentDPIFrame::Show(bool show)
{
if (show) {
m_finish_text->SetForegroundColour(wxColour(255, 255, 255, 255));
if (m_refresh_timer) {
m_refresh_timer->Start(ANIMATION_REFRESH_INTERVAL);
}

View File

@ -44,7 +44,7 @@ public:
protected:
Button *m_button_ok = nullptr;
Button *m_button_cancel = nullptr;
Label *m_finish_text = nullptr;
DisappearanceMode m_timed_disappearance_mode;
float m_timer_count = 0;
wxTimer * m_refresh_timer{nullptr};

View File

@ -37,6 +37,12 @@ bool SyncAmsInfoDialog::Show(bool show)
{
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " SyncAmsInfoDialog begin show";
if (show) {
if (m_two_image_panel) {
m_two_image_panel->SetBackgroundColor(wxGetApp().dark_mode() ? wxColour(48, 48, 48, 100) : wxColour(246, 246, 246, 100));
m_left_image_button->SetBackgroundColour(wxGetApp().dark_mode() ? wxColour(61, 61, 61, 0) : wxColour(238, 238, 238, 0));
m_right_image_button->SetBackgroundColour(wxGetApp().dark_mode() ? wxColour(61, 61, 61, 0) : wxColour(238, 238, 238, 0));
init_bitmaps();
}
if (m_options_other) { m_options_other->Hide(); }
if (m_refresh_timer) { m_refresh_timer->Start(LIST_REFRESH_INTERVAL); }
} else {
@ -541,11 +547,9 @@ void SyncAmsInfoDialog::add_two_image_control()
// m_two_thumbnail_panel->SetBackgroundColour(wxColour(0xF8F8F8));
m_two_image_panel->SetBorderWidth(0);
//m_two_image_panel->SetForegroundColour(wxColour(248, 248, 248, 100));
m_two_image_panel->SetBackgroundColor(wxGetApp().dark_mode() ? wxColour(48, 48, 48, 100) : wxColour(246, 246, 246, 100));
m_two_image_panel_sizer = new wxBoxSizer(wxHORIZONTAL);
m_left_image_button = new wxButton(m_two_image_panel, wxID_ANY, {}, wxDefaultPosition, wxSize(FromDIP(LEFT_THUMBNAIL_SIZE_WIDTH), FromDIP(LEFT_THUMBNAIL_SIZE_WIDTH)),
wxBORDER_NONE | wxBU_AUTODRAW);
m_left_image_button->SetBackgroundColour(wxGetApp().dark_mode() ? wxColour(61, 61, 61, 0) : wxColour(238, 238, 238, 0));
m_left_sizer_thumbnail = create_sizer_thumbnail(m_left_image_button, true);
m_two_image_panel_sizer->Add(m_left_sizer_thumbnail, FromDIP(0), wxALIGN_LEFT | wxEXPAND | wxLEFT | wxTOP | wxBOTTOM, FromDIP(8));
m_two_image_panel_sizer->AddSpacer(FromDIP(5));
@ -553,7 +557,6 @@ void SyncAmsInfoDialog::add_two_image_control()
m_right_image_button = new wxButton(m_two_image_panel, wxID_ANY, {}, wxDefaultPosition,
wxSize(FromDIP(RIGHT_THUMBNAIL_SIZE_WIDTH), FromDIP(RIGHT_THUMBNAIL_SIZE_WIDTH)),
wxBORDER_NONE | wxBU_AUTODRAW);
m_right_image_button->SetBackgroundColour(wxGetApp().dark_mode() ? wxColour(61, 61, 61, 0) : wxColour(238, 238, 238, 0));
m_right_image_button->SetToolTip(_L("If the transparency of the mapping changes, this thumbnail is for reference only."));
m_right_sizer_thumbnail = create_sizer_thumbnail(m_right_image_button, false);
m_two_image_panel_sizer->Add(m_right_sizer_thumbnail, FromDIP(0), wxALIGN_LEFT | wxEXPAND | wxRIGHT | wxTOP | wxBOTTOM, FromDIP(8));