mirror of
https://github.com/cemu-project/Cemu.git
synced 2024-11-22 09:09:18 +01:00
Gamelist: Add option to hide the icon column (#604)
This commit is contained in:
parent
4b7d2f88ae
commit
fa4ad9b8c1
@ -84,6 +84,8 @@ void CemuConfig::Load(XMLConfigParser& parser)
|
||||
game_list_style = gamelist.get("style", 0);
|
||||
game_list_column_order = gamelist.get("order", "");
|
||||
|
||||
show_icon_column = parser.get("show_icon_column", true);
|
||||
|
||||
// return default width if value in config file out of range
|
||||
auto loadColumnSize = [&gamelist] (const char *name, uint32 defaultWidth)
|
||||
{
|
||||
@ -385,6 +387,7 @@ void CemuConfig::Save(XMLConfigParser& parser)
|
||||
psize.set<sint32>("x", pad_size.x);
|
||||
psize.set<sint32>("y", pad_size.y);
|
||||
config.set<bool>("pad_maximized", pad_maximized);
|
||||
config.set<bool>("show_icon_column" , show_icon_column);
|
||||
|
||||
auto gamelist = config.set("GameList");
|
||||
gamelist.set("style", game_list_style);
|
||||
|
@ -418,6 +418,8 @@ struct CemuConfig
|
||||
ConfigValue<bool> did_show_graphic_pack_download{false};
|
||||
ConfigValue<bool> did_show_macos_disclaimer{false};
|
||||
|
||||
ConfigValue<bool> show_icon_column{ false };
|
||||
|
||||
int game_list_style = 0;
|
||||
std::string game_list_column_order;
|
||||
struct
|
||||
|
@ -88,7 +88,10 @@ wxGameList::wxGameList(wxWindow* parent, wxWindowID id)
|
||||
const auto& config = GetConfig();
|
||||
|
||||
InsertColumn(ColumnHiddenName, "", wxLIST_FORMAT_LEFT, 0);
|
||||
InsertColumn(ColumnIcon, "", wxLIST_FORMAT_LEFT, kListIconWidth);
|
||||
if(config.show_icon_column)
|
||||
InsertColumn(ColumnIcon, _("Icon"), wxLIST_FORMAT_LEFT, kListIconWidth);
|
||||
else
|
||||
InsertColumn(ColumnIcon, _("Icon"), wxLIST_FORMAT_LEFT, 0);
|
||||
InsertColumn(ColumnName, _("Game"), wxLIST_FORMAT_LEFT, config.column_width.name);
|
||||
InsertColumn(ColumnVersion, _("Version"), wxLIST_FORMAT_RIGHT, config.column_width.version);
|
||||
InsertColumn(ColumnDLC, _("DLC"), wxLIST_FORMAT_RIGHT, config.column_width.dlc);
|
||||
@ -794,6 +797,7 @@ void wxGameList::OnColumnRightClick(wxListEvent& event)
|
||||
ResetWidth = wxID_HIGHEST + 1,
|
||||
ResetOrder,
|
||||
|
||||
ShowIcon,
|
||||
ShowName,
|
||||
ShowVersion,
|
||||
ShowDlc,
|
||||
@ -810,6 +814,7 @@ void wxGameList::OnColumnRightClick(wxListEvent& event)
|
||||
menu.Append(ResetOrder, _("Reset &order")) ;
|
||||
|
||||
menu.AppendSeparator();
|
||||
menu.AppendCheckItem(ShowIcon, _("Show &icon"))->Check(GetColumnWidth(ColumnIcon) > 0);
|
||||
menu.AppendCheckItem(ShowName, _("Show &name"))->Check(GetColumnWidth(ColumnName) > 0);
|
||||
menu.AppendCheckItem(ShowVersion, _("Show &version"))->Check(GetColumnWidth(ColumnVersion) > 0);
|
||||
menu.AppendCheckItem(ShowDlc, _("Show &dlc"))->Check(GetColumnWidth(ColumnDLC) > 0);
|
||||
@ -828,6 +833,9 @@ void wxGameList::OnColumnRightClick(wxListEvent& event)
|
||||
|
||||
switch (event.GetId())
|
||||
{
|
||||
case ShowIcon:
|
||||
config.show_icon_column = menu->IsChecked(ShowIcon);
|
||||
break;
|
||||
case ShowName:
|
||||
config.column_width.name = menu->IsChecked(ShowName) ? DefaultColumnSize::name : 0;
|
||||
break;
|
||||
@ -907,7 +915,10 @@ void wxGameList::ApplyGameListColumnWidths()
|
||||
{
|
||||
const auto& config = GetConfig();
|
||||
wxWindowUpdateLocker lock(this);
|
||||
if(config.show_icon_column)
|
||||
SetColumnWidth(ColumnIcon, kListIconWidth);
|
||||
else
|
||||
SetColumnWidth(ColumnIcon, 0);
|
||||
SetColumnWidth(ColumnName, config.column_width.name);
|
||||
SetColumnWidth(ColumnVersion, config.column_width.version);
|
||||
SetColumnWidth(ColumnDLC, config.column_width.dlc);
|
||||
|
Loading…
Reference in New Issue
Block a user