From 70a9dfedc5622f88fab128305c77ed5bb96a2afa Mon Sep 17 00:00:00 2001 From: "liz.li" Date: Fri, 24 Nov 2023 17:29:42 +0800 Subject: [PATCH] FIX: adjust bed shape dialog button UI style fix that button text is hard to see in dark mode jira: STUDIO-5247 Change-Id: I2cf5b3cdd2eff9b821bdf5525bec4f329fc58dd1 --- src/slic3r/GUI/BedShapeDialog.cpp | 32 +++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/src/slic3r/GUI/BedShapeDialog.cpp b/src/slic3r/GUI/BedShapeDialog.cpp index 2ed563058..68a4f0d3c 100644 --- a/src/slic3r/GUI/BedShapeDialog.cpp +++ b/src/slic3r/GUI/BedShapeDialog.cpp @@ -285,7 +285,16 @@ wxPanel *BedShapePanel::init_texture_panel() Line line{"", ""}; line.full_width = 1; line.widget = [this](wxWindow *parent) { - wxButton *load_btn = new wxButton(parent, wxID_ANY, _L("Load...")); + StateColor btn_bg_white(std::pair(wxColour(206, 206, 206), StateColor::Disabled), std::pair(wxColour(206, 206, 206), StateColor::Pressed), + std::pair(wxColour(206, 206, 206), StateColor::Hovered), + std::pair(*wxWHITE, StateColor::Normal)); + + StateColor btn_bd_white(std::pair(*wxWHITE, StateColor::Disabled), std::pair(wxColour(38, 46, 48), StateColor::Enabled)); + + Button* load_btn = new Button(parent, _L("Load...")); + load_btn->SetBackgroundColor(btn_bg_white); + load_btn->SetBorderColor(btn_bd_white); + load_btn->SetBackgroundColour(*wxWHITE); load_btn->Enable(m_can_edit); wxSizer * load_sizer = new wxBoxSizer(wxHORIZONTAL); load_sizer->Add(load_btn, 1, wxEXPAND); @@ -295,7 +304,10 @@ wxPanel *BedShapePanel::init_texture_panel() wxSizer *filename_sizer = new wxBoxSizer(wxHORIZONTAL); filename_sizer->Add(filename_lbl, 1, wxEXPAND); - wxButton *remove_btn = new wxButton(parent, wxID_ANY, _L("Remove")); + Button* remove_btn = new Button(parent, _L("Remove")); + remove_btn->SetBackgroundColor(btn_bg_white); + remove_btn->SetBorderColor(btn_bd_white); + remove_btn->SetBackgroundColour(*wxWHITE); wxSizer * remove_sizer = new wxBoxSizer(wxHORIZONTAL); remove_sizer->Add(remove_btn, 1, wxEXPAND); @@ -355,7 +367,16 @@ wxPanel *BedShapePanel::init_model_panel() Line line{"", ""}; line.full_width = 1; line.widget = [this](wxWindow *parent) { - wxButton *load_btn = new wxButton(parent, wxID_ANY, _L("Load...")); + StateColor btn_bg_white(std::pair(wxColour(206, 206, 206), StateColor::Disabled), std::pair(wxColour(206, 206, 206), StateColor::Pressed), + std::pair(wxColour(206, 206, 206), StateColor::Hovered), + std::pair(*wxWHITE, StateColor::Normal)); + + StateColor btn_bd_white(std::pair(*wxWHITE, StateColor::Disabled), std::pair(wxColour(38, 46, 48), StateColor::Enabled)); + + Button* load_btn = new Button(parent, _L("Load...")); + load_btn->SetBackgroundColor(btn_bg_white); + load_btn->SetBorderColor(btn_bd_white); + load_btn->SetBackgroundColour(*wxWHITE); load_btn->Enable(m_can_edit); wxSizer * load_sizer = new wxBoxSizer(wxHORIZONTAL); load_sizer->Add(load_btn, 1, wxEXPAND); @@ -364,7 +385,10 @@ wxPanel *BedShapePanel::init_model_panel() wxSizer * filename_sizer = new wxBoxSizer(wxHORIZONTAL); filename_sizer->Add(filename_lbl, 1, wxEXPAND); - wxButton *remove_btn = new wxButton(parent, wxID_ANY, _L("Remove")); + Button* remove_btn = new Button(parent, _L("Remove")); + remove_btn->SetBackgroundColor(btn_bg_white); + remove_btn->SetBorderColor(btn_bd_white); + remove_btn->SetBackgroundColour(*wxWHITE); wxSizer * remove_sizer = new wxBoxSizer(wxHORIZONTAL); remove_sizer->Add(remove_btn, 1, wxEXPAND);