diff --git a/src/gui/components/wxGameList.cpp b/src/gui/components/wxGameList.cpp index 35f7dfd1..25ec35f4 100644 --- a/src/gui/components/wxGameList.cpp +++ b/src/gui/components/wxGameList.cpp @@ -243,7 +243,8 @@ void wxGameList::SetStyle(Style style, bool save) g_config.Save(); } - ApplyGameListColumnWidths(); + if (style == Style::kList) + ApplyGameListColumnWidths(); } long wxGameList::GetStyleFlags(Style style) const diff --git a/src/gui/debugger/SymbolCtrl.cpp b/src/gui/debugger/SymbolCtrl.cpp index 394c64f4..d9adaa32 100644 --- a/src/gui/debugger/SymbolCtrl.cpp +++ b/src/gui/debugger/SymbolCtrl.cpp @@ -73,7 +73,8 @@ void SymbolListCtrl::OnGameLoaded() rplSymbolStorage_unlockSymbolMap(); SetItemCount(m_data.size()); - RefreshItems(GetTopItem(), GetTopItem() + GetCountPerPage() + 1); + if (m_data.size() > 0) + RefreshItems(GetTopItem(), std::min(m_data.size() - 1, GetTopItem() + GetCountPerPage() + 1)); } wxString SymbolListCtrl::OnGetItemText(long item, long column) const @@ -159,5 +160,6 @@ void SymbolListCtrl::ChangeListFilter(std::string filter) } } SetItemCount(visible_entries); - RefreshItems(GetTopItem(), GetTopItem() + GetCountPerPage() + 1); + if (visible_entries > 0) + RefreshItems(GetTopItem(), std::min(visible_entries - 1, GetTopItem() + GetCountPerPage() + 1)); } \ No newline at end of file diff --git a/src/gui/windows/TextureRelationViewer/TextureRelationWindow.cpp b/src/gui/windows/TextureRelationViewer/TextureRelationWindow.cpp index 8d5c02a1..5a42691e 100644 --- a/src/gui/windows/TextureRelationViewer/TextureRelationWindow.cpp +++ b/src/gui/windows/TextureRelationViewer/TextureRelationWindow.cpp @@ -372,7 +372,9 @@ void TextureRelationViewerWindow::RefreshTextureList() } } textureRelationListA->Thaw(); - textureRelationListA->EnsureVisible(scrollPos + textureRelationListA->GetCountPerPage() - 1); + long itemCount = textureRelationListA->GetItemCount(); + if (itemCount > 0) + textureRelationListA->EnsureVisible(std::min(itemCount - 1, scrollPos + textureRelationListA->GetCountPerPage() - 1)); } void TextureRelationViewerWindow::OnTextureListRightClick(wxMouseEvent& event) @@ -383,4 +385,4 @@ void TextureRelationViewerWindow::OnTextureListRightClick(wxMouseEvent& event) void TextureRelationViewerWindow::Close() { this->Destroy(); -} \ No newline at end of file +}