Skip to content

Commit

Permalink
Merge pull request #699 from GeraldJansen/fix-time-activity-overlap
Browse files Browse the repository at this point in the history
Fix time-activity overlap with wide fonts
  • Loading branch information
aquaherd authored Mar 28, 2023
2 parents 71076a5 + 8b348ae commit d537c5f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/hamster/widgets/facttree.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def __init__(self, x=0, y=0, color=None):
self._label_context = cairo.Context(cairo.ImageSurface(cairo.FORMAT_A1, 0, 0))
self.layout = pangocairo.create_layout(self._label_context)
self.layout.set_font_description(pango.FontDescription(graphics._font_desc))
self.set_text("Hamster") # dummy
self.set_text("00:00 - 00:00") # dummy time_label for finding width

@property
def height(self):
Expand Down Expand Up @@ -128,7 +128,8 @@ def set_text(self, text):
class FactRow(object):
def __init__(self):
self.time_label = Label()
self.activity_label = Label(x=100)
x = self.time_label.layout.get_pixel_size()[0] + 10
self.activity_label = Label(x=x)

self.category_label = Label()
self.description_label = Label()
Expand Down

0 comments on commit d537c5f

Please sign in to comment.