Re: HIG Dialog widget proposal



Hi Owen,

On Tue, 2004-06-29 at 16:42 +0200, Owen Taylor wrote:
> 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"

Agreed, it makes lots of sense to keep it in GtkMessageDialog, I should
change the subject to "HIG dialog API proposal" :)

>    
>  * 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()
> 
>   That's marginally more verbose than adding more arguments
>   to a single constructor, but also more readable.  


the constructor of this widget doesn't work like the GtkMessageDialog
one, a real pain in the current GtkMessageDialog constructor is to have
to define the set of buttons with GtkButtonsType (and IIRC the HIG says
that those buttons should contain action verbs), the convenience
constructor I proposed was supposed to work like this:

GtkWidget *dialog = whatever_message_dialog (window,
                                             GTK_DIALOG_MODAL,
                                             GTK_MESSAGE_WARNING,
                                             "Delete filesystem?",                   /* primary text */
                                             "You will not be able to recover data", /* secondary text */
                                             GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
                                             "Delete it!", GTK_RESPONSE_OK,
                                             NULL);

I really think that we should have a constructor like this, for not
needing to do gtk_message_dialog_new(),
gtk_message_dialog_set_secondary_text() remove the buttons and
gtk_add_buttons() every time anyone wants to create a HIG-like dialog

> 
>  * 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 agree, seems a good idea

>    
>    Two other possibilities are:
> 
>     - We should implicitly add a <b></b> around
>       the main text in the case where the main text
>       has markup.   
> 
>     - 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.
> 
> * The separator can simply be turned off on GtkMessageDialog
>    for all message dialogs.

Yes, please


I'm willing to work on this, so any idea is welcome :)

	Thanks

> 
> Regards,
> 					Owen
> _______________________________________________
> gtk-devel-list mailing list
> gtk-devel-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-devel-list



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