From d8f3e22f14efc7863d3885116d142e67f2d4e819 Mon Sep 17 00:00:00 2001 From: Kingcom Date: Sat, 23 Aug 2014 13:21:16 +0200 Subject: [PATCH] Fix column width in debugger lists when scrollbars are present --- pcsx2/gui/Debugger/DebuggerLists.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/pcsx2/gui/Debugger/DebuggerLists.cpp b/pcsx2/gui/Debugger/DebuggerLists.cpp index 29ca5637d0..21e6531e88 100644 --- a/pcsx2/gui/Debugger/DebuggerLists.cpp +++ b/pcsx2/gui/Debugger/DebuggerLists.cpp @@ -59,7 +59,7 @@ void GenericListView::resizeColumns(int totalWidth) void GenericListView::sizeEvent(wxSizeEvent& evt) { - resizeColumns(evt.GetSize().x); + resizeColumns(GetClientSize().x); } void GenericListView::keydownEvent(wxKeyEvent& evt) @@ -87,7 +87,20 @@ void GenericListView::keydownEvent(wxKeyEvent& evt) void GenericListView::update() { int newRows = getRowCount(); + int oldRows = GetItemCount(); + SetItemCount(newRows); + + if (newRows != oldRows) + { + resizeColumns(GetClientSize().x); + + // wx adds the horizontal scrollbar based on the old column width, + // which changes the client width. Simply resizing the columns won't + // make the scrollbar go away, so let's make it recalculate if it needs it + SetItemCount(newRows); + } + Refresh(); }