From d513914dd34d6559e6c2defbcf702830b390cfc5 Mon Sep 17 00:00:00 2001 From: "chunmao.guo" Date: Mon, 7 Apr 2025 12:16:20 +0800 Subject: [PATCH] FIX: DropDown hover item tip Change-Id: Ie3d9e654cd612b2db983c3410d7d8d0224200a8d Github: 6380 (cherry picked from commit e6e093949d39fa208c4afaa3f2bc97e3b518ac21) --- src/slic3r/GUI/PresetComboBoxes.cpp | 3 ++- src/slic3r/GUI/Widgets/DropDown.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/PresetComboBoxes.cpp b/src/slic3r/GUI/PresetComboBoxes.cpp index f88eb9ddab..40114c6035 100644 --- a/src/slic3r/GUI/PresetComboBoxes.cpp +++ b/src/slic3r/GUI/PresetComboBoxes.cpp @@ -1419,7 +1419,8 @@ void TabPresetComboBox::update() assert(bmp); const wxString name = get_preset_name(preset); - preset_descriptions.emplace(name, from_u8(preset.description)); + if (preset.is_system) + preset_descriptions.emplace(name, from_u8(preset.description)); if (preset.is_default || preset.is_system) { //BBS: move system to the end diff --git a/src/slic3r/GUI/Widgets/DropDown.cpp b/src/slic3r/GUI/Widgets/DropDown.cpp index adddb0c621..07b3604c96 100644 --- a/src/slic3r/GUI/Widgets/DropDown.cpp +++ b/src/slic3r/GUI/Widgets/DropDown.cpp @@ -298,6 +298,7 @@ void DropDown::render(wxDC &dc) if (item.group != group) continue; } + bool is_hover = index == hover_item; ++index; if (rcContent.GetBottom() < 0) { rcContent.y += rowSize.y; @@ -326,7 +327,7 @@ void DropDown::render(wxDC &dc) if (!text_off && !text.IsEmpty()) { wxSize tSize = dc.GetMultiLineTextExtent(text); if (pt.x + tSize.x > rcContent.GetRight()) { - if (index == hover_item && item.tip.IsEmpty()) + if (is_hover && item.tip.IsEmpty()) SetToolTip(text); text = wxControl::Ellipsize(text, dc, wxELLIPSIZE_END, rcContent.GetRight() - pt.x);