Switches to a label to make points take fixed-width

This commit is contained in:
Nemo 2020-06-15 18:05:40 +05:30
parent 30a38bd769
commit b751bcd74c
1 changed files with 6 additions and 2 deletions

View File

@ -156,8 +156,12 @@ class HackerNewsApp:
if item['points'] == 0 or item['points'] is None:
return
i = Gtk.CheckMenuItem(
"(" + str(item['points']).zfill(3) + "/" + str(item['comments_count']).zfill(3) + ") " + item['title'])
points = str(item['points']).zfill(3) + "/" + str(item['comments_count']).zfill(3)
i = Gtk.CheckMenuItem.new_with_label(label="(" + points + ")"+item['title'])
label = i.get_child()
label.set_markup("<tt>" + points + "</tt> <span>"+item['title']+"</span>".format(points=points, title=item['title']))
label.set_selectable(False)
visited = item['history'] or item['id'] in self.db