Skip to content

Qt: Add Custom background support#12722

Merged
F0bes merged 6 commits intoPCSX2:masterfrom
kamfretoz:qt-background
Sep 21, 2025
Merged

Qt: Add Custom background support#12722
F0bes merged 6 commits intoPCSX2:masterfrom
kamfretoz:qt-background

Conversation

@kamfretoz
Copy link
Contributor

@kamfretoz kamfretoz commented May 26, 2025

Description of Changes

This PR adds the ability to set custom background on the game list.

Preview:
Screenshot_20250526_204507
Screenshot_20250526_204651
image
image
Screenshot_20250526_204732

Setting Preview:
image

Rationale behind Changes

Nice eye-candy and more customizations

Suggested Testing Steps

To set a custom image: View -> Set Custom Background See the Settings -> Interface section.

Things to test:

  • Applying custom background
  • Removing custom background

Known issues so far:

  • The background doesn't get cleared automatically when clearing the custom background
  • Unreadable text when using bright backgrounds

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

Nuh-uh

@lightningterror lightningterror added this to the Release 2.6 milestone May 26, 2025
@RedDevilus
Copy link
Contributor

In future we could add a customisable dark filter on top for easier reading gamelist itself in as a sort of pseudo dropshadow that movie subtitles would do.

The current form limits the usecase to less viable screenshots.

But it's good for now to add some more personality (or make people crazy with meme images)

@kamfretoz
Copy link
Contributor Author

Yeah i do hope to add some kind of brightness/opacity option (or drop shadow for texts if viable) and cropping mode in the future.

@AmandaRoseChaqueta
Copy link

AmandaRoseChaqueta commented May 26, 2025

Works quiet well! (Arch linux based distro)

Screenshot_20250526_113148
image

@chaoticgd
Copy link
Member

chaoticgd commented May 26, 2025

I remember I previously said this could be implemented by subclassing QStackedWidget and overriding the paint event. I think I may have been overthinking that, what you're doing is probably fine (edit: actually, the palette approach does have issues, see below).

A few things I noticed:

  • The option to clear the background image currently doesn't work for me. It looks like it's because of an incorrect if (path.empty()) check right at the start of GameListWidget::setCustomBackground.
  • The background is currently being drawn by the viewport widgets inside the QTableView and GameListGridListView widgets rather than the QStackedWidget itself (verified with GammaRay) since the palette is inherited. This means that the space for the image is ever so slightly different depending on which one is visible (hence with the table view the bottom of the image is getting cut off slightly as it's offset by the header).

@kamfretoz
Copy link
Contributor Author

A few things I noticed:

  • The option to clear the background image currently doesn't work for me. It looks like it's because of an incorrect if (path.empty()) check right at the start of GameListWidget::setCustomBackground.

Whoops you were right, that check was too aggressive. I'll fix it later.

  • The background is currently being drawn by the viewport widgets inside the QTableView and GameListGridListView widgets rather than the QStackedWidget itself (verified with GammaRay) since the palette is inherited.

I'm not sure how to reach the QStackWidget itself. I did use the setPallete on the m_ui.stack but apparently its not correct?

@chaoticgd
Copy link
Member

chaoticgd commented May 27, 2025

I'm not sure how to reach the QStackWidget itself. I did use the setPallete on the m_ui.stack but apparently its not correct?

I've done some testing and I can't seem to get it to work with the palette method either, I'm not sure why. I think subclassing QStackedWidget and drawing the pixmap in the paintEvent function should still work though. Just make sure to use drawTiledPixmap and pass in the invalidated region. You'll need to disable autoFillBackground on the viewports (e.g. QTableView::viewport).

@kamfretoz kamfretoz force-pushed the qt-background branch 3 times, most recently from 4827654 to ae136d7 Compare May 31, 2025 04:09
@AmandaRoseChaqueta
Copy link

AmandaRoseChaqueta commented Jun 2, 2025

I wonder if it could be possible to add support for animated webps (in a future PR). It would be quiet nice to have! Gif works too but gif is yucky

@kamfretoz
Copy link
Contributor Author

I wonder if it could be possible to add support for animated webps (in a future PR).

I don't think Qt can do that.

@KrossX
Copy link
Contributor

KrossX commented Jun 4, 2025

What if you decode the frames manually then update the background every few ms from a worker thread? 🤔

@kamfretoz kamfretoz force-pushed the qt-background branch 2 times, most recently from 169b712 to dd3311a Compare June 5, 2025 14:27
@kamfretoz
Copy link
Contributor Author

Animated WEBP and GIF now works!

2025-06-08.14-51-36.mp4

@AmandaRoseChaqueta
Copy link

Animated WEBP and GIF now works!

2025-06-08.14-51-36.mp4

NO WAY :0, I will test that later this day!

@kamfretoz kamfretoz force-pushed the qt-background branch 2 times, most recently from a6b0a8c to 9307c0b Compare June 8, 2025 14:26
@AmandaRoseChaqueta
Copy link

AmandaRoseChaqueta commented Jun 8, 2025

It works! Opacity also works and the "clear background" button works as well. (testing on linux)

Screenshot_20250608_120609
Screenshot_20250608_120551-1
Screenshot_20250608_120551

@kamfretoz kamfretoz force-pushed the qt-background branch 4 times, most recently from 77d3499 to cf39fc9 Compare June 9, 2025 11:38
Copy link
Member

@chaoticgd chaoticgd left a comment

Choose a reason for hiding this comment

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

All good now. I've reviewed everything except the dependencies.

@kamfretoz kamfretoz force-pushed the qt-background branch 3 times, most recently from 589e646 to 8018fc4 Compare September 9, 2025 15:16
@kamfretoz
Copy link
Contributor Author

Latest update, the entire custom background settings have been moved to Settings -> Interface. also added an option to fill the custom image to the available background space.

2025-09-11.17-33-20.mp4

kamfretoz and others added 4 commits September 21, 2025 12:57
Qt: Make sure custom background aren't active when game list isn't shown

To save on CPU Power and be more efficient

Co-Authored-By: TheLastRar <TheLastRar@users.noreply.github.com>
Needed for animated WEBPs to work on Windows.

Co-Authored-By: TheLastRar <TheLastRar@users.noreply.github.com>
Co-Authored-By: TheLastRar <TheLastRar@users.noreply.github.com>
@F0bes
Copy link
Member

F0bes commented Sep 21, 2025

With these new changes, can I have testers retest?

Copy link
Contributor

@SternXD SternXD left a comment

Choose a reason for hiding this comment

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

pcsx2qtbackground.mp4

Works on my machine does what it's supposed to do.

Copy link
Contributor

@Mrlinkwii Mrlinkwii left a comment

Choose a reason for hiding this comment

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

Image Image

looks good

Copy link
Member

@JordanTheToaster JordanTheToaster left a comment

Choose a reason for hiding this comment

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

Still working and still cursed.

image

@SternXD
Copy link
Contributor

SternXD commented Sep 21, 2025

image

Also macOS just in case works good there too

Copy link
Member

@F0bes F0bes left a comment

Choose a reason for hiding this comment

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

LGTM. I tested on macOS.

@F0bes F0bes merged commit f47b55c into PCSX2:master Sep 21, 2025
12 checks passed
@xujibbs
Copy link
Contributor

xujibbs commented Sep 24, 2025

Supported Image Types (*.bmp *.gif *.jpg *.jpeg *.png *.webp) is untranslatable

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.