From 63efeb3b33e4531c36333b981e85ff0b4aebefac Mon Sep 17 00:00:00 2001 From: "Felipe C. da S. Sanches" Date: Sun, 6 Dec 2009 01:56:13 -0200 Subject: [PATCH] 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%) --- share/icons/Makefile.am | 2 + share/icons/too-much-ink-icon.png | Bin 0 -> 655 bytes share/icons/too-much-ink-icon.svg | 70 ++++++++++++++++++++++++++++++ src/widgets/sp-color-notebook.cpp | 23 ++++++++++ src/widgets/sp-color-notebook.h | 2 +- 5 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 share/icons/too-much-ink-icon.png create mode 100644 share/icons/too-much-ink-icon.svg 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 0000000000000000000000000000000000000000..14fed033dd9b0a85e8050257eff993703304f9d7 GIT binary patch literal 655 zcmV;A0&x9_P)(nx6g<#+_$0ZXA+r1LpA>ToC9hK9|llz py7_1-)oq<7XMtcURoCGI@CQ7k)?c)Ym)`&Y002ovPDHLkV1kSb8M^=g literal 0 HcmV?d00001 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; -- 2.30.2