~ubuntu-branches/debian/sid/gnome-shell/sid

« back to all changes in this revision

Viewing changes to src/st/st-private.c

  • Committer: Package Import Robot
  • Author(s): Emilio Pozuelo Monfort, Petr Salinger, Emilio Pozuelo Monfort
  • Date: 2013-10-13 17:47:35 UTC
  • mfrom: (1.2.17) (18.1.41 experimental)
  • Revision ID: package-import@ubuntu.com-20131013174735-2npsu0w5wk0e6vgb
Tags: 3.8.4-4
[ Petr Salinger ]
* Restrict dependency on gir1.2-nmgtk-1.0 to linux-any (Closes: #726099)

[ Emilio Pozuelo Monfort ]
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
173
173
 
174
174
  ClutterColor color;
175
175
  StTextDecoration decoration;
176
 
  PangoAttrList *attribs;
 
176
  PangoAttrList *attribs = NULL;
177
177
  const PangoFontDescription *font;
178
 
  gchar *font_string;
179
178
  StTextAlign align;
180
179
 
181
180
  st_theme_node_get_foreground_color (theme_node, &color);
182
181
  clutter_text_set_color (text, &color);
183
182
 
184
183
  font = st_theme_node_get_font (theme_node);
185
 
  font_string = pango_font_description_to_string (font);
186
 
  clutter_text_set_font_name (text, font_string);
187
 
  g_free (font_string);
188
 
 
189
 
  attribs = pango_attr_list_new ();
 
184
  clutter_text_set_font_description (text, (PangoFontDescription *) font);
190
185
 
191
186
  decoration = st_theme_node_get_text_decoration (theme_node);
192
 
  if (decoration & ST_TEXT_DECORATION_UNDERLINE)
193
 
    {
194
 
      PangoAttribute *underline = pango_attr_underline_new (PANGO_UNDERLINE_SINGLE);
195
 
      pango_attr_list_insert (attribs, underline);
196
 
    }
197
 
  if (decoration & ST_TEXT_DECORATION_LINE_THROUGH)
198
 
    {
199
 
      PangoAttribute *strikethrough = pango_attr_strikethrough_new (TRUE);
200
 
      pango_attr_list_insert (attribs, strikethrough);
201
 
    }
202
 
  /* Pango doesn't have an equivalent attribute for _OVERLINE, and we deliberately
203
 
   * skip BLINK (for now...)
204
 
   */
 
187
  if (decoration)
 
188
    {
 
189
      attribs = pango_attr_list_new ();
 
190
 
 
191
      if (decoration & ST_TEXT_DECORATION_UNDERLINE)
 
192
        {
 
193
          PangoAttribute *underline = pango_attr_underline_new (PANGO_UNDERLINE_SINGLE);
 
194
          pango_attr_list_insert (attribs, underline);
 
195
        }
 
196
      if (decoration & ST_TEXT_DECORATION_LINE_THROUGH)
 
197
        {
 
198
          PangoAttribute *strikethrough = pango_attr_strikethrough_new (TRUE);
 
199
          pango_attr_list_insert (attribs, strikethrough);
 
200
        }
 
201
      /* Pango doesn't have an equivalent attribute for _OVERLINE, and we deliberately
 
202
       * skip BLINK (for now...)
 
203
       */
 
204
    }
205
205
 
206
206
  clutter_text_set_attributes (text, attribs);
207
207
 
208
 
  pango_attr_list_unref (attribs);
 
208
  if (attribs)
 
209
    pango_attr_list_unref (attribs);
209
210
 
210
211
  align = st_theme_node_get_text_align (theme_node);
211
 
  if(align == ST_TEXT_ALIGN_JUSTIFY) {
212
 
    clutter_text_set_justify (text, TRUE);
213
 
    clutter_text_set_line_alignment (text, PANGO_ALIGN_LEFT);
214
 
  } else {
215
 
    clutter_text_set_justify (text, FALSE);
216
 
    clutter_text_set_line_alignment (text, (PangoAlignment) align);
217
 
  }
 
212
  if (align == ST_TEXT_ALIGN_JUSTIFY)
 
213
    {
 
214
      clutter_text_set_justify (text, TRUE);
 
215
      clutter_text_set_line_alignment (text, PANGO_ALIGN_LEFT);
 
216
    }
 
217
  else
 
218
    {
 
219
      clutter_text_set_justify (text, FALSE);
 
220
      clutter_text_set_line_alignment (text, (PangoAlignment) align);
 
221
    }
218
222
}
219
223
 
220
224
/**
507
511
      cogl_color_set_from_4ub (&clear_color, 0, 0, 0, 0);
508
512
      cogl_push_framebuffer (offscreen);
509
513
      cogl_clear (&clear_color, COGL_BUFFER_BIT_COLOR);
 
514
      cogl_translate (-box.x1, -box.y1, 0);
510
515
      cogl_ortho (0, width, height, 0, 0, 1.0);
511
516
      clutter_actor_paint (actor);
512
517
      cogl_pop_framebuffer ();