diff --git a/pcsx2/gui/Debugger/DebuggerLists.cpp b/pcsx2/gui/Debugger/DebuggerLists.cpp index 6528d7f8e4..67c0eef405 100644 --- a/pcsx2/gui/Debugger/DebuggerLists.cpp +++ b/pcsx2/gui/Debugger/DebuggerLists.cpp @@ -30,7 +30,9 @@ END_EVENT_TABLE() GenericListView::GenericListView(wxWindow* parent, GenericListViewColumn* columns, int columnCount) : wxListView(parent,wxID_ANY,wxDefaultPosition,wxDefaultSize,wxLC_VIRTUAL|wxLC_REPORT|wxLC_SINGLE_SEL|wxNO_BORDER) { - insertColumns(columns,columnCount); + m_isInResizeColumn = false; + + insertColumns(columns, columnCount); } void GenericListView::insertColumns(GenericListViewColumn* columns, int count) @@ -49,11 +51,22 @@ void GenericListView::insertColumns(GenericListViewColumn* columns, int count) this->columns = columns; } +void GenericListView::resizeColumn(int col, int width) +{ + if (!m_isInResizeColumn) { + m_isInResizeColumn = true; + + SetColumnWidth(col, width); + + m_isInResizeColumn = false; + } +} + void GenericListView::resizeColumns(int totalWidth) { for (int i = 0; i < GetColumnCount(); i++) { - SetColumnWidth(i,totalWidth*columns[i].size); + resizeColumn(i, totalWidth * columns[i].size); } } diff --git a/pcsx2/gui/Debugger/DebuggerLists.h b/pcsx2/gui/Debugger/DebuggerLists.h index 0036c2e609..7f0d1efa10 100644 --- a/pcsx2/gui/Debugger/DebuggerLists.h +++ b/pcsx2/gui/Debugger/DebuggerLists.h @@ -47,8 +47,19 @@ protected: virtual void onDoubleClick(int itemIndex, const wxPoint& point) { }; virtual void onRightClick(int itemIndex, const wxPoint& point) { }; virtual void onKeyDown(int key) { }; + + // This flag prevents resizing loop in the resizeColumn method of this class + // when the Windows Classic theme with some large resolutions around larger + // than 1024 x 768 have been chosen. + // + // The resizing loop will occur by the ListView_SetColumnWidth macro in the + // Windows SDK called by the wxListCtrl::SetColumnWidth method when the + // conditions above have been chosen. + bool m_isInResizeColumn; + private: void insertColumns(GenericListViewColumn* columns, int count); + void resizeColumn(int col, int width); void resizeColumns(int totalWidth); wxString OnGetItemText(long item, long col) const;