From: joncruz Date: Sun, 2 Dec 2007 08:33:16 +0000 (+0000) Subject: UI tweaks for CMS view toggle X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=603d3d39ada52af4150e0bc8954ad06f79eabebd;p=inkscape.git UI tweaks for CMS view toggle --- diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index b950ed03b..1d7acf100 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -688,7 +688,7 @@ void InkscapePreferences::initPageCMS() _cms_intent.init("options.displayprofile", "intent", intentLabels, intentValues, numIntents, 0); - _page_cms.add_line( false, _("Display intent:"), _cms_intent, "", + _page_cms.add_line( false, _("Display rendering intent:"), _cms_intent, "", _("The rendering intent to use to calibrate display output."), false); _page_cms.add_group_header( _("Proofing")); @@ -711,7 +711,7 @@ void InkscapePreferences::initPageCMS() _("The ICC profile to use to simulate device output."), false); _cms_proof_intent.init("options.softproof", "intent", intentLabels, intentValues, numIntents, 0); - _page_cms.add_line( false, _("Device intent:"), _cms_proof_intent, "", + _page_cms.add_line( false, _("Device rendering intent:"), _cms_proof_intent, "", _("The rendering intent to use to calibrate display output."), false); _cms_proof_blackpoint.init( _("Black Point Compensation"), "options.softproof", "bpc", false); diff --git a/src/verbs.cpp b/src/verbs.cpp index 282418a37..ee85380a9 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -2461,8 +2461,8 @@ Verb *Verb::_base_verbs[] = { new ZoomVerb(SP_VERB_VIEW_MODE_TOGGLE, "ViewModeToggle", N_("_Toggle"), N_("Toggle between normal and outline display modes"), NULL), - new ZoomVerb(SP_VERB_VIEW_CMS_TOGGLE, "ViewCmsToggle", N_("Display Adjustment"), - N_("Toggle CMS display adjustment on and off"), "color_management"), + new ZoomVerb(SP_VERB_VIEW_CMS_TOGGLE, "ViewCmsToggle", N_("Color manage view"), + N_("Toggle color managed display adjustment for this document window"), "color_management"), new ZoomVerb(SP_VERB_VIEW_ICON_PREVIEW, "ViewIconPreview", N_("Ico_n Preview..."), N_("Open a window to preview objects at different icon resolutions"), "view_icon_preview"), diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp index 463cfe883..18045f0b6 100644 --- a/src/widgets/desktop-widget.cpp +++ b/src/widgets/desktop-widget.cpp @@ -93,6 +93,7 @@ static gint sp_desktop_widget_event (GtkWidget *widget, GdkEvent *event, SPDeskt static void sp_dtw_color_profile_event(EgeColorProfTracker *widget, SPDesktopWidget *dtw); static void cms_adjust_toggled( GtkWidget *button, gpointer data ); +static void cms_adjust_set_sensitive( SPDesktopWidget *dtw, bool enabled ); static void sp_desktop_widget_adjustment_value_changed (GtkAdjustment *adj, SPDesktopWidget *dtw); static void sp_desktop_widget_namedview_modified (SPObject *obj, guint flags, SPDesktopWidget *dtw); @@ -190,7 +191,7 @@ void PrefWatcher::notifyAttributeChanged( Node &node, GQuark name, for ( std::list::iterator it = dtws.begin(); it != dtws.end(); ++it ) { SPDesktopWidget* dtw = *it; if ( GTK_WIDGET_SENSITIVE( dtw->cms_adjust ) != enabled ) { - gtk_widget_set_sensitive( dtw->cms_adjust, enabled ); + cms_adjust_set_sensitive( dtw, enabled ); } } refresh = true; @@ -380,17 +381,26 @@ sp_desktop_widget_init (SPDesktopWidget *dtw) gtk_box_pack_start (GTK_BOX (dtw->vscrollbar_box), dtw->vscrollbar, TRUE, TRUE, 0); gtk_table_attach (GTK_TABLE (canvas_tbl), dtw->vscrollbar_box, 2, 3, 0, 2, (GtkAttachOptions)(GTK_SHRINK), (GtkAttachOptions)(GTK_FILL), 0, 0); + + gchar const* tip = ""; + Inkscape::Verb* verb = Inkscape::Verb::get( SP_VERB_VIEW_CMS_TOGGLE ); + if ( verb ) { + SPAction *act = verb->get_action( dtw->viewwidget.view ); + if ( act && act->tip ) { + tip = act->tip; + } + } dtw->cms_adjust = sp_button_new_from_data( Inkscape::ICON_SIZE_DECORATION, SP_BUTTON_TYPE_TOGGLE, NULL, "color_management", - _("Adjust the display"), + tip, dtw->tt ); #if ENABLE_LCMS { Glib::ustring current = prefs_get_string_attribute( "options.displayprofile", "uri" ); bool enabled = current.length() > 0; - gtk_widget_set_sensitive( dtw->cms_adjust, enabled ); + cms_adjust_set_sensitive( dtw, enabled ); if ( enabled ) { long long int active = prefs_get_int_attribute_limited( "options.displayprofile", "enable", 0, 0, 1 ); if ( active ) { @@ -400,7 +410,7 @@ sp_desktop_widget_init (SPDesktopWidget *dtw) } g_signal_connect_after( G_OBJECT(dtw->cms_adjust), "clicked", G_CALLBACK(cms_adjust_toggled), dtw ); #else - gtk_widget_set_sensitive(dtw->cms_adjust, FALSE); + cms_adjust_set_sensitive(dtw, FALSE); #endif // ENABLE_LCMS gtk_table_attach( GTK_TABLE(canvas_tbl), dtw->cms_adjust, 2, 3, 2, 3, (GtkAttachOptions)(GTK_SHRINK), (GtkAttachOptions)(GTK_SHRINK), 0, 0); { @@ -524,7 +534,7 @@ sp_desktop_widget_init (SPDesktopWidget *dtw) *(dtw->canvas->cms_key) = id; enabled = !dtw->canvas->cms_key->empty(); } - gtk_widget_set_sensitive( dtw->cms_adjust, enabled ); + cms_adjust_set_sensitive( dtw, enabled ); } g_signal_connect( G_OBJECT(dtw->_tracker), "changed", G_CALLBACK(sp_dtw_color_profile_event), dtw ); @@ -745,7 +755,7 @@ void sp_dtw_color_profile_event(EgeColorProfTracker */*tracker*/, SPDesktopWidge dtw->requestCanvasUpdate(); enabled = !dtw->canvas->cms_key->empty(); } - gtk_widget_set_sensitive( dtw->cms_adjust, enabled ); + cms_adjust_set_sensitive( dtw, enabled ); } void cms_adjust_toggled( GtkWidget */*button*/, gpointer data ) @@ -760,6 +770,18 @@ void cms_adjust_toggled( GtkWidget */*button*/, gpointer data ) } } +void cms_adjust_set_sensitive( SPDesktopWidget *dtw, bool enabled ) +{ + Inkscape::Verb* verb = Inkscape::Verb::get( SP_VERB_VIEW_CMS_TOGGLE ); + if ( verb ) { + SPAction *act = verb->get_action( dtw->viewwidget.view ); + if ( act ) { + sp_action_set_sensitive( act, enabled ); + } + } + gtk_widget_set_sensitive( dtw->cms_adjust, enabled ); +} + void sp_dtw_desktop_activate (SPDesktopWidget */*dtw*/) {