mirror of
https://github.com/RGBCube/serenity
synced 2025-07-10 07:07:36 +00:00
Userland+Base: Make the window titlebar font configurable separately
Instead of defaulting to "bold variant of the system default font", let's allow the user to set any font they want as the titlebar font.
This commit is contained in:
parent
419e986dcc
commit
548081ea23
20 changed files with 107 additions and 21 deletions
|
@ -25,8 +25,13 @@ FontDatabase& FontDatabase::the()
|
|||
|
||||
static RefPtr<Font> s_default_font;
|
||||
static String s_default_font_query;
|
||||
|
||||
static RefPtr<Font> s_window_title_font;
|
||||
static String s_window_title_font_query;
|
||||
|
||||
static RefPtr<Font> s_fixed_width_font;
|
||||
static String s_fixed_width_font_query;
|
||||
|
||||
static String s_default_fonts_lookup_path = "/res/fonts";
|
||||
|
||||
void FontDatabase::set_default_font_query(String query)
|
||||
|
@ -42,6 +47,19 @@ String FontDatabase::default_font_query()
|
|||
return s_default_font_query;
|
||||
}
|
||||
|
||||
void FontDatabase::set_window_title_font_query(String query)
|
||||
{
|
||||
if (s_window_title_font_query == query)
|
||||
return;
|
||||
s_window_title_font_query = move(query);
|
||||
s_window_title_font = nullptr;
|
||||
}
|
||||
|
||||
String FontDatabase::window_title_font_query()
|
||||
{
|
||||
return s_window_title_font_query;
|
||||
}
|
||||
|
||||
void FontDatabase::set_default_fonts_lookup_path(String path)
|
||||
{
|
||||
if (s_default_fonts_lookup_path == path)
|
||||
|
@ -64,6 +82,16 @@ Font& FontDatabase::default_font()
|
|||
return *s_default_font;
|
||||
}
|
||||
|
||||
Font& FontDatabase::window_title_font()
|
||||
{
|
||||
if (!s_window_title_font) {
|
||||
VERIFY(!s_window_title_font_query.is_empty());
|
||||
s_window_title_font = FontDatabase::the().get_by_name(s_window_title_font_query);
|
||||
VERIFY(s_window_title_font);
|
||||
}
|
||||
return *s_window_title_font;
|
||||
}
|
||||
|
||||
void FontDatabase::set_fixed_width_font_query(String query)
|
||||
{
|
||||
if (s_fixed_width_font_query == query)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue