FIX: DropDown hover item tip
Change-Id: Ie3d9e654cd612b2db983c3410d7d8d0224200a8d Github: 6380
This commit is contained in:
parent
93325d7a20
commit
e6e093949d
|
@ -1447,7 +1447,8 @@ void TabPresetComboBox::update()
|
||||||
assert(bmp);
|
assert(bmp);
|
||||||
|
|
||||||
const wxString name = get_preset_name(preset);
|
const wxString name = get_preset_name(preset);
|
||||||
preset_descriptions.emplace(name, _L(preset.description));
|
if (preset.is_system)
|
||||||
|
preset_descriptions.emplace(name, _L(preset.description));
|
||||||
|
|
||||||
if (preset.is_default || preset.is_system) {
|
if (preset.is_default || preset.is_system) {
|
||||||
//BBS: move system to the end
|
//BBS: move system to the end
|
||||||
|
|
|
@ -298,6 +298,7 @@ void DropDown::render(wxDC &dc)
|
||||||
if (item.group != group)
|
if (item.group != group)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
bool is_hover = index == hover_item;
|
||||||
++index;
|
++index;
|
||||||
if (rcContent.GetBottom() < 0) {
|
if (rcContent.GetBottom() < 0) {
|
||||||
rcContent.y += rowSize.y;
|
rcContent.y += rowSize.y;
|
||||||
|
@ -326,7 +327,7 @@ void DropDown::render(wxDC &dc)
|
||||||
if (!text_off && !text.IsEmpty()) {
|
if (!text_off && !text.IsEmpty()) {
|
||||||
wxSize tSize = dc.GetMultiLineTextExtent(text);
|
wxSize tSize = dc.GetMultiLineTextExtent(text);
|
||||||
if (pt.x + tSize.x > rcContent.GetRight()) {
|
if (pt.x + tSize.x > rcContent.GetRight()) {
|
||||||
if (index == hover_item && item.tip.IsEmpty())
|
if (is_hover && item.tip.IsEmpty())
|
||||||
SetToolTip(text);
|
SetToolTip(text);
|
||||||
text = wxControl::Ellipsize(text, dc, wxELLIPSIZE_END,
|
text = wxControl::Ellipsize(text, dc, wxELLIPSIZE_END,
|
||||||
rcContent.GetRight() - pt.x);
|
rcContent.GetRight() - pt.x);
|
||||||
|
|
Loading…
Reference in New Issue