After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 132333 - Can't add a palette to the dialog of a color button
Can't add a palette to the dialog of a color button
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
unspecified
Other Linux
: Normal normal
: Small API
Assigned To: gtk-bugs
gtk-bugs
: 144639 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2004-01-23 20:52 UTC by Mariano Suárez-Alvarez
Modified: 2012-12-03 23:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Make sure add palette amends the dialog (1003 bytes, patch)
2012-12-02 02:42 UTC, Pierre-Yves Luyten
none Details | Review
Make sure add palette works (3.35 KB, patch)
2012-12-02 11:33 UTC, Pierre-Yves Luyten
reviewed Details | Review
Ensure dialog before adding palette (3.31 KB, patch)
2012-12-03 21:17 UTC, Pierre-Yves Luyten
committed Details | Review

Description Mariano Suárez-Alvarez 2004-01-23 20:52:12 UTC
It'd be nice to be able to add a palette to the dialog popped up by a
GtkColorButton
Comment 1 Federico Mena Quintero 2004-01-27 18:21:19 UTC
This needs an API proposal.
Comment 2 Matthias Clasen 2004-01-30 10:48:45 UTC
Would be worthwhile to check the gtk-devel archives; we discussed 
palettes when the color button was added; IIRC we came to the 
conclusion that if you want a palette, quite possibly you're better 
off with something like a color combo (see testcombo.c in gtk+/tests)
Comment 3 Rob Staudinger 2005-01-25 19:36:53 UTC
Archived discussion: 
http://mail.gnome.org/archives/gtk-devel-list/2003-March/msg00052.html

My feeling from re-reading the posts was that Matthias Clasen was rather in
favour of the ColorButton while Jody Goldberg argued towards a combo-style thing
(as found in gnumeric). Havoc Pennington brought in another proposal about a
osx-style widget.

In abiword we are starting to use the color button and our users are demanding
the palette because they have used it in other apps too. I would very much like
to see this happen for the sake of consistency.

API Proposal:
gboolean gtk_color_button_dialog_get_has_palette(GtkColorButton *colorbtn);
void gtk_color_button_dialog_set_has_palette(GtkColorButton *colorbtn, gboolean
has_palette);
Comment 4 Matthias Clasen 2005-06-22 02:42:13 UTC
*** Bug 144639 has been marked as a duplicate of this bug. ***
Comment 5 Mystilleef 2006-01-07 11:07:03 UTC
What is the status of this proposal?
Comment 6 Matthias Clasen 2006-01-08 05:56:14 UTC
If we are adding the has-palette property, we also have to add palette-loading/saving functionality...
Comment 7 Roli 2009-10-28 01:26:42 UTC
"add palette-loading/saving functionality" - that would be excellent, i'd use this feature happily in Bluefish editor and other apps too, could we have it, please!
Comment 8 Pierre-Yves Luyten 2012-12-02 02:42:32 UTC
Created attachment 230428 [details] [review]
Make sure add palette amends the dialog
Comment 9 Pierre-Yves Luyten 2012-12-02 02:44:01 UTC
The bug seems obsolete, however I'm surprised the gtk_color_button_add_palette does not work when no dialog has been created. Dialog is created only when button clicked. I'm attaching a patch to make this more understandable but it might be wrong.
Comment 10 Pierre-Yves Luyten 2012-12-02 11:33:43 UTC
Created attachment 230438 [details] [review]
Make sure add palette works

This patch is the same comment except it was tested
Comment 11 Cosimo Cecchi 2012-12-03 13:57:09 UTC
Review of attachment 230438 [details] [review]:

The change makes sense to me - the other option would be to save the palettes in the button before the dialog is created and add them at creation, but it just seems harder for no good reasons. I only have a minor comment on the code itself.

::: gtk/gtkcolorbutton.c
@@ +588,2 @@
 static void
+create_dialog (GtkColorButton *button)

I'd rather you named this ensure_dialog() and added a

if (button->priv->cs_dialog != NULL)
  return;

check first thing in the function, instead of the caller needing to check if the dialog exists.
Comment 12 Pierre-Yves Luyten 2012-12-03 21:17:52 UTC
Created attachment 230591 [details] [review]
Ensure dialog before adding palette

Yes, another option would have be to save the palette.

Anyway I sticked to the first way, just renamed the func and moved the check there.
Comment 13 Cosimo Cecchi 2012-12-03 21:27:30 UTC
Review of attachment 230591 [details] [review]:

Thanks, looks good to me.
Comment 14 Pierre-Yves Luyten 2012-12-03 23:29:49 UTC
Review of attachment 230591 [details] [review]:

.