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:
Andreas Kling 2020-10-24 16:17:26 +02:00
parent 8961148cdf
commit 688675e89b
Notes: sideshowbarker 2024-07-19 01:45:57 +09:00
5 changed files with 18 additions and 24 deletions

View file

@ -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;
}
}