pcsx2 gui: use pxGetFixedFont helper instead of wxFont constructor

This commit is contained in:
Gregory Hainaut 2016-11-09 00:28:14 +01:00
parent d64db65743
commit 4ee942aba2
9 changed files with 14 additions and 31 deletions

View File

@ -800,7 +800,7 @@ extern int pxGetCharHeight(const wxWindow &wind, int rows = 1);
extern void pxSetToolTip(wxWindow *wind, const wxString &src);
extern void pxSetToolTip(wxWindow &wind, const wxString &src);
extern wxFont pxGetFixedFont(int ptsize = 8, wxFontWeight weight = wxFONTWEIGHT_NORMAL);
extern wxFont pxGetFixedFont(int ptsize = 8, wxFontWeight weight = wxFONTWEIGHT_NORMAL, bool underline = false);
extern pxDialogCreationFlags pxDialogFlags();

View File

@ -601,10 +601,10 @@ void pxSetToolTip(wxWindow &wind, const wxString &src)
}
wxFont pxGetFixedFont(int ptsize, wxFontWeight weight)
wxFont pxGetFixedFont(int ptsize, wxFontWeight weight, bool underline)
{
return wxFont(
ptsize, wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, weight, false
ptsize, wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, weight, underline
#ifdef __WXMSW__
,
L"Lucida Console" // better than courier new (win32 only)

View File

@ -158,9 +158,6 @@ void ConsoleLogFrame::ColorArray::SetFont( int fontsize )
const wxFont fixed( pxGetFixedFont( fontsize ) );
const wxFont fixedB( pxGetFixedFont( fontsize+1, wxFONTWEIGHT_BOLD ) );
//const wxFont fixed( fontsize, wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL );
//const wxFont fixedB( fontsize, wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD );
// Standard R, G, B format:
for (size_t i = 0; i < Color_StrongBlack; ++i)
m_table[i].SetFont(fixed);

View File

@ -472,18 +472,13 @@ void CtrlDisassemblyView::render(wxDC& dc)
if (!cpu->isAlive())
return;
#ifdef _WIN32
wxFont font = wxFont(wxSize(charWidth,rowHeight-2),wxFONTFAMILY_DEFAULT,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false,L"Lucida Console");
wxFont boldFont = wxFont(wxSize(charWidth,rowHeight-2),wxFONTFAMILY_DEFAULT,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,L"Lucida Console");
#else
wxFont font = wxFont(8,wxFONTFAMILY_DEFAULT,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false,L"Lucida Console");
wxFont font = pxGetFixedFont(8);
wxFont boldFont = pxGetFixedFont(8, wxFONTWEIGHT_BOLD);
font.SetPixelSize(wxSize(charWidth,rowHeight-2));
wxFont boldFont = wxFont(8,wxFONTFAMILY_DEFAULT,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,L"Lucida Console");
boldFont.SetPixelSize(wxSize(charWidth,rowHeight-2));
#endif
bool hasFocus = wxWindow::FindFocus() == this;
std::map<u32,int> addressPositions;
unsigned int address = windowStart;

View File

@ -76,15 +76,10 @@ CtrlMemView::CtrlMemView(wxWindow* parent, DebugInterface* _cpu)
setRowSize(16);
#ifdef _WIN32
font = wxFont(wxSize(charWidth,rowHeight),wxFONTFAMILY_DEFAULT,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false,L"Lucida Console");
underlineFont = wxFont(wxSize(charWidth,rowHeight),wxFONTFAMILY_DEFAULT,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,true,L"Lucida Console");
#else
font = wxFont(8,wxFONTFAMILY_DEFAULT,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false,L"Lucida Console");
font = pxGetFixedFont(8);
underlineFont = pxGetFixedFont(8, wxFONTWEIGHT_NORMAL, true);
font.SetPixelSize(wxSize(charWidth,rowHeight));
underlineFont = wxFont(8,wxFONTFAMILY_DEFAULT,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,true,L"Lucida Console");
underlineFont.SetPixelSize(wxSize(charWidth,rowHeight));
#endif
menu.Append(ID_MEMVIEW_GOTOINDISASM, L"Go to in Disasm");
menu.Append(ID_MEMVIEW_COPYADDRESS, L"Copy address");

View File

@ -196,14 +196,10 @@ void drawU32Text(wxDC& dc, u32 value, int x, int y)
void CtrlRegisterList::OnDraw(wxDC& dc)
{
#ifdef _WIN32
wxFont font = wxFont(wxSize(charWidth,rowHeight-2),wxFONTFAMILY_DEFAULT,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false,L"Lucida Console");
#else
wxFont font = wxFont(8,wxFONTFAMILY_DEFAULT,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false,L"Lucida Console");
wxFont font = pxGetFixedFont(8);
font.SetPixelSize(wxSize(charWidth,rowHeight-2));
#endif
dc.SetFont(font);
refreshChangedRegs();
wxColor colorChanged = wxColor(0xFF0000FF);

View File

@ -443,7 +443,7 @@ GSFrame::GSFrame( const wxString& title)
wxStaticText* label = new wxStaticText( this, wxID_ANY, _("GS Output is Disabled!") );
m_id_OutputDisabled = label->GetId();
label->SetFont( wxFont( 20, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD ) );
label->SetFont( pxGetFixedFont( 20, wxFONTWEIGHT_BOLD ) );
label->SetForegroundColour( *wxWHITE );
AppStatusEvent_OnSettingsApplied();

View File

@ -105,9 +105,9 @@ Panels::BiosSelectorPanel::BiosSelectorPanel( wxWindow* parent )
_("Select folder with PS2 BIOS roms") // dir picker popup label
);
m_ComboBox->SetFont( wxFont( m_ComboBox->GetFont().GetPointSize()+1, wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, L"Lucida Console" ) );
m_ComboBox->SetFont( pxGetFixedFont( m_ComboBox->GetFont().GetPointSize()+1 ) );
m_ComboBox->SetMinSize( wxSize( wxDefaultCoord, std::max( m_ComboBox->GetMinSize().GetHeight(), 96 ) ) );
//if (InstallationMode != InstallMode_Portable)
m_FolderPicker->SetStaticDesc( _("Click the Browse button to select a different folder where PCSX2 will look for PS2 BIOS roms.") );

View File

@ -39,7 +39,7 @@ Panels::ThemeSelectorPanel::ThemeSelectorPanel( wxWindow* parent )
_("Select folder containing PCSX2 visual themes") // dir picker popup label
);
m_ComboBox->SetFont( wxFont( m_ComboBox->GetFont().GetPointSize()+1, wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, L"Lucida Console" ) );
m_ComboBox->SetFont( pxGetFixedFont( m_ComboBox->GetFont().GetPointSize()+1 ) );
m_ComboBox->SetMinSize( wxSize( wxDefaultCoord, std::max( m_ComboBox->GetMinSize().GetHeight(), 96 ) ) );
if (InstallationMode != InstallMode_Portable)