mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 01:57:44 +00:00
Base: Add Csilla Bold 7x10 variant.
It's nice to have a thin and a bold variant to complement each other.
This commit is contained in:
parent
0776c51bf5
commit
b5e5f26a82
4 changed files with 11 additions and 1 deletions
BIN
Base/res/fonts/CsillaBold7x10.font
Normal file
BIN
Base/res/fonts/CsillaBold7x10.font
Normal file
Binary file not shown.
|
@ -147,6 +147,7 @@ void GTableView::paint_event(GPaintEvent& event)
|
||||||
auto column_metadata = m_model->column_metadata(column_index);
|
auto column_metadata = m_model->column_metadata(column_index);
|
||||||
int column_width = column_metadata.preferred_width;
|
int column_width = column_metadata.preferred_width;
|
||||||
Rect cell_rect(x_offset, 0, column_width + horizontal_padding() * 2, item_height());
|
Rect cell_rect(x_offset, 0, column_width + horizontal_padding() * 2, item_height());
|
||||||
|
painter.set_font(Font::default_bold_font());
|
||||||
painter.draw_text(cell_rect.translated(horizontal_padding(), 0), m_model->column_name(column_index), TextAlignment::CenterLeft, Color::Black);
|
painter.draw_text(cell_rect.translated(horizontal_padding(), 0), m_model->column_name(column_index), TextAlignment::CenterLeft, Color::Black);
|
||||||
x_offset += column_width + horizontal_padding() * 2;
|
x_offset += column_width + horizontal_padding() * 2;
|
||||||
painter.draw_line(cell_rect.top_left(), cell_rect.bottom_left(), Color::White);
|
painter.draw_line(cell_rect.top_left(), cell_rect.bottom_left(), Color::White);
|
||||||
|
|
|
@ -33,7 +33,7 @@ Font& Font::default_font()
|
||||||
|
|
||||||
Font& Font::default_bold_font()
|
Font& Font::default_bold_font()
|
||||||
{
|
{
|
||||||
static const char* default_bold_font_path = "/res/fonts/LizaBold8x10.font";
|
static const char* default_bold_font_path = "/res/fonts/CsillaBold7x10.font";
|
||||||
if (!s_default_bold_font) {
|
if (!s_default_bold_font) {
|
||||||
s_default_bold_font = Font::load_from_file(default_bold_font_path).leak_ref();
|
s_default_bold_font = Font::load_from_file(default_bold_font_path).leak_ref();
|
||||||
ASSERT(s_default_bold_font);
|
ASSERT(s_default_bold_font);
|
||||||
|
|
|
@ -422,7 +422,10 @@ void WSWindowManager::paint_window_frame(WSWindow& window)
|
||||||
m_back_painter->draw_rect(border_rect, middle_border_color);
|
m_back_painter->draw_rect(border_rect, middle_border_color);
|
||||||
m_back_painter->draw_rect(outer_rect, border_color);
|
m_back_painter->draw_rect(outer_rect, border_color);
|
||||||
m_back_painter->draw_rect(inner_border_rect, border_color);
|
m_back_painter->draw_rect(inner_border_rect, border_color);
|
||||||
|
|
||||||
|
m_back_painter->set_font(Font::default_bold_font());
|
||||||
m_back_painter->draw_text(titlebar_title_rect, window.title(), TextAlignment::CenterLeft, title_color);
|
m_back_painter->draw_text(titlebar_title_rect, window.title(), TextAlignment::CenterLeft, title_color);
|
||||||
|
m_back_painter->set_font(font());
|
||||||
|
|
||||||
if (!s_close_button_bitmap)
|
if (!s_close_button_bitmap)
|
||||||
s_close_button_bitmap = &CharacterBitmap::create_from_ascii(s_close_button_bitmap_data, s_close_button_bitmap_width, s_close_button_bitmap_height).leak_ref();
|
s_close_button_bitmap = &CharacterBitmap::create_from_ascii(s_close_button_bitmap_data, s_close_button_bitmap_width, s_close_button_bitmap_height).leak_ref();
|
||||||
|
@ -912,13 +915,19 @@ void WSWindowManager::draw_menubar()
|
||||||
{
|
{
|
||||||
m_back_painter->fill_rect(menubar_rect(), Color::LightGray);
|
m_back_painter->fill_rect(menubar_rect(), Color::LightGray);
|
||||||
m_back_painter->draw_line({ 0, menubar_rect().bottom() }, { menubar_rect().right(), menubar_rect().bottom() }, Color::White);
|
m_back_painter->draw_line({ 0, menubar_rect().bottom() }, { menubar_rect().right(), menubar_rect().bottom() }, Color::White);
|
||||||
|
int index = 0;
|
||||||
for_each_active_menubar_menu([&] (WSMenu& menu) {
|
for_each_active_menubar_menu([&] (WSMenu& menu) {
|
||||||
Color text_color = Color::Black;
|
Color text_color = Color::Black;
|
||||||
if (&menu == current_menu()) {
|
if (&menu == current_menu()) {
|
||||||
m_back_painter->fill_rect(menu.rect_in_menubar(), menu_selection_color());
|
m_back_painter->fill_rect(menu.rect_in_menubar(), menu_selection_color());
|
||||||
text_color = Color::White;
|
text_color = Color::White;
|
||||||
}
|
}
|
||||||
|
if (index == 1)
|
||||||
|
m_back_painter->set_font(Font::default_bold_font());
|
||||||
m_back_painter->draw_text(menu.text_rect_in_menubar(), menu.name(), TextAlignment::CenterLeft, text_color);
|
m_back_painter->draw_text(menu.text_rect_in_menubar(), menu.name(), TextAlignment::CenterLeft, text_color);
|
||||||
|
if (index == 1)
|
||||||
|
m_back_painter->set_font(font());
|
||||||
|
++index;
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue