From b751bcd74c2e6d7cf57adfa7cba9f738cd960c5e Mon Sep 17 00:00:00 2001 From: Nemo Date: Mon, 15 Jun 2020 18:05:40 +0530 Subject: [PATCH] Switches to a label to make points take fixed-width --- hackertray/__init__.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hackertray/__init__.py b/hackertray/__init__.py index 931aeb0..cfb38f1 100644 --- a/hackertray/__init__.py +++ b/hackertray/__init__.py @@ -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("" + points + " "+item['title']+"".format(points=points, title=item['title'])) + label.set_selectable(False) visited = item['history'] or item['id'] in self.db