Skip to content

Qt: Preserve game list column widths across relayouts - #14878

Open
mariobob wants to merge 1 commit into
PCSX2:masterfrom
mariobob:qt-persist-game-list-column-widths
Open

Qt: Preserve game list column widths across relayouts#14878
mariobob wants to merge 1 commit into
PCSX2:masterfrom
mariobob:qt-persist-game-list-column-widths

Conversation

@mariobob

Copy link
Copy Markdown

Resolves #14746

Description of Changes

This change keeps the width a column currently has whenever that column has a fixed default, and lets only the stretch columns take up the slack.

Rationale behind Changes

GameListWidget::resizeTableViewColumnsToFit() rebuilt the whole header from the hardcoded DEFAULT_COLUMN_WIDTHS table on every call. QtUtils::ResizeColumnsForView() walks each visible column and calls setColumnWidth() on it, so every column with a fixed default was pinned straight back to that default and only the stretch columns absorbed the leftover viewport width.

Suggested Testing Steps

  1. Drag a header divider on a fixed-width column in the game list table view (Serial, Time Played, Last Played, Size, Region or Compatibility).
  2. Close PCSX2 and reopen it. The column keeps the width you set (previously it snapped back to its default).
  3. Resize the main window. Fixed columns keep their widths and Title continues to absorb the slack.
  4. Switch to grid view and back to list view, and toggle in and out of a game (both of which route through resizeTableViewColumnsToFit()). Widths should be stable across all of it.
  5. Right-click the header and use "Reset All Columns": this should still restore the stock layout, since that path deliberately writes the defaults before fitting.
  6. Delete the HeaderState line from [GameListTableView] in PCSX2.ini and start fresh: this confirms first-launch defaults still fill the window correctly.

Did you use AI to help find, test, or implement this issue or feature?

No, I intentionally chose an issue that seems easy to fix to avoid writing code with LLM on my first contribution.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for submitting a contribution to PCSX2

As this is your first pull request, please be aware of the contributing guidelines.

Additionally, as per recent changes in GitHub Actions, your pull request will need to be approved by a maintainer before GitHub Actions can run against it. You can find more information about this change here.

Please be patient until this happens. In the meantime if you'd like to confirm the builds are passing, you have the option of opening a PR on your own fork, just make sure your fork's master branch is up to date!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: Table header dividers reset every launch

2 participants