I would like to reduce the height of rows in a TreeView below the default, but something is preventing me from getting the height to where I would like it to be. Here is my test program:
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('GLib', '2.0')
from gi.repository import Gtk, GLib
class Tester(Gtk.Window):
def __init__(self):
super().__init__()
model = Gtk.ListStore(str)
model.append(('hanging text, first value',))
model.append(('second value',))
model.append(('third value',))
cell = Gtk.CellRendererText()
cell.props.height = 19
cell.props.ypad = 0 # default value is 2
col = Gtk.TreeViewColumn()
col.pack_start(cell, True)
col.set_attributes(cell, text=0)
col.set_expand(True)
treeview = Gtk.TreeView()
treeview.set_model(model)
treeview.set_headers_visible(False)
treeview.append_column(col)
self.set_default_size(300, 400)
self.connect_after('destroy', self.on_destroy)
self.add(treeview)
self.show_all()
def on_destroy(self, obj):
loop.quit()
tester = Tester()
loop = GLib.MainLoop()
loop.run()
If I drop the height below 19, I lose the descender for the āgā, but there are still 4-5 pixels above the tallest letter. I tried fiddling with vertical alignment. I used the debugger to look for some css that might be relevant. Does anyone know how I can liberate that space?