mirror of https://github.com/PCSX2/pcsx2.git
debugger:windows: Fix vanishing breakpoints when scrollbar disappears
On Windows, it seems that if you resize the columns in the size event handler when the scrollbar disappears, the listview contents may decide to disappear as well. So let's avoid the resize for this case.
This commit is contained in:
parent
90af611fdb
commit
ad652706d6
|
@ -31,6 +31,7 @@ GenericListView::GenericListView(wxWindow* parent, GenericListViewColumn* column
|
|||
: wxListView(parent,wxID_ANY,wxDefaultPosition,wxDefaultSize,wxLC_VIRTUAL|wxLC_REPORT|wxLC_SINGLE_SEL|wxNO_BORDER)
|
||||
{
|
||||
m_isInResizeColumn = false;
|
||||
dontResizeColumnsInSizeEventHandler = false;
|
||||
|
||||
insertColumns(columns, columnCount);
|
||||
}
|
||||
|
@ -72,7 +73,12 @@ void GenericListView::resizeColumns(int totalWidth)
|
|||
|
||||
void GenericListView::sizeEvent(wxSizeEvent& evt)
|
||||
{
|
||||
resizeColumns(GetClientSize().x);
|
||||
// HACK: On Windows, it seems that if you resize the columns in the size
|
||||
// event handler when the scrollbar disappears, the listview contents may
|
||||
// decide to disappear as well. So let's avoid the resize for this case.
|
||||
if (!dontResizeColumnsInSizeEventHandler)
|
||||
resizeColumns(GetClientSize().x);
|
||||
dontResizeColumnsInSizeEventHandler = false;
|
||||
evt.Skip();
|
||||
}
|
||||
|
||||
|
@ -110,7 +116,7 @@ void GenericListView::update()
|
|||
// make the scrollbar go away, so let's make it recalculate if it needs it
|
||||
SetItemCount(newRows);
|
||||
}
|
||||
|
||||
dontResizeColumnsInSizeEventHandler = true;
|
||||
Refresh();
|
||||
}
|
||||
|
||||
|
|
|
@ -65,6 +65,7 @@ private:
|
|||
|
||||
GenericListViewColumn* columns;
|
||||
wxPoint clickPos;
|
||||
bool dontResizeColumnsInSizeEventHandler;
|
||||
};
|
||||
|
||||
class BreakpointList: public GenericListView
|
||||
|
|
Loading…
Reference in New Issue