ValveSoftware / Source-1-Games

Source 1 based games such as TF2 and Counter-Strike: Source
660 stars 76 forks source link

[TF2] Feature Request: Allow all columns in the server browser to have variable width #5942

Open dandongus opened 7 months ago

dandongus commented 7 months ago

In 2024, many of us play on 4K monitors or HiDPI monitors and often like to increase font sizes to make small text more readable.

Unfortunately, some of the fixed-width columns in the server browser such as the Player Count column pose a bit of an annoyance when doing this, as text is easily cut off as seen in the image below:

image

This is not a problem with any of the variable width columns such as the Server Name, Game, or Map columns, as even if text gets cut off, one can simply drag to resize the columns and make them wider.

Looking at serverbrowser/BaseGamesPage.cpp, it can be seen that the Players and Latency columns, for example, have a fixed width of 55 pixels, with no way for a player to change that.

    m_pGameList->AddColumnHeader( k_nColumn_Name, "Name", "#ServerBrowser_Servers", 50, ListPanel::COLUMN_RESIZEWITHWINDOW | ListPanel::COLUMN_UNHIDABLE);
    m_pGameList->AddColumnHeader( k_nColumn_IPAddr, "IPAddr", "#ServerBrowser_IPAddress", 64, ListPanel::COLUMN_HIDDEN);
    m_pGameList->AddColumnHeader( k_nColumn_GameDesc, "GameDesc", "#ServerBrowser_Game", 112,
        112,    // minwidth
        300,    // maxwidth
        0       // flags
        );
    m_pGameList->AddColumnHeader( k_nColumn_Players, "Players", "#ServerBrowser_Players", 55, ListPanel::COLUMN_FIXEDSIZE);
    m_pGameList->AddColumnHeader( k_nColumn_Bots, "Bots", "#ServerBrowser_Bots", 40, ListPanel::COLUMN_FIXEDSIZE);
    m_pGameList->AddColumnHeader( k_nColumn_Map, "Map", "#ServerBrowser_Map", 90, 
        90,     // minwidth
        300,    // maxwidth
        0       // flags
        );
    m_pGameList->AddColumnHeader( k_nColumn_Ping, "Ping", "#ServerBrowser_Latency", 55, ListPanel::COLUMN_FIXEDSIZE);

55 pixels for these may have been appropriate a decade or two ago, but with the higher PPI monitors of today I feel that this width is too narrow.

I propose changing some of these fixed width columns to be variable width, allowing for the player to resize them as they already can with the Server Name, Game, and Map columns. Additionally (and this may be too much to ask), it would be wonderful if the min, max, and default widths could be moved into HUD files and read from there, instead of being hardcoded.

Thespikedballofdoom commented 7 months ago

It would be nice if the columns actually saved their sizes too, for some reason they don't even though the window size saves.