ENH:ubuntu dark mode disply optimization

GITHUB: #4943
Change-Id: Ic8c6cf64c801e6c95e3f7e9e6959ed1a369ed3a3
(cherry picked from commit e723c87d8c41c195e980e11051f7beded9420d2a)
This commit is contained in:
MackBambu 2024-11-29 20:31:48 +08:00 committed by lane.wei
parent a1037509ae
commit 05c4e9d183
3 changed files with 20 additions and 1 deletions

View File

@ -3237,6 +3237,9 @@ void GUI_App::init_label_colours()
m_color_hovered_btn_label = is_dark_mode ? wxColour(255, 255, 254) : wxColour(0,0,0); m_color_hovered_btn_label = is_dark_mode ? wxColour(255, 255, 254) : wxColour(0,0,0);
m_color_default_btn_label = is_dark_mode ? wxColour(255, 255, 254): wxColour(0,0,0); m_color_default_btn_label = is_dark_mode ? wxColour(255, 255, 254): wxColour(0,0,0);
m_color_selected_btn_bg = is_dark_mode ? wxColour(84, 84, 91) : wxColour(206, 206, 206); m_color_selected_btn_bg = is_dark_mode ? wxColour(84, 84, 91) : wxColour(206, 206, 206);
#elif __linux__
// ubuntu dark mode issue. https://github.com/bambulab/BambuStudio/issues/4943
m_color_label_default = is_dark_mode ? wxColour(250, 250, 250) : m_color_label_sys;
#else #else
m_color_label_default = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT); m_color_label_default = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT);
#endif #endif

View File

@ -95,6 +95,10 @@ ObjectList::ObjectList(wxWindow* parent) :
wxDataViewCtrl(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxDV_MULTIPLE) wxDataViewCtrl(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxDV_MULTIPLE)
{ {
wxGetApp().UpdateDVCDarkUI(this, true); wxGetApp().UpdateDVCDarkUI(this, true);
#ifdef __linux__
// ubuntu dark mode issue. https://github.com/bambulab/BambuStudio/issues/4943
this->SetForegroundColour(*wxBLACK);
#endif
SetFont(Label::sysFont(13)); SetFont(Label::sysFont(13));
#ifdef __WXMSW__ #ifdef __WXMSW__
GenericGetHeader()->SetFont(Label::sysFont(13)); GenericGetHeader()->SetFont(Label::sysFont(13));

View File

@ -1538,7 +1538,13 @@ void UnsavedChangesDialog::update_list()
auto text_left = new wxStaticText(panel_left, wxID_ANY, gname, wxDefaultPosition, wxSize(-1, -1), 0); auto text_left = new wxStaticText(panel_left, wxID_ANY, gname, wxDefaultPosition, wxSize(-1, -1), 0);
text_left->SetFont(::Label::Head_13); text_left->SetFont(::Label::Head_13);
text_left->Wrap(-1); text_left->Wrap(-1);
#ifdef __linux__
// ubuntu dark mode issue. https://github.com/bambulab/BambuStudio/issues/4943
text_left->SetForegroundColour(wxGetApp().dark_mode() ? *wxLIGHT_GREY : GREY700);
#else
text_left->SetForegroundColour(GREY700); text_left->SetForegroundColour(GREY700);
text_left->SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_INFOTEXT));
#endif
sizer_left_v->Add(text_left, 0, wxLEFT, 37); sizer_left_v->Add(text_left, 0, wxLEFT, 37);
@ -1566,7 +1572,13 @@ void UnsavedChangesDialog::update_list()
auto text_left = new wxStaticText(panel_left, wxID_ANY, data.option_name, wxDefaultPosition, wxSize(-1, -1), 0); auto text_left = new wxStaticText(panel_left, wxID_ANY, data.option_name, wxDefaultPosition, wxSize(-1, -1), 0);
text_left->SetFont(::Label::Body_13); text_left->SetFont(::Label::Body_13);
text_left->Wrap(-1); text_left->Wrap(-1);
#ifdef __linux__
// ubuntu dark mode issue. https://github.com/bambulab/BambuStudio/issues/4943
text_left->SetForegroundColour(wxGetApp().dark_mode() ? *wxLIGHT_GREY : GREY700);
#else
text_left->SetForegroundColour(GREY700); text_left->SetForegroundColour(GREY700);
text_left->SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_INFOTEXT));
#endif
sizer_left_v->Add(text_left, 0, wxLEFT, 51 ); sizer_left_v->Add(text_left, 0, wxLEFT, 51 );