Introduce GUI_App::code_font()

This commit is contained in:
Yuri D'Elia 2020-09-13 02:17:19 +02:00
parent ad20e369fa
commit ba7f39afee
2 changed files with 8 additions and 0 deletions

View file

@ -869,6 +869,11 @@ void GUI_App::init_fonts()
m_small_font.SetPointSize(11);
m_bold_font.SetPointSize(13);
#endif /*__WXMAC__*/
// wxSYS_OEM_FIXED_FONT and wxSYS_ANSI_FIXED_FONT use the same as
// DEFAULT in wxGtk. Use the TELETYPE family as a work-around
m_code_font = wxFont(wxFontInfo().Family(wxFONTFAMILY_TELETYPE));
m_code_font.SetPointSize(m_normal_font.GetPointSize());
}
void GUI_App::update_fonts(const MainFrame *main_frame)
@ -884,6 +889,7 @@ void GUI_App::update_fonts(const MainFrame *main_frame)
m_small_font = m_normal_font;
m_bold_font = main_frame->normal_font().Bold();
m_em_unit = main_frame->em_unit();
m_code_font.SetPointSize(m_normal_font.GetPointSize());
}
void GUI_App::set_label_clr_modified(const wxColour& clr) {

View file

@ -118,6 +118,7 @@ private:
wxFont m_small_font;
wxFont m_bold_font;
wxFont m_normal_font;
wxFont m_code_font;
int m_em_unit; // width of a "m"-symbol in pixels for current system font
// Note: for 100% Scale m_em_unit = 10 -> it's a good enough coefficient for a size setting of controls
@ -177,6 +178,7 @@ public:
const wxFont& small_font() { return m_small_font; }
const wxFont& bold_font() { return m_bold_font; }
const wxFont& normal_font() { return m_normal_font; }
const wxFont& code_font() { return m_code_font; }
int em_unit() const { return m_em_unit; }
wxSize get_min_size() const;
float toolbar_icon_scale(const bool is_limited = false) const;