[libwnck] don't use deprecated style properties



commit 6281a8aaf7cb90f443a97b4daff190a68b073a02
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Sun Dec 20 00:09:07 2015 +0200

    don't use deprecated style properties
    
    https://bugzilla.gnome.org/show_bug.cgi?id=759680

 configure.ac       |    2 +-
 libwnck/pager.c    |   70 +++++++++-------------------------------------------
 libwnck/tasklist.c |   13 ---------
 3 files changed, 13 insertions(+), 72 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 6a8f1a4..09c4ada 100644
--- a/configure.ac
+++ b/configure.ac
@@ -148,7 +148,7 @@ AC_SUBST(XLIB_CFLAGS)
 AC_SUBST(XLIB_LIBS)
 
 PKG_CHECK_MODULES([LIBWNCK],[
-       gtk+-3.0 >= 3.10
+       gtk+-3.0 >= 3.19.5
        glib-2.0 >= 2.32
        gobject-2.0 >= 2.13.0
        $CAIRO_XLIB_XRENDER_PACKAGE
diff --git a/libwnck/pager.c b/libwnck/pager.c
index de6ae04..8675093 100644
--- a/libwnck/pager.c
+++ b/libwnck/pager.c
@@ -505,7 +505,6 @@ wnck_pager_size_request  (GtkWidget      *widget,
   int workspace_width, workspace_height;
   int n_rows;
   GtkBorder padding;
-  int focus_width;
 
   pager = WNCK_PAGER (widget);
 
@@ -551,12 +550,6 @@ wnck_pager_size_request  (GtkWidget      *widget,
   _wnck_pager_get_padding (pager, &padding);
   requisition->width += padding.left + padding.right;
   requisition->height += padding.top + padding.bottom;
-
-  gtk_widget_style_get (widget,
-                       "focus-line-width", &focus_width,
-                       NULL);
-  requisition->width  += 2 * focus_width;
-  requisition->height += 2 * focus_width;
 }
 
 static GtkSizeRequestMode
@@ -595,7 +588,6 @@ wnck_pager_get_preferred_width_for_height (GtkWidget *widget,
   int n_rows;
   int spaces_per_row;
   int workspace_width, workspace_height;
-  int focus_width;
   GtkBorder padding;
   int width = 0;
 
@@ -621,12 +613,6 @@ wnck_pager_get_preferred_width_for_height (GtkWidget *widget,
       spaces_per_row = 1;
     }
 
-  gtk_widget_style_get (widget,
-                       "focus-line-width", &focus_width,
-                       NULL);
-  height -= 2 * focus_width;
-  width += 2 * focus_width;
-
   _wnck_pager_get_padding (pager, &padding);
   height -= padding.top + padding.bottom;
   width += padding.left + padding.right;
@@ -664,7 +650,6 @@ wnck_pager_get_preferred_height_for_width (GtkWidget *widget,
   int n_rows;
   int spaces_per_row;
   int workspace_width, workspace_height;
-  int focus_width;
   GtkBorder padding;
   int height = 0;
 
@@ -690,12 +675,6 @@ wnck_pager_get_preferred_height_for_width (GtkWidget *widget,
       spaces_per_row = 1;
     }
 
-  gtk_widget_style_get (widget,
-                       "focus-line-width", &focus_width,
-                       NULL);
-  width -= 2 * focus_width;
-  height += 2 * focus_width;
-
   _wnck_pager_get_padding (pager, &padding);
   width -= padding.left + padding.right;
   height += padding.top + padding.bottom;
@@ -723,18 +702,14 @@ wnck_pager_size_allocate (GtkWidget      *widget,
 {
   WnckPager *pager;
   int workspace_size;
-  int focus_width;
   GtkBorder padding;
   int width;
   int height;
 
   pager = WNCK_PAGER (widget);
 
-  gtk_widget_style_get (GTK_WIDGET (pager),
-                       "focus-line-width", &focus_width,
-                       NULL);
-  width  = allocation->width  - 2 * focus_width;
-  height = allocation->height - 2 * focus_width;
+  width = allocation->width;
+  height = allocation->height;
 
   _wnck_pager_get_padding (pager, &padding);
   width  -= padding.left + padding.right;
@@ -782,7 +757,6 @@ get_workspace_rect (WnckPager    *pager,
   int col, row;
   GtkAllocation allocation;
   GtkBorder padding;
-  int focus_width;
 
   widget = GTK_WIDGET (pager);
 
@@ -800,9 +774,6 @@ get_workspace_rect (WnckPager    *pager,
     }
 
   _wnck_pager_get_padding (pager, &padding);
-  gtk_widget_style_get (widget,
-                       "focus-line-width", &focus_width,
-                       NULL);
 
   if (!pager->priv->show_all_workspaces)
     {
@@ -812,10 +783,10 @@ get_workspace_rect (WnckPager    *pager,
 
       if (active_space && space == wnck_workspace_get_number (active_space))
        {
-         rect->x = focus_width + padding.left;
-         rect->y = focus_width + padding.top;
-         rect->width = allocation.width - 2 * focus_width - padding.left - padding.right;
-         rect->height = allocation.height - 2 * focus_width - padding.top - padding.bottom;
+         rect->x = padding.left;
+         rect->y = padding.top;
+         rect->width = allocation.width - padding.left - padding.right;
+         rect->height = allocation.height - padding.top - padding.bottom;
        }
       else
        {
@@ -828,8 +799,8 @@ get_workspace_rect (WnckPager    *pager,
       return;
     }
 
-  hsize = allocation.width - 2 * focus_width;
-  vsize = allocation.height - 2 * focus_width;
+  hsize = allocation.width;
+  vsize = allocation.height;
 
   if (pager->priv->shadow_type != GTK_SHADOW_NONE)
     {
@@ -883,9 +854,6 @@ get_workspace_rect (WnckPager    *pager,
        rect->height = vsize - rect->y;
     }
 
-  rect->x += focus_width;
-  rect->y += focus_width;
-
   if (pager->priv->shadow_type != GTK_SHADOW_NONE)
     {
       rect->x += padding.left;
@@ -1133,23 +1101,14 @@ workspace_at_point (WnckPager *pager,
   int i;
   int n_spaces;
   GtkAllocation allocation;
-  int focus_width;
   GtkBorder padding;
 
   widget = GTK_WIDGET (pager);
 
   gtk_widget_get_allocation (widget, &allocation);
 
-  gtk_widget_style_get (GTK_WIDGET (pager),
-                       "focus-line-width", &focus_width,
-                       NULL);
   _wnck_pager_get_padding (pager, &padding);
 
-  padding.left += focus_width;
-  padding.right += focus_width;
-  padding.top += focus_width;
-  padding.bottom += focus_width;
-
   n_spaces = wnck_screen_get_workspace_count (pager->priv->screen);
 
   i = 0;
@@ -1458,7 +1417,6 @@ wnck_pager_draw (GtkWidget *widget,
   gboolean first;
   GtkStyleContext *context;
   GtkStateFlags state;
-  int focus_width;
 
   pager = WNCK_PAGER (widget);
 
@@ -1469,9 +1427,7 @@ wnck_pager_draw (GtkWidget *widget,
 
   state = gtk_widget_get_state_flags (widget);
   context = gtk_widget_get_style_context (widget);
-  gtk_widget_style_get (widget,
-                       "focus-line-width", &focus_width,
-                       NULL);
+
   gtk_style_context_save (context);
   gtk_style_context_set_state (context, state);
 
@@ -1488,11 +1444,9 @@ wnck_pager_draw (GtkWidget *widget,
   if (pager->priv->shadow_type != GTK_SHADOW_NONE)
     {
       cairo_save (cr);
-      gtk_render_frame (context, cr,
-                       focus_width,
-                       focus_width,
-                        gtk_widget_get_allocated_width (widget) - 2 * focus_width,
-                        gtk_widget_get_allocated_height (widget) - 2 * focus_width);
+      gtk_render_frame (context, cr, 0, 0,
+                        gtk_widget_get_allocated_width (widget),
+                        gtk_widget_get_allocated_height (widget));
       cairo_restore (cr);
     }
 
diff --git a/libwnck/tasklist.c b/libwnck/tasklist.c
index daf65d9..aacaf33 100644
--- a/libwnck/tasklist.c
+++ b/libwnck/tasklist.c
@@ -3723,7 +3723,6 @@ wnck_task_create_widgets (WnckTask *task, GtkReliefStyle relief)
   GtkWidget *hbox;
   GdkPixbuf *pixbuf;
   char *text;
-  GtkCssProvider *provider;
   static const GtkTargetEntry targets[] = {
     { "application/x-wnck-window-id", 0, 0 }
   };
@@ -3739,18 +3738,6 @@ wnck_task_create_widgets (WnckTask *task, GtkReliefStyle relief)
   g_object_add_weak_pointer (G_OBJECT (task->button),
                              (void**) &task->button);
 
-  provider = gtk_css_provider_new ();
-  gtk_css_provider_load_from_data (provider,
-                                   "#tasklist-button {\n"
-                                   " -GtkWidget-focus-line-width: 0px;\n"
-                                   " -GtkWidget-focus-padding: 0px;\n"
-                                   "}",
-                                   -1, NULL);
-  gtk_style_context_add_provider (gtk_widget_get_style_context (task->button),
-                                  GTK_STYLE_PROVIDER (provider),
-                                  GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
-  g_object_unref (provider);
-
   gtk_widget_set_name (task->button,
                       "tasklist-button");
 


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