From a919e61801f30689700e3179b99d32b3f445f39e Mon Sep 17 00:00:00 2001 From: Carlos Garcia Campos Date: Sun, 29 Nov 2009 16:19:13 +0100 Subject: [PATCH] [shell] Update window icon too when the inverted colors option is active --- shell/ev-window.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/shell/ev-window.c b/shell/ev-window.c index 1b82aa4e..a07bea71 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -1136,6 +1136,8 @@ ev_window_set_icon_from_thumbnail (EvJobThumbnail *job, EvWindow *ev_window) { if (job->thumbnail) { + if (ev_document_model_get_inverted_colors (ev_window->priv->model)) + ev_document_misc_invert_pixbuf (job->thumbnail); gtk_window_set_icon (GTK_WINDOW (ev_window), job->thumbnail); } @@ -4167,6 +4169,21 @@ ev_window_rotation_changed_cb (EvDocumentModel *model, ev_window_refresh_window_thumbnail (window, rotation); } +static void +ev_window_inverted_colors_changed_cb (EvDocumentModel *model, + GParamSpec *pspec, + EvWindow *window) +{ + gboolean inverted_colors = ev_document_model_get_inverted_colors (model); + gint rotation = ev_document_model_get_rotation (model); + + if (window->priv->metadata && !ev_window_is_empty (window)) + ev_metadata_set_boolean (window->priv->metadata, "inverted-colors", + inverted_colors); + + ev_window_refresh_window_thumbnail (window, rotation); +} + static void ev_window_has_selection_changed_cb (EvView *view, GParamSpec *pspec, EvWindow *window) { @@ -6333,6 +6350,10 @@ ev_window_init (EvWindow *ev_window) ev_window); /* Connect to view signals */ + g_signal_connect (ev_window->priv->model, + "notify::inverted-colors", + G_CALLBACK (ev_window_inverted_colors_changed_cb), + ev_window); g_signal_connect (ev_window->priv->view, "notify::has-selection", G_CALLBACK (ev_window_has_selection_changed_cb), -- 2.43.5