Re: [Usability]No HIG maintainer?



On Tue, Dec 10, 2002 at 10:56:38AM -0500, Havoc Pennington wrote:
> On Tue, Dec 10, 2002 at 04:09:46PM +0100, Murray Cumming wrote: 
> > Shouldn't we just tell them to use the default, then later change the
> > default in GTK+?
<snip>
> FWIW I'm not sure you will convince Owen to change the GtkFrame
> defaults (and I think he'll have a good argument), because it's an
> incompatible change. However what you might convince him to do is to
> make the defaults some kind of theme property. But I'm just
> speculating here, maybe he'll change it.

I wouldn't change the defaults. Surely there are still good uses for
a normal weight, etched-in frame. What I want is a way to comply with
the HIG that doesn't abuse the toolkit, make maintanance harder, or
require anything that can't ever be gladed.

One way to do this that might work for other things is a padding widget.
I imagine it'd be a GtkBin subclass:

struct _GtkPad
{
  GtkBin bin;
  guint  pad_left;
  guint  pad_right;
  guint  pad_top;
  guint  pad_bottom;
}

Then the code for HIG-style grouping would be:

{
  GtkWidget *frame;
  GtkWidget *label;
  GtkWidget *pad;
  GtkWidget *whatever;

  frame = gtk_frame_new (NULL);
  gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE);

  label = gtk_label_new ("<b>Category Title</b>"); /* Hug a translator */
  gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
  gtk_frame_set_label_widget (GTK_FRAME (frame), label)

  pad = gtk_pad_new (18, 0, 6, 0);
  gtk_container_add (GTK_CONTAINER (frame), pad);

  whatever = whatever_new ("Foo:", "Field");
  gtk_container_add (GTK_CONTAINER (pad), whatever);
}

I've been at least once in another context how to add just some padding.

Cheers,
Greg Merchan



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