[evince] Fix warnings with GTK+ 3.20
- From: Carlos Garcia Campos <carlosgc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evince] Fix warnings with GTK+ 3.20
- Date: Sun, 19 Jun 2016 11:27:27 +0000 (UTC)
commit f91addc511de57e679fb6e50781b5f1ed27a9b02
Author: Trinh Anh Ngoc <atw1990 gmail com>
Date: Sun Nov 29 10:33:52 2015 +0700
Fix warnings with GTK+ 3.20
https://bugzilla.gnome.org/show_bug.cgi?id=758793
cut-n-paste/libgd/gd-two-lines-renderer.c | 3 +++
libview/ev-view.c | 4 +++-
2 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/cut-n-paste/libgd/gd-two-lines-renderer.c b/cut-n-paste/libgd/gd-two-lines-renderer.c
index 564be88..aeb8a6f 100644
--- a/cut-n-paste/libgd/gd-two-lines-renderer.c
+++ b/cut-n-paste/libgd/gd-two-lines-renderer.c
@@ -331,7 +331,10 @@ gd_two_lines_renderer_get_preferred_width (GtkCellRenderer *cell,
/* Fetch the average size of a charachter */
context = gtk_widget_get_pango_context (widget);
+ gtk_style_context_save (style_context);
+ gtk_style_context_set_state (style_context, 0);
gtk_style_context_get (style_context, 0, "font", &font_desc, NULL);
+ gtk_style_context_restore (style_context);
metrics = pango_context_get_metrics (context, font_desc,
pango_context_get_language (context));
diff --git a/libview/ev-view.c b/libview/ev-view.c
index 04e4357..eee20ef 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -6663,9 +6663,11 @@ _ev_view_get_selection_colors (EvView *view,
GtkStateFlags state;
GtkStyleContext *context;
- state = gtk_widget_has_focus (widget) ? GTK_STATE_FLAG_SELECTED : GTK_STATE_FLAG_ACTIVE;
context = gtk_widget_get_style_context (widget);
gtk_style_context_save (context);
+ state = gtk_style_context_get_state (context) |
+ (gtk_widget_has_focus (widget) ? GTK_STATE_FLAG_SELECTED : GTK_STATE_FLAG_ACTIVE);
+ gtk_style_context_set_state (context, state);
if (bg_color)
gtk_style_context_get_background_color (context, state, bg_color);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]