mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-08 07:27:41 -06:00
FIX: [STUDIO-3374] DropDown only show tooltip for ellipsize text
Change-Id: I719df15ff5f6601ecbadfb3f483c4a48a90523f4
This commit is contained in:
parent
63029c628a
commit
ff45fc536a
2 changed files with 4 additions and 2 deletions
|
@ -300,6 +300,8 @@ void DropDown::render(wxDC &dc)
|
|||
if (!text_off && !text.IsEmpty()) {
|
||||
wxSize tSize = dc.GetMultiLineTextExtent(text);
|
||||
if (pt.x + tSize.x > rcContent.GetRight()) {
|
||||
if (i == hover_item)
|
||||
SetToolTip(text);
|
||||
text = wxControl::Ellipsize(text, dc, wxELLIPSIZE_END,
|
||||
rcContent.GetRight() - pt.x);
|
||||
}
|
||||
|
@ -444,8 +446,7 @@ void DropDown::mouseMove(wxMouseEvent &event)
|
|||
if (hover >= (int) texts.size()) hover = -1;
|
||||
if (hover == hover_item) return;
|
||||
hover_item = hover;
|
||||
if (hover >= 0)
|
||||
SetToolTip(texts[hover]);
|
||||
SetToolTip("");
|
||||
}
|
||||
paintNow();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue