Fixed scroll the Object List to selected item on OSX & GTK

+ fixed #1395 (maximum PresetComboBox's width limit on Ubuntu)
This commit is contained in:
YuSanka 2018-12-14 09:52:54 +01:00
parent 2d29b7d6cd
commit 48a94ebae1
3 changed files with 4 additions and 8 deletions

View file

@ -1459,13 +1459,11 @@ void ObjectList::update_selections()
select_items(sels);
#ifdef __WXMSW__
if (GetSelection()) {
const int sel_item_row = GetRowByItem(GetSelection());
ScrollLines(sel_item_row - m_selected_row);
m_selected_row = sel_item_row;
const wxRect& top_rc = GetItemRect(GetTopItem());
const wxRect& sel_rc = GetItemRect(GetSelection());
ScrollLines(int((sel_rc.y - top_rc.y) / top_rc.GetHeight()) - 0.5*GetCountPerPage());
}
#endif //__WXMSW__
}
void ObjectList::update_selections_on_canvas()