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 708037 - Allow live updates on widgets implementing GtkColorChooser
Allow live updates on widgets implementing GtkColorChooser
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkColorChooser
3.9.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2013-09-13 16:49 UTC by Lionel Landwerlin
Modified: 2014-05-21 23:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
colorchooser: introduce synchronized property (21.81 KB, patch)
2013-09-13 16:50 UTC, Lionel Landwerlin
none Details | Review

Description Lionel Landwerlin 2013-09-13 16:49:25 UTC
The purpose of this change is to introduece a synchronized property to propagate the changes from color selection widgets deep down another color selection widget.

For example, you might want to live update the color changed on a GtkColorButton. Right now, you can't do that because objects are encapsulated this way :

GtkColorButton
   -> GtkColorChooserDialog
         -> GtkColorChooserWidget
               -> GtkColorEditor

If you modify the color within GtkColorEditor, there is no way for the developer to know about the changes.

This patch proposes cascading the changes live by listening to appropriate signals and saving the previously selected color in case of cancellation.
Comment 1 Lionel Landwerlin 2013-09-13 16:50:04 UTC
Created attachment 254874 [details] [review]
colorchooser: introduce synchronized property
Comment 2 Emmanuele Bassi (:ebassi) 2013-09-13 16:54:56 UTC
I'm a bit puzzled as to why this shouldn't be the default, instead of requiring a property, two virtual functions, implementations of those virtual functions, and two public functions wrapping the virtual function.
Comment 3 Lionel Landwerlin 2013-09-13 19:36:40 UTC
That's a valid argument, I'm ok to rewrite this without all the virtual stuff.
I just tried to keep the default behavior unchanged.
Comment 4 Matthias Clasen 2013-09-17 02:11:02 UTC
I'm not entirely sure this is right - conceptually, the editor shows temporary, unsaved state until you click 'select', at which point the constructed color is added to the palette and saved.
Comment 5 Matthias Clasen 2014-05-21 23:25:51 UTC
I've done something slightly different now: When the color editor is visible, you get notify::rgba on the color widget as the color is changed.