GNOME Bugzilla – Bug 68938
GtkDialog's separator should be removed
Last modified: 2011-02-04 16:12:26 UTC
There is no good reason for GtkDialogs to have the separator, especially on by default and not turn off-able in GtkMessageDialog. Separation between the buttons in a GtkDialog and the contents can be done with a GtkNotebook or a GtkFrame, or more rarely the developer can add the separator manually. Attached are two patches, one to remove it entirely and one to deprecate the api, but remove it internally. Another option would be to make it off by default - although here the GtkDialogFlags would need to be changed a little bit.
Created attachment 6424 [details] [review] patch to deprecate the separator
Created attachment 6425 [details] [review] patch to completely remove the separator
We should at least set the default to off. The seperator is just extra visual noise.
To avoid changing API at this point, the way I'd fix this is to have apps written as if the separator were there (turning it off if there's a notebook/frame, leaving it otherwise), and have a style property on GtkDialog that optionally forces it off always. Owen I can do this patch this weekend if you want.
For GtkDialog, I think that it's best at this point to leave it something up to application designers and style guide writers. Making it an interacting style property and widget property would be really confusing I think. (And if it was off by default, most dialogs would look awful if someone turned it on.) For GtkMessageDialog, I think it would be more reasonable to make it a style property, since we have an idea of what the entire dialog looks like... the interaction of this with the GtkDialog methods, properties is a bit confusing though, and you'd probably need some hooks in GtkDialog. (Or could make it a GtkDialog style property and tell people to only specify it for subclasses.) I think this is a post-2.0.0 issue though; we could conceivably add some sort of style property in 2.0.1, though it's more likely a 2.2 issue. I'd actually like to have support for themes drawing things in more customized ways in the future ... I think subtle color differences or a faint line could be more effective than either a separator or no separator.
Moving non-critical or hard to fix bugs to 2.0.2
Move open bugs from milestones 2.0.[012] -- > 2.0.3, since 2.0.2 is already out.
*** Bug 98779 has been marked as a duplicate of this bug. ***
Plan of attack: - Add private GtkDialog <=> GtkMessageDialog API to say "ignore the ::has-separator property for this dialog" - Add a style property to GtkMessageDialog - Leave on vs. off for the separator as a theme decision
The attached patch adds a "use_separator" style property to GtkMessageDialog, but it doesn't add the API to tell GtkDialog to ignore its own has-separator property. Do we really need that?
Created attachment 23575 [details] [review] Patch to add a use_separator style property to GtkMessageDialog.
One thing I just noticed is that xgettext will probably have trouble to pick up a string which is split over multiple lines, ie P_("bla" "bla")
Fixed on CVS, also with the addition of _gtk_dialog_set_ignore_separator(). 2004-02-03 Federico Mena Quintero <federico@ximian.com> Fix #68938. * gtk/gtkdialog.c (GtkDialogPrivate): New private structure for GtkDialog; right now it only contains an ignore_separator field. (gtk_dialog_class_init): Register the private structure. (gtk_dialog_init): Initialize the priv->ignore_separator field. (_gtk_dialog_set_ignore_separator): New private function. (gtk_dialog_set_has_separator): Ignore the setting if appropriate. * gtk/gtkmessagedialog.c (gtk_message_dialog_class_init): Add a use_separator style property. (gtk_message_dialog_style_set): Change the dialog's separator based on the style property. (gtk_message_dialog_init): Set the dialog box to ignore the separator setting.