[libwnck/wip/muktupavels/gtk4: 96/109] remove state argument from GtkStyleContext getter functions




commit f72b941544343128f6844639e04b06d54dd84f52
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Sun May 21 01:01:24 2017 +0300

    remove state argument from GtkStyleContext getter functions

 libwnck/pager.c    |  6 ++----
 libwnck/selector.c |  2 +-
 libwnck/tasklist.c | 13 +++++--------
 3 files changed, 8 insertions(+), 13 deletions(-)
---
diff --git a/libwnck/pager.c b/libwnck/pager.c
index c769d62..96e733e 100644
--- a/libwnck/pager.c
+++ b/libwnck/pager.c
@@ -395,12 +395,10 @@ _wnck_pager_get_padding (WnckPager *pager,
     {
       GtkWidget       *widget;
       GtkStyleContext *context;
-      GtkStateFlags    state;
 
       widget = GTK_WIDGET (pager);
       context = gtk_widget_get_style_context (widget);
-      state = gtk_style_context_get_state (context);
-      gtk_style_context_get_padding (context, state, padding);
+      gtk_style_context_get_padding (context, padding);
     }
   else
     {
@@ -978,7 +976,7 @@ draw_window (cairo_t            *cr,
   cairo_pop_group_to_source (cr);
   cairo_paint_with_alpha (cr, translucency);
 
-  gtk_style_context_get_color (context, state, &fg);
+  gtk_style_context_get_color (context, &fg);
   fg.alpha = translucency;
   gdk_cairo_set_source_rgba (cr, &fg);
   cairo_set_line_width (cr, 1.0);
diff --git a/libwnck/selector.c b/libwnck/selector.c
index b975b27..cef89d0 100644
--- a/libwnck/selector.c
+++ b/libwnck/selector.c
@@ -565,7 +565,7 @@ wnck_selector_workspace_name_changed (WnckWorkspace *workspace,
 
   gtk_style_context_save (context);
   gtk_style_context_set_state (context, GTK_STATE_FLAG_INSENSITIVE);
-  gtk_style_context_get_color (context, GTK_STATE_FLAG_INSENSITIVE, &color);
+  gtk_style_context_get_color (context, &color);
   gtk_style_context_restore (context);
 
   name = g_markup_escape_text (wnck_workspace_get_name (workspace), -1);
diff --git a/libwnck/tasklist.c b/libwnck/tasklist.c
index 8791b10..5f0efdf 100644
--- a/libwnck/tasklist.c
+++ b/libwnck/tasklist.c
@@ -415,18 +415,16 @@ static int
 get_css_width (GtkWidget *widget)
 {
   GtkStyleContext *context;
-  GtkStateFlags state;
   GtkBorder margin;
   GtkBorder border;
   GtkBorder padding;
   int min_width;
 
   context = gtk_widget_get_style_context (widget);
-  state = gtk_style_context_get_state (context);
 
-  gtk_style_context_get_margin (context, state, &margin);
-  gtk_style_context_get_border (context, state, &border);
-  gtk_style_context_get_padding (context, state, &padding);
+  gtk_style_context_get_margin (context, &margin);
+  gtk_style_context_get_border (context, &border);
+  gtk_style_context_get_padding (context, &padding);
 
   min_width = margin.left + margin.right;
   min_width += border.left + border.right;
@@ -448,7 +446,6 @@ get_char_width (GtkWidget *widget)
   style = gtk_widget_get_style_context (widget);
 
   gtk_style_context_get (style,
-                         gtk_style_context_get_state (style),
                          GTK_STYLE_PROPERTY_FONT,
                          &description,
                          NULL);
@@ -4413,14 +4410,14 @@ wnck_task_draw (GtkWidget *widget,
       context = gtk_widget_get_style_context (widget);
 
       state = gtk_style_context_get_state (context);
-      gtk_style_context_get_padding (context, state, &padding);
+      gtk_style_context_get_padding (context, &padding);
 
       state = (task->tasklist->priv->active_class_group == task) ?
               GTK_STATE_FLAG_ACTIVE : GTK_STATE_FLAG_NORMAL;
 
       gtk_style_context_save (context);
       gtk_style_context_set_state (context, state);
-      gtk_style_context_get_color (context, state, &color);
+      gtk_style_context_get_color (context, &color);
       gtk_style_context_restore (context);
 
       x = gtk_widget_get_allocated_width (widget) -


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]