Skip to content

Commit

Permalink
Widgets: Improve layout of small bitmap
Browse files Browse the repository at this point in the history
  • Loading branch information
nijel committed Jul 23, 2020
1 parent 3e86a3c commit 44a5a38
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion weblate/trans/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ class BitmapWidget(ContentWidget):
head_template = '<span letter_spacing="-500"><b>{}</b></span>'
foot_template = '<span letter_spacing="1000">{}</span>'
font_size = 10
line_spacing = 1
offset = 0
column_offset = 0
lines = True
Expand Down Expand Up @@ -188,7 +189,7 @@ def render(self, response):
layout.set_alignment(Pango.Alignment.CENTER)
layout.set_width(column_width * Pango.SCALE)

offset += layout.get_pixel_size().height
offset += layout.get_pixel_size().height * self.line_spacing

# Render to cairo context
PangoCairo.show_layout(ctx, layout)
Expand Down Expand Up @@ -279,6 +280,8 @@ class SmallWidget(BitmapWidget):
name = "88x31"
order = 111
font_size = 7
line_spacing = 0.8
offset = -1
verbose = gettext_lazy("Small status badge")

def get_columns(self):
Expand Down

0 comments on commit 44a5a38

Please sign in to comment.