mirror of
https://github.com/RGBCube/serenity
synced 2025-05-24 01:05:08 +00:00
LibGUI: Make table view row height+padding font-size-relative
This makes tables look a lot nicer with different-sized fonts. :^)
This commit is contained in:
parent
8961148cdf
commit
688675e89b
5 changed files with 18 additions and 24 deletions
|
@ -374,15 +374,6 @@ void AbstractTableView::layout_headers()
|
|||
}
|
||||
}
|
||||
|
||||
void AbstractTableView::set_row_height(int height)
|
||||
{
|
||||
if (m_row_height == height)
|
||||
return;
|
||||
|
||||
m_row_height = height;
|
||||
update_row_sizes();
|
||||
}
|
||||
|
||||
void AbstractTableView::keydown_event(KeyEvent& event)
|
||||
{
|
||||
if (is_tab_key_navigation_enabled()) {
|
||||
|
@ -401,4 +392,14 @@ void AbstractTableView::keydown_event(KeyEvent& event)
|
|||
AbstractView::keydown_event(event);
|
||||
}
|
||||
|
||||
int AbstractTableView::horizontal_padding() const
|
||||
{
|
||||
return font().glyph_height() / 2;
|
||||
}
|
||||
|
||||
int AbstractTableView::row_height() const
|
||||
{
|
||||
return font().glyph_height() + 6;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue