Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix time-activity overlap with wide fonts #699

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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