Some metrics tweaks for my laptop
This commit is contained in:
@@ -19,11 +19,10 @@ private class TextBubbleLayout : BubbleLayout
|
||||
|
||||
// Create font description from system font
|
||||
var font_desc = Pango.FontDescription.from_string(font_name);
|
||||
|
||||
var size = font_desc.get_size();
|
||||
font_desc.set_size((int)(size));
|
||||
font_desc.set_size((int)(12 * Pango.SCALE));
|
||||
layout.set_font_description(font_desc);
|
||||
layout.set_wrap(Pango.WrapMode.WORD_CHAR);
|
||||
layout.set_line_spacing(1.18f);
|
||||
|
||||
// Set max width
|
||||
layout.set_width((int)text_available_width * Pango.SCALE);
|
||||
@@ -31,20 +30,20 @@ private class TextBubbleLayout : BubbleLayout
|
||||
|
||||
private float text_available_width {
|
||||
get {
|
||||
return max_width - text_x_offset - constants.text_padding;
|
||||
return max_width - text_x_offset - constants.text_x_padding;
|
||||
}
|
||||
}
|
||||
|
||||
private float text_x_offset {
|
||||
get {
|
||||
return from_me ? constants.text_padding : constants.tail_width + constants.text_padding;
|
||||
return from_me ? constants.text_x_padding : constants.tail_width + constants.text_x_padding;
|
||||
}
|
||||
}
|
||||
|
||||
private float text_x_padding {
|
||||
get {
|
||||
// Opposite of text_x_offset
|
||||
return from_me ? constants.tail_width + constants.text_padding : constants.text_padding;
|
||||
return from_me ? constants.tail_width + constants.text_x_padding : constants.text_x_padding;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +62,7 @@ private class TextBubbleLayout : BubbleLayout
|
||||
Pango.Rectangle ink_rect, logical_rect;
|
||||
layout.get_pixel_extents(out ink_rect, out logical_rect);
|
||||
|
||||
return logical_rect.height + constants.corner_radius + constants.tail_bottom_padding;
|
||||
return logical_rect.height + constants.corner_radius + constants.tail_bottom_padding + constants.text_y_padding;
|
||||
}
|
||||
|
||||
public override float get_width() {
|
||||
@@ -78,6 +77,7 @@ private class TextBubbleLayout : BubbleLayout
|
||||
|
||||
Pango.Rectangle ink_rect, logical_rect;
|
||||
layout.get_pixel_extents(out ink_rect, out logical_rect);
|
||||
|
||||
snapshot.translate(Graphene.Point() {
|
||||
x = text_x_offset,
|
||||
y = ((get_height() - constants.tail_bottom_padding) - logical_rect.height) / 2
|
||||
|
||||
Reference in New Issue
Block a user