Skip to content

Commit

Permalink
Don't let sort arrows overlap column title
Browse files Browse the repository at this point in the history
When the sort arrow is visible on a column, its minimum width
needs to take that extra space in consideration or else,
when resizing it the sort arrow can/will overlap the column title.
  • Loading branch information
bellini666 committed Jun 2, 2015
1 parent 2c049e8 commit e1cde24
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion datagrid_gtk3/ui/grid.py
Expand Up @@ -1175,14 +1175,19 @@ def _setup_columns(self):
col.set_resizable(True)
# Set the minimum width for the column based on the width
# of the label and some padding
col.set_min_width(self._get_pango_string_width(lbl) + 14)
width = self._get_pango_string_width(lbl) + 14
col.set_fixed_width(
self._get_best_column_width(column_index, samples))
col.set_sizing(Gtk.TreeViewColumnSizing.FIXED)
col.set_expand(column['expand'])
if item == self.active_sort_column:
# When the column is expanded, leave a little more
# space for the sort indicator
width += self._get_pango_string_width(
u" \u25BC".encode('utf-8'))
col.set_sort_indicator(True)
col.set_sort_order(self.active_sort_column_order)
col.set_min_width(width)
self.append_column(col)

self.set_headers_clickable(True)
Expand Down

0 comments on commit e1cde24

Please sign in to comment.