mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibGUI: Increase row height in Table/ColumnViews and center icons
16x16 icons are now guaranteed at least 1px margins between rows
This commit is contained in:
committed by
Andreas Kling
parent
2871df6f0d
commit
af581cbd91
Notes:
sideshowbarker
2024-07-18 21:43:01 +09:00
Author: https://github.com/thankyouverycool Commit: https://github.com/SerenityOS/serenity/commit/af581cbd911 Pull-request: https://github.com/SerenityOS/serenity/pull/5636
@@ -87,7 +87,7 @@ void AbstractTableView::update_column_sizes()
|
||||
auto cell_data = model.index(row, column).data();
|
||||
int cell_width = 0;
|
||||
if (cell_data.is_icon()) {
|
||||
cell_width = row_height();
|
||||
cell_width = cell_data.as_icon().bitmap_for_size(16)->width();
|
||||
} else if (cell_data.is_bitmap()) {
|
||||
cell_width = cell_data.as_bitmap().width();
|
||||
} else if (cell_data.is_valid()) {
|
||||
@@ -399,7 +399,7 @@ int AbstractTableView::horizontal_padding() const
|
||||
|
||||
int AbstractTableView::row_height() const
|
||||
{
|
||||
return font().glyph_height() + 6;
|
||||
return font().glyph_height() + icon_padding();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user