FIX: dark mode in filament group pop up

1.Also modify some tips

jira: NONE

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: I4e2abfe24afdf7f0d728a486aa248b8e5accbdf4
(cherry picked from commit 98dad923f8ee3001add10837a9b0a6c1507b47e0)
This commit is contained in:
xun.zhang
2025-03-13 11:12:53 +08:00
committed by Noisyfox
parent 9cdabfbd59
commit 5880625b9c
5 changed files with 27 additions and 18 deletions

View File

@@ -46,6 +46,14 @@ static void set_prefered_map_mode(FilamentMapMode mode)
app_config->set("prefered_filament_map_mode", mode_str);
}
void FilamentGroupPopup::CreateBmps()
{
checked_bmp = create_scaled_bitmap("map_mode_on", nullptr, 16);;
unchecked_bmp = create_scaled_bitmap("map_mode_off", nullptr, 16);
disabled_bmp = create_scaled_bitmap("map_mode_disabled", nullptr, 16);
checked_hover_bmp = create_scaled_bitmap("map_mode_on_hovered", nullptr, 16);
unchecked_hover_bmp = create_scaled_bitmap("map_mode_off_hovered", nullptr, 16);
}
FilamentGroupPopup::FilamentGroupPopup(wxWindow *parent) : PopupWindow(parent, wxBORDER_NONE | wxPU_CONTAINS_CONTROLS)
{
@@ -81,12 +89,7 @@ FilamentGroupPopup::FilamentGroupPopup(wxWindow *parent) : PopupWindow(parent, w
std::vector<wxString> mode_details = {AutoForFlushDetail, AutoForMatchDetail, ManualDetail};
top_sizer->AddSpacer(vertical_margin);
checked_bmp = create_scaled_bitmap("map_mode_on", nullptr, 16);;
unchecked_bmp = create_scaled_bitmap("map_mode_off", nullptr, 16);
disabled_bmp = create_scaled_bitmap("map_mode_disabled", nullptr, 16);
checked_hover_bmp = create_scaled_bitmap("map_mode_on_hovered", nullptr, 16);
unchecked_hover_bmp = create_scaled_bitmap("map_mode_off_hovered", nullptr, 16);
global_tag_bmp = create_scaled_bitmap("global_map_mode_tag", nullptr, 16);
CreateBmps();
for (size_t idx = 0; idx < ButtonType::btCount; ++idx) {
wxBoxSizer *button_sizer = new wxBoxSizer(wxHORIZONTAL);
@@ -190,10 +193,15 @@ void FilamentGroupPopup::DrawRoundedCorner(int radius)
void FilamentGroupPopup::Init()
{
static bool is_dark_mode = wxGetApp().dark_mode();
if (is_dark_mode != wxGetApp().dark_mode()) {
CreateBmps();
is_dark_mode = wxGetApp().dark_mode();
}
const wxString AutoForMatchDesp = "";// _L("(Pre-slicing arrangement)");
const wxString MachineSyncTip = _L("(Sync with printer)");
radio_btns[ButtonType::btForMatch]->Enable(m_connected);
if (m_connected) {
button_labels[ButtonType::btForMatch]->SetForegroundColour(LabelEnableColor);
button_desps[ButtonType::btForMatch]->SetForegroundColour(LabelEnableColor);
@@ -319,7 +327,6 @@ void FilamentGroupPopup::OnEnterWindow(wxMouseEvent &) { ResetTimer(); }
void FilamentGroupPopup::UpdateButtonStatus(int hover_idx)
{
auto global_mode = plater_ref->get_global_filament_map_mode();
for (int i = 0; i < ButtonType::btCount; ++i) {
#if 0 // do not display global mode tag
if (mode_list.at(i) == global_mode)