From ea8f299f6dfcd66f4e0c0807e6bec466d184dd8f Mon Sep 17 00:00:00 2001 From: "chunmao.guo" Date: Mon, 28 Aug 2023 17:00:02 +0800 Subject: [PATCH] FIX: [STUDIO-4199] Show group in unsaved param dialog Change-Id: Ibb3223fc46d31586c140cde31a8eabbb178d79a6 Jira: STUDIO-4199 --- src/slic3r/GUI/UnsavedChangesDialog.cpp | 36 ++++++++++++++++++------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/src/slic3r/GUI/UnsavedChangesDialog.cpp b/src/slic3r/GUI/UnsavedChangesDialog.cpp index 29d39e7c6..d615cdfb8 100644 --- a/src/slic3r/GUI/UnsavedChangesDialog.cpp +++ b/src/slic3r/GUI/UnsavedChangesDialog.cpp @@ -1495,15 +1495,33 @@ void UnsavedChangesDialog::update_list() for (auto g = 0; g < class_g_list[gname].size(); g++) { //first group - // if (g == 0) { - // auto citem_title = new wxStaticText(citem, wxID_ANY, gname, wxDefaultPosition, wxDefaultSize, 0); - // //citem_title->SetForegroundColour(GREY900); - // auto block_title = new wxWindow(citem, wxID_ANY, wxDefaultPosition, wxSize(0, 0)); + if (g == 0) { + auto panel_item = new wxWindow(m_scrolledWindow, -1, wxDefaultPosition, wxSize(-1, UNSAVE_CHANGE_DIALOG_ITEM_HEIGHT)); + panel_item->SetBackgroundColour(GREY200); - // - // sizer_citem->Add(block_title, 0, wxEXPAND | wxLEFT, 20); - // sizer_citem->Add(citem_title, 0, wxALL, (list_item_height - citem_title->GetSize().GetHeight()) / 2); - //} + wxBoxSizer *sizer_item = new wxBoxSizer(wxHORIZONTAL); + + auto panel_left = new wxPanel(panel_item, wxID_ANY, wxDefaultPosition, wxSize(UNSAVE_CHANGE_DIALOG_FIRST_VALUE_WIDTH, -1), wxTAB_TRAVERSAL); + panel_left->SetBackgroundColour(GREY200); + + wxBoxSizer *sizer_left_v = new wxBoxSizer(wxVERTICAL); + + auto text_left = new wxStaticText(panel_left, wxID_ANY, gname, wxDefaultPosition, wxSize(-1, -1), 0); + text_left->SetFont(::Label::Head_13); + text_left->Wrap(-1); + text_left->SetForegroundColour(GREY700); + text_left->SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_INFOTEXT)); + + sizer_left_v->Add(text_left, 0, wxLEFT, 37); + + panel_left->SetSizer(sizer_left_v); + panel_left->Layout(); + sizer_item->Add(panel_left, 0, wxALIGN_CENTER, 0); + + panel_item->SetSizer(sizer_item); + panel_item->Layout(); + m_listsizer->Add(panel_item, 0, wxEXPAND, 0); + } auto data = class_g_list[gname][g]; @@ -1523,7 +1541,7 @@ void UnsavedChangesDialog::update_list() text_left->SetForegroundColour(GREY700); text_left->SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_INFOTEXT)); - sizer_left_v->Add(text_left, 0, wxLEFT, 37 ); + sizer_left_v->Add(text_left, 0, wxLEFT, 51 ); panel_left->SetSizer(sizer_left_v); panel_left->Layout();