mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:37:35 +00:00
LibGUI: Programatically draw table header sorting arrows
These arrows were previously drawn using the code points U+2B06 and U+2B07. The .png files for these emoji were removed in commitbfe99eb
and added to the Katica Regular 10 font in commitcf62d08
. The emoji were not added to the bold Katica variants that are used by the table header view. The effect is that a "?" replacement character was rendered. Instead of rendering the emoji, we can draw the arrows programatically, like we do in other GUI components (e.g. the scrollbar).
This commit is contained in:
parent
e746360b9a
commit
32642394a9
4 changed files with 32 additions and 17 deletions
|
@ -644,7 +644,7 @@ void TreeView::auto_resize_column(int column)
|
|||
|
||||
int header_width = column_header().font().width(model.column_name(column));
|
||||
if (column == m_key_column && model.is_column_sortable(column))
|
||||
header_width += font().width(" \xE2\xAC\x86"sv);
|
||||
header_width += HeaderView::sorting_arrow_width + HeaderView::sorting_arrow_offset;
|
||||
int column_width = header_width;
|
||||
|
||||
bool is_empty = true;
|
||||
|
@ -689,7 +689,7 @@ void TreeView::update_column_sizes()
|
|||
continue;
|
||||
int header_width = column_header().font().width(model.column_name(column));
|
||||
if (column == m_key_column && model.is_column_sortable(column))
|
||||
header_width += font().width(" \xE2\xAC\x86"sv);
|
||||
header_width += HeaderView::sorting_arrow_width + HeaderView::sorting_arrow_offset;
|
||||
int column_width = header_width;
|
||||
traverse_in_paint_order([&](ModelIndex const& index, Gfx::IntRect const&, Gfx::IntRect const&, int) {
|
||||
auto cell_data = model.index(index.row(), column, index.parent()).data();
|
||||
|
@ -710,7 +710,7 @@ void TreeView::update_column_sizes()
|
|||
|
||||
int tree_column_header_width = column_header().font().width(model.column_name(tree_column));
|
||||
if (tree_column == m_key_column && model.is_column_sortable(tree_column))
|
||||
tree_column_header_width += font().width(" \xE2\xAC\x86"sv);
|
||||
tree_column_header_width += HeaderView::sorting_arrow_width + HeaderView::sorting_arrow_offset;
|
||||
int tree_column_width = tree_column_header_width;
|
||||
traverse_in_paint_order([&](ModelIndex const& index, Gfx::IntRect const&, Gfx::IntRect const&, int indent_level) {
|
||||
auto cell_data = model.index(index.row(), tree_column, index.parent()).data();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue