[libgd] two-lines-renderer: Fix subtitle not being centered
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgd] two-lines-renderer: Fix subtitle not being centered
- Date: Sat, 25 Jan 2014 16:59:30 +0000 (UTC)
commit 863099e6f5ce1e3d191335f3e9fd0ba6f98ddd34
Author: Bastien Nocera <hadess hadess net>
Date: Sat Jan 25 17:57:03 2014 +0100
two-lines-renderer: Fix subtitle not being centered
When we were calculating the text's sizes and coordinates,
we didn't apply the subtitle style to the 2nd line's Pango layout,
leading to the subtitle being placed as if it was normal sized.
libgd/gd-two-lines-renderer.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/libgd/gd-two-lines-renderer.c b/libgd/gd-two-lines-renderer.c
index 574cbb1..f541d06 100644
--- a/libgd/gd-two-lines-renderer.c
+++ b/libgd/gd-two-lines-renderer.c
@@ -121,9 +121,16 @@ gd_two_lines_renderer_prepare_layouts (GdTwoLinesRenderer *self,
}
else
{
+ GtkStyleContext *context;
+
line_two = create_layout_with_attrs (widget, cell_area,
self, PANGO_ELLIPSIZE_END);
+ context = gtk_widget_get_style_context (widget);
+ gtk_style_context_save (context);
+ apply_subtitle_style_to_layout (context, line_two, GTK_STATE_FLAG_NORMAL);
+ gtk_style_context_restore (context);
+
pango_layout_set_height (line_one, - (self->priv->text_lines - 1));
pango_layout_set_height (line_two, -1);
pango_layout_set_text (line_two, self->priv->line_two, -1);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]