diff options
author | Kristian Høgsberg <krh@redhat.com> | 2005-08-06 18:14:24 (GMT) |
---|---|---|
committer | Kristian Høgsberg <krh@src.gnome.org> | 2005-08-06 18:14:24 (GMT) |
commit | 3f175f30d0eb1df7df8894c7ba0949e4cbd23e8f (patch) | |
tree | af5543846e9ba6b5a9ed52e590173334fc8f5c74 /shell/ev-view.c | |
parent | 0bd2e2a6aa946088aebf75e899b1b209e6c64b40 (diff) |
Change selection color on focus in and focus out events. Also, poppler now
2005-08-06 Kristian Høgsberg <krh@redhat.com>
* backend/ev-selection.c: (ev_selection_render_selection):
* backend/ev-selection.h:
* pdf/ev-poppler.cc:
* shell/ev-jobs.c: (ev_job_render_new):
* shell/ev-jobs.h:
* shell/ev-pixbuf-cache.c: (get_selection_colors),
(add_job_if_needed), (ev_pixbuf_cache_get_selection_pixbuf):
* shell/ev-view.c: (ev_view_focus_in), (ev_view_focus_out),
(ev_view_class_init):
Change selection color on focus in and focus out events. Also,
poppler now uses GdkColor for specifying the selection colors, so
drop some awkward conversion code.
Diffstat (limited to 'shell/ev-view.c')
-rw-r--r-- | shell/ev-view.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/shell/ev-view.c b/shell/ev-view.c index 5d7df6b..c4ae904 100644 --- a/shell/ev-view.c +++ b/shell/ev-view.c @@ -1566,6 +1566,28 @@ ev_view_button_release_event (GtkWidget *widget, return FALSE; } +static gint +ev_view_focus_in (GtkWidget *widget, + GdkEventFocus *event) +{ + if (EV_VIEW (widget)->pixbuf_cache) + ev_pixbuf_cache_style_changed (EV_VIEW (widget)->pixbuf_cache); + gtk_widget_queue_draw (widget); + + return FALSE; +} + +static gint +ev_view_focus_out (GtkWidget *widget, + GdkEventFocus *event) +{ + if (EV_VIEW (widget)->pixbuf_cache) + ev_pixbuf_cache_style_changed (EV_VIEW (widget)->pixbuf_cache); + gtk_widget_queue_draw (widget); + + return FALSE; +} + static gboolean ev_view_leave_notify_event (GtkWidget *widget, GdkEventCrossing *event) { @@ -1894,6 +1916,8 @@ ev_view_class_init (EvViewClass *class) widget_class->button_press_event = ev_view_button_press_event; widget_class->motion_notify_event = ev_view_motion_notify_event; widget_class->button_release_event = ev_view_button_release_event; + widget_class->focus_in_event = ev_view_focus_in; + widget_class->focus_out_event = ev_view_focus_out; widget_class->size_request = ev_view_size_request; widget_class->size_allocate = ev_view_size_allocate; widget_class->realize = ev_view_realize; |