summaryrefslogtreecommitdiff
path: root/libmate-desktop/mate-colorsel.c
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2014-07-02 11:29:44 +0200
committerStefano Karapetsas <[email protected]>2014-07-02 11:29:44 +0200
commit1c49e3642bad900c438114c22767444cf6445130 (patch)
treee319519391a7d76fd700c15caee5f3d36a9b50a1 /libmate-desktop/mate-colorsel.c
parentcf170926a4e57afe41f1ad9131d52cb297a71b99 (diff)
downloadmate-desktop-1c49e3642bad900c438114c22767444cf6445130.tar.bz2
mate-desktop-1c49e3642bad900c438114c22767444cf6445130.tar.xz
mate-color-select: Add copy button
Diffstat (limited to 'libmate-desktop/mate-colorsel.c')
-rw-r--r--libmate-desktop/mate-colorsel.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/libmate-desktop/mate-colorsel.c b/libmate-desktop/mate-colorsel.c
index 9586952..5c12799 100644
--- a/libmate-desktop/mate-colorsel.c
+++ b/libmate-desktop/mate-colorsel.c
@@ -73,7 +73,8 @@ enum {
PROP_HAS_PALETTE,
PROP_HAS_OPACITY_CONTROL,
PROP_CURRENT_COLOR,
- PROP_CURRENT_ALPHA
+ PROP_CURRENT_ALPHA,
+ PROP_HEX_STRING
};
enum {
@@ -327,7 +328,15 @@ mate_color_selection_class_init (MateColorSelectionClass *klass)
_("The current opacity value (0 fully transparent, 65535 fully opaque)"),
0, 65535, 65535,
G_PARAM_READWRITE));
-
+ g_object_class_install_property (gobject_class,
+ PROP_HEX_STRING,
+ g_param_spec_string ("hex-string",
+ _("HEX String"),
+ _("The hexadecimal string of current color"),
+ "",
+ G_PARAM_READABLE));
+
+
color_selection_signals[COLOR_CHANGED] =
g_signal_new ("color-changed",
G_OBJECT_CLASS_TYPE (gobject_class),
@@ -571,6 +580,7 @@ mate_color_selection_get_property (GObject *object,
GParamSpec *pspec)
{
MateColorSelection *colorsel = MATE_COLOR_SELECTION (object);
+ ColorSelectionPrivate *priv = colorsel->private_data;
GdkColor color;
switch (prop_id)
@@ -588,6 +598,9 @@ mate_color_selection_get_property (GObject *object,
case PROP_CURRENT_ALPHA:
g_value_set_uint (value, mate_color_selection_get_current_alpha (colorsel));
break;
+ case PROP_HEX_STRING:
+ g_value_set_string (value, gtk_editable_get_chars (GTK_EDITABLE (priv->hex_entry), 0, -1));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;