From c7890c638d2d47e639f764654d8d68afa6b65de3 Mon Sep 17 00:00:00 2001 From: "xin.zhang" Date: Wed, 14 May 2025 19:37:04 +0800 Subject: [PATCH] ENH: update the style jira: [STUDIO-12184] Change-Id: Ic6b6feceb80db157a33e6c6287a4a4faeef4036c (cherry picked from commit 977f054f7f842a9ea95b5f2f6602d22e62d320a4) --- src/slic3r/GUI/Widgets/DropDown.cpp | 39 ++++++++++++----------------- 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/src/slic3r/GUI/Widgets/DropDown.cpp b/src/slic3r/GUI/Widgets/DropDown.cpp index d7fb536ff7..623497735a 100644 --- a/src/slic3r/GUI/Widgets/DropDown.cpp +++ b/src/slic3r/GUI/Widgets/DropDown.cpp @@ -203,19 +203,18 @@ static void _DrawSplitItem(const wxWindow* w, wxDC& dc, wxString split_text, wxP // save dc auto pre_clr = dc.GetTextForeground(); auto pre_pen = dc.GetPen(); - dc.SetTextForeground(wxColour(144, 144, 144)); - dc.SetPen(wxColour(144, 144, 144)); - + dc.SetTextForeground(wxColour(172, 172, 172));//GRAY 500 + dc.SetPen(wxColour(166, 169, 170));//GRAY 400 // miner font auto font = w->GetFont(); - font.SetPointSize(font.GetPointSize() - 1); + font.SetPointSize(font.GetPointSize() - 3); dc.SetFont(font); int spacing = w->FromDIP(8); - int line_y = start_pt.y + (item_height) / 2; - if (!split_text.empty())// Paiting: spacing + line + spacing + text + spacing + line + spacing + + if (!split_text.empty())// Paiting: text + spacing + line + spacing { - int max_content_width = item_width - start_pt.x - 4 * spacing; + int max_content_width = item_width - start_pt.x - 2 * spacing; wxSize tSize = dc.GetMultiLineTextExtent(split_text); if (tSize.x > max_content_width) { @@ -223,21 +222,18 @@ static void _DrawSplitItem(const wxWindow* w, wxDC& dc, wxString split_text, wxP tSize = dc.GetMultiLineTextExtent(split_text); } - int line_width = (item_width - start_pt.x - tSize.x - 4 * spacing) / 2; - dc.DrawLine(start_pt.x + spacing, line_y, start_pt.x + line_width + spacing, line_y);// draw left line - dc.DrawLine(start_pt.x + tSize.x + line_width + 3 * spacing, line_y, start_pt.x + tSize.x + 2 * line_width + 3 * spacing, line_y);// draw right line - - start_pt.x += (line_width + 2 * spacing); - start_pt.y += (item_height - tSize.y) / 2; - dc.SetFont(font); dc.DrawText(split_text, start_pt); + + int line_width = item_width - start_pt.x - tSize.x - 2 * spacing; + int line_y = start_pt.y + (tSize.GetHeight() / 2); + dc.DrawLine(start_pt.x + tSize.x + spacing, line_y, start_pt.x + tSize.x + line_width + spacing, line_y);// draw right line } - else// Paiting: spacing + line + spacing + else// Paiting: line + spacing { - int line_y = start_pt.y + (item_height) / 2; - int line_width = item_width - start_pt.x - 2 * spacing; - dc.DrawLine(start_pt.x + spacing, line_y, start_pt.x + spacing + line_width, line_y);// draw line + int line_y = start_pt.y + (item_height / 2); + int line_width = item_width - start_pt.x - spacing; + dc.DrawLine(start_pt.x, line_y, start_pt.x + line_width, line_y);// draw line } // restore dc @@ -371,11 +367,8 @@ void DropDown::render(wxDC &dc) wxPoint pt = rcContent.GetLeftTop(); if (item.style & DD_ITEM_STYLE_SPLIT_ITEM) { - wxPoint start_pt = {0 , pt.y}; - int item_width = GetSize().GetWidth(); - int item_height = rowSize.GetHeight(); - _DrawSplitItem(this, dc, item.text, start_pt, item_width, item_height); - rcContent.y += item_height; + _DrawSplitItem(this, dc, item.text, pt, rowSize.GetWidth(), rowSize.GetHeight()); + rcContent.y += rowSize.GetHeight(); continue; }