From: Felipe C. da S. Sanches Date: Sun, 6 Dec 2009 03:56:13 +0000 (-0200) Subject: added an icon to the color picker dialog to alert when there is too much ink in a... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=63efeb3b33e4531c36333b981e85ff0b4aebefac;p=inkscape.git added an icon to the color picker dialog to alert when there is too much ink in a color composition. (i.e. when the sum of color components is greater than 320%) --- diff --git a/share/icons/Makefile.am b/share/icons/Makefile.am index 4bf8b8b35..59c55948d 100644 --- a/share/icons/Makefile.am +++ b/share/icons/Makefile.am @@ -3,6 +3,8 @@ SUBDIRS = application iconsdir = $(datadir)/inkscape/icons pixmaps = \ + too-much-ink-icon.png \ + too-much-ink-icon.svg \ out-of-gamut-icon.png \ out-of-gamut-icon.svg \ color-management-icon.png \ diff --git a/share/icons/too-much-ink-icon.png b/share/icons/too-much-ink-icon.png new file mode 100644 index 000000000..14fed033d Binary files /dev/null and b/share/icons/too-much-ink-icon.png differ diff --git a/share/icons/too-much-ink-icon.svg b/share/icons/too-much-ink-icon.svg new file mode 100644 index 000000000..a2f688498 --- /dev/null +++ b/share/icons/too-much-ink-icon.svg @@ -0,0 +1,70 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/src/widgets/sp-color-notebook.cpp b/src/widgets/sp-color-notebook.cpp index be41f5f0f..1870c2960 100644 --- a/src/widgets/sp-color-notebook.cpp +++ b/src/widgets/sp-color-notebook.cpp @@ -348,6 +348,14 @@ void ColorNotebook::init() gtk_widget_set_sensitive (_box_outofgamut, false); gtk_box_pack_start(GTK_BOX(rgbabox), _box_outofgamut, FALSE, FALSE, 2); + _box_toomuchink = gtk_event_box_new (); + GtkWidget *toomuchink = gtk_image_new_from_icon_name ("too-much-ink-icon", GTK_ICON_SIZE_SMALL_TOOLBAR); + gtk_container_add (GTK_CONTAINER (_box_toomuchink), toomuchink); + GtkTooltips *tooltips_toomuchink = gtk_tooltips_new (); + gtk_tooltips_set_tip (tooltips_toomuchink, _box_toomuchink, _("Too much ink!"), ""); + gtk_widget_set_sensitive (_box_toomuchink, false); + gtk_box_pack_start(GTK_BOX(rgbabox), _box_toomuchink, FALSE, FALSE, 2); + #endif //ENABLE_LCMS /* Create RGBA entry and color preview */ @@ -520,6 +528,21 @@ void ColorNotebook::_updateRgbaEntry( const SPColor& color, gfloat alpha ) if ( target_profile ) gtk_widget_set_sensitive (_box_outofgamut, target_profile->GamutCheck(color)); } + + /* update too-much-ink icon */ + gtk_widget_set_sensitive (_box_toomuchink, false); + if (color.icc){ + double ink_sum = 0; + for (unsigned int i=0; icolors.size(); i++){ + ink_sum += color.icc->colors[i]; + } + + /* Some literature states that when the sum of paint values exceed 320%, it is considered to be a satured color, + which means the paper can get too wet due to an excessive ammount of ink. This may lead to several issues + such as misalignment and poor quality of printing in general.*/ + if ( ink_sum > 3.2 ) + gtk_widget_set_sensitive (_box_toomuchink, true); + } #endif //ENABLE_LCMS if ( !_updatingrgba ) diff --git a/src/widgets/sp-color-notebook.h b/src/widgets/sp-color-notebook.h index b7cd8295f..5eb29ac73 100644 --- a/src/widgets/sp-color-notebook.h +++ b/src/widgets/sp-color-notebook.h @@ -62,7 +62,7 @@ protected: GtkWidget *_book; GtkWidget *_rgbal, *_rgbae; /* RGBA entry */ #if ENABLE_LCMS - GtkWidget *_box_outofgamut, *_box_colormanaged; + GtkWidget *_box_outofgamut, *_box_colormanaged, *_box_toomuchink; #endif //ENABLE_LCMS GtkWidget *_p; /* Color preview */ GtkWidget *_btn;