From: JucaBlues Date: Tue, 11 Aug 2009 04:58:32 +0000 (+0000) Subject: setting sensibility of "color management icon" depending on icc-color usage X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=feb83166e9d0f28c368b891a2dbe6ecca9e097c7;p=inkscape.git setting sensibility of "color management icon" depending on icc-color usage --- diff --git a/src/widgets/sp-color-notebook.cpp b/src/widgets/sp-color-notebook.cpp index 58974131e..44de40115 100644 --- a/src/widgets/sp-color-notebook.cpp +++ b/src/widgets/sp-color-notebook.cpp @@ -326,21 +326,21 @@ void ColorNotebook::init() GtkWidget *rgbabox = gtk_hbox_new (FALSE, 0); /* Create color management icons */ - GtkWidget *box_colormanaged = gtk_event_box_new (); + _box_colormanaged = gtk_event_box_new (); GtkWidget *colormanaged = gtk_image_new_from_icon_name ("color-management-icon", GTK_ICON_SIZE_SMALL_TOOLBAR); - gtk_container_add (GTK_CONTAINER (box_colormanaged), colormanaged); + gtk_container_add (GTK_CONTAINER (_box_colormanaged), colormanaged); GtkTooltips *tooltips_colormanaged = gtk_tooltips_new (); - gtk_tooltips_set_tip (tooltips_colormanaged, box_colormanaged, _("Color Managed"), ""); - //gtk_widget_hide (GTK_WIDGET (box_colormanaged)); - gtk_box_pack_start(GTK_BOX(rgbabox), box_colormanaged, TRUE, FALSE, 2); + gtk_tooltips_set_tip (tooltips_colormanaged, _box_colormanaged, _("Color Managed"), ""); + gtk_widget_set_sensitive (_box_colormanaged, false); + gtk_box_pack_start(GTK_BOX(rgbabox), _box_colormanaged, TRUE, FALSE, 2); - GtkWidget *box_outofgamut = gtk_event_box_new (); + _box_outofgamut = gtk_event_box_new (); GtkWidget *outofgamut = gtk_image_new_from_icon_name ("out-of-gamut-icon", GTK_ICON_SIZE_SMALL_TOOLBAR); - gtk_container_add (GTK_CONTAINER (box_outofgamut), outofgamut); + gtk_container_add (GTK_CONTAINER (_box_outofgamut), outofgamut); GtkTooltips *tooltips_outofgamut = gtk_tooltips_new (); - gtk_tooltips_set_tip (tooltips_outofgamut, box_outofgamut, _("Out of gamut!"), ""); - //gtk_widget_hide (GTK_WIDGET (box_outofgamut)); - gtk_box_pack_start(GTK_BOX(rgbabox), box_outofgamut, TRUE, FALSE, 2); + gtk_tooltips_set_tip (tooltips_outofgamut, _box_outofgamut, _("Out of gamut!"), ""); + gtk_widget_set_sensitive (_box_outofgamut, false); + gtk_box_pack_start(GTK_BOX(rgbabox), _box_outofgamut, TRUE, FALSE, 2); /* Create RGBA entry and color preview */ _rgbal = gtk_label_new_with_mnemonic (_("RGBA_:")); @@ -500,6 +500,9 @@ void ColorNotebook::_rgbaEntryChanged(GtkEntry* entry) void ColorNotebook::_updateRgbaEntry( const SPColor& color, gfloat alpha ) { g_return_if_fail( ( 0.0 <= alpha ) && ( alpha <= 1.0 ) ); + + /* update color management icon*/ + gtk_widget_set_sensitive (_box_colormanaged, color.icc != NULL); if ( !_updatingrgba ) { diff --git a/src/widgets/sp-color-notebook.h b/src/widgets/sp-color-notebook.h index bf6fb1002..c9ab29798 100644 --- a/src/widgets/sp-color-notebook.h +++ b/src/widgets/sp-color-notebook.h @@ -61,6 +61,7 @@ protected: gulong _entryId; GtkWidget *_book; GtkWidget *_rgbal, *_rgbae; /* RGBA entry */ + GtkWidget *_box_outofgamut, *_box_colormanaged; GtkWidget *_p; /* Color preview */ GtkWidget *_btn; GtkWidget *_popup;