Re: HIG Dialog widget proposal



Hi,

Tommi Komulainen <tommi komulainen nokia com> writes:

> I've implemented a HigAlert dialog in galeon
> (http://cvs.gnome.org/viewcvs/galeon/utils/hig-alert.c) and I figured
> I'd rather not add implicit markup, but rather set the default font
> attributes for the primary label instead.  That way it should be pretty
> transparent.
> 
> Basically I'm doing the following:
> 
> 	size = pango_font_description_get_size (widget->style->font_desc);
> 
> 	font_desc = pango_font_description_from_string ("bold");
> 	pango_font_description_set_size (font_desc, size * PANGO_SCALE_LARGE);
> 
> 	gtk_widget_modify_font (widget, font_desc);
> 
> 
> I wonder if there's something inherently bad with the above.  It works,
> though :)

Probably the right (but a little tedious) way is to set a PangoAttrList
instead:


  PangoAttribute *attr = pango_attr_list_new ();
  PangoAttrList  *attrs;

  attr = pango_attr_weight_new (PANGO_WEIGHT_BOLD);
  attr->start_index = 0;
  attr->end_index   = -1;
  pango_attr_list_insert (attrs, attr);

  attr = pango_attr_scale_new (PANGO_SCALE_LARGE);
  attr->start_index = 0;
  attr->end_index   = -1;
  pango_attr_list_insert (attrs, attr);

  gtk_label_set_attributes (label, attrs);

  pango_attr_list_unref (attrs);



Sven




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]