RE: HIG Dialog widget proposal



> On Sat, 2004-04-17 at 21:00, Carlos Garnacho wrote:
> > Hi all,
> >
> > I've developed a simple widget for doing HIG-style alert dialogs, it has
> > replaced all GtkMessageDialogs in the GNOME System Tools and a has a
> > quite simple API:
> >
> > GtkWidget* gst_hig_dialog_new (GtkWindow         *parent,
> >              GtkDialogFlags     flags,
> >              GstHigMessageType  type,
> >              const gchar       *primary_text,
> >              const gchar       *secondary_text,
> >              const gchar       *first_button_text,
> >              ...) G_GNUC_PRINTF (6, 7);
> 
> Here (some months later) my thoughts on the issue...
> 
> * I don't think a separate widget makes sense.
> 
>    If you had both, how would you explain to a developer
>    when to use one or when to use another? I don't think
>    there is a sensible explanation.
> 
>    And the difference between the two widgets is really
>    small; basically, the only real difference is that
>    the alert dialog has the "secondary text"
> 
>  * gtk_message_dialog_new() already has too many arguments.
>    Therefore, I don't think sense to create a
>    gtk_message_dialog_new_alert(). Rather we should
>    add
> 
>     gtk_message_dialog_set_secondary_text()
>     gtk_message_dialog_set_secondary_markup()


I agree.

> 
>   That's marginally more verbose than adding more arguments
>   to a single constructor, but also more readable.
> 
>  * the way I'd handle bolding of the main text, is that
> 
>     - If we aren't using markup for the main text and
>       the secondary text should be should be displayed
>       in bold
> 
>     - If we are using markup for the main text, we leave
>       it unmodified.
> 

I thought the idea of the GtkMessageDialog was to hold a certain format when displaying information, i.e. the primary text is a certain format, and the secondard is another format.  Using markup allows this format to be changed and I would argue if the developer wants a particular format (which is outside the guidelines of the HIG), why not create their own unique dialog?

>    Two other possibilities are:
> 
>     - We should implicitly add a <b></b> around
>       the main text in the case where the main text
>       has markup.

I think this is slightly messy.  What happens if the developer doesn't want bold text, but instead, just larger text?  They have no choice then.

Perhaps the solution is the only allow tags like <u> and <i>?  That way the developer can place emphasis on text still, but the actual sizing and boldness of the text is limited to the HIG?

For most the message dialogs I have created, I am not interested in the formatting, I just expect the primary to be bold or bigger, and the secondary to be smaller and to have less emphasis.  For me, using arguments when setting the label text was my biggest beef :)

> 
>     - We should have
> 
>        gtk_message_dialog_set_title_text()
> 
>       instead and use the current text as the main text.
>       But that strikes me as making the code read backwards
>       from the display and hence bad.

I thought the HIG says to use an empty title for a dialog/alert?

Regards,
Martyn



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