DavidoTek / ProtonUp-Qt

Install and manage GE-Proton, Luxtorpeda & more for Steam and Wine-GE & more for Lutris with this graphical user interface.
https://davidotek.github.io/protonup-qt
GNU General Public License v3.0
1.25k stars 40 forks source link

Add a Refresh Button to the Game List and Compat Tool Info dialog #215

Closed DavidoTek closed 1 year ago

DavidoTek commented 1 year ago

With https://github.com/DavidoTek/ProtonUp-Qt/pull/211 and https://github.com/DavidoTek/ProtonUp-Qt/pull/214, caching of games has been enabled to increase the load times of the dialogs. This comes with the limitation that external changes are not registered, even when re-opening the game list or ctinfo dialogs.

This PR adds a refresh button to both the game list and the ctinfo dialog that updates the cached games and rebuilds the list of displayed games.

sonic2kk commented 1 year ago

Just being nosy here: This uses a QToolButton on the Games List dialog but a QPushButton on the Info dialog (the search button is also a QPushButton on the info dialog). Is that intentional? The QToolButton has a slightly different size than the QPushButton, and is more square, which might be intentional. Plus, "tool button" sounds more logical for this sort of action, I probably should've used that in #210 but it didn't even cross my mind :sweat_smile:

QToolButton: image

QPushButton: image

For the QPushButton change I had to set the focusPolicy in QtDesigner to NoFocus, otherwise the refresh button was the default selected widget.

Absolutely not a big deal, I am just curious :-)

DavidoTek commented 1 year ago

Just being nosy

Quite the reverse, good hint!

I noticed the different but wanted to use a Tool Button because as far as I know it is used for this kind of stuff (it has some different implementation with QAction, but more important, is designed for an icon instead of text). On the other hand, it makes the refresh button to look the same as the search button in the ct info dialog and I didn't think of changing the other button too :)

I probably should change the type, so all icon buttons use QToolButton.

EDIT: Complete rethink. Using QPushButton as it is larger (SteamDeck...) and has a more uniform look :smile:

DavidoTek commented 1 year ago

For the QPushButton change I had to set the focusPolicy in QtDesigner to NoFocus

One thing I haven't considered when merging the last PRs is that setting the focusPolicy to NoFocus will prevent controller support from working properly as the D-Pad simulates tab presses...

otherwise the refresh button was the default selected widget.

I think that can be prevented by changing the tab order.


I will look into that and provide a PR.