Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DolphinWX: Disable 'maker' column hiding #3687

Merged
merged 1 commit into from
Apr 21, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 15 additions & 69 deletions Source/Core/DolphinWX/GameListCtrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1338,82 +1338,28 @@ void CGameListCtrl::AutomaticColumnWidth()
+ GetColumnWidth(COLUMN_SIZE)
+ GetColumnWidth(COLUMN_EMULATION_STATE));

// We hide the Maker column if the window is too small
// Use ShowColumn() instead of SetColumnWidth because
// the maker column may have been autohidden and the
// therefore the content needs to be restored.
if (resizable > 425)
if (SConfig::GetInstance().m_showMakerColumn &&
SConfig::GetInstance().m_showFileNameColumn)
{
if (SConfig::GetInstance().m_showMakerColumn &&
SConfig::GetInstance().m_showFileNameColumn)
{
SetColumnWidth(COLUMN_TITLE, resizable / 3);
ShowColumn(COLUMN_MAKER, resizable / 3);
SetColumnWidth(COLUMN_FILENAME, resizable / 3);
}
else if (SConfig::GetInstance().m_showMakerColumn)
{
SetColumnWidth(COLUMN_TITLE, resizable / 2);
ShowColumn(COLUMN_MAKER, resizable / 2);
}
else if (SConfig::GetInstance().m_showFileNameColumn)
{
SetColumnWidth(COLUMN_TITLE, resizable / 2);
SetColumnWidth(COLUMN_FILENAME, resizable / 2);
}
else
{
SetColumnWidth(COLUMN_TITLE, resizable);
}
SetColumnWidth(COLUMN_TITLE, resizable / 3);
SetColumnWidth(COLUMN_MAKER, resizable / 3);
SetColumnWidth(COLUMN_FILENAME, resizable / 3);
}
else
else if (SConfig::GetInstance().m_showMakerColumn)
{
if (SConfig::GetInstance().m_showFileNameColumn)
{
SetColumnWidth(COLUMN_TITLE, resizable / 2);
SetColumnWidth(COLUMN_FILENAME, resizable / 2);
}
else
{
SetColumnWidth(COLUMN_TITLE, resizable);
}
HideColumn(COLUMN_MAKER);
SetColumnWidth(COLUMN_TITLE, resizable / 2);
SetColumnWidth(COLUMN_MAKER, resizable / 2);
}
}
}

// Fills a previously hidden column with items. Acts
// as a SetColumnWidth if width is nonzero.
void CGameListCtrl::ShowColumn(int column, int width)
{
// Fill the column with items if it was hidden
if (GetColumnWidth(column) == 0)
{
for (int i = 0; i < GetItemCount(); i++)
else if (SConfig::GetInstance().m_showFileNameColumn)
{
UpdateItemAtColumn(i, column);
SetColumnWidth(COLUMN_TITLE, resizable / 2);
SetColumnWidth(COLUMN_FILENAME, resizable / 2);
}
else
{
SetColumnWidth(COLUMN_TITLE, resizable);
}
}
SetColumnWidth(column, width);
}

// Hide the passed column from the gamelist.
// It is not enough to set the width to zero because this leads to
// graphical glitches where the content of the hidden column is
// squeezed into the next column. Therefore we need to clear the
// items, too.
void CGameListCtrl::HideColumn(int column)
{
// Do nothing if the column is already hidden
if (GetColumnWidth(column) == 0)
return;

// Remove the items from the column
for (int i = 0; i < GetItemCount(); i++)
{
SetItem(i, column, "", -1);
}
SetColumnWidth(column, 0);
}

void CGameListCtrl::UnselectAll()
Expand Down
2 changes: 0 additions & 2 deletions Source/Core/DolphinWX/GameListCtrl.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ class CGameListCtrl : public wxListCtrl

void CompressSelection(bool _compress);
void AutomaticColumnWidth();
void ShowColumn(int column, int width);
void HideColumn(int column);
void UnselectAll();

static bool CompressCB(const std::string& text, float percent, void* arg);
Expand Down