After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 640664 - Port to GtkStyleContext
Port to GtkStyleContext
Status: RESOLVED FIXED
Product: libwnck
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: libwnck maintainers
libwnck maintainers
Depends on:
Blocks:
 
 
Reported: 2011-01-26 18:49 UTC by Carlos Garcia Campos
Modified: 2011-02-03 12:42 UTC
See Also:
GNOME target: 3.0
GNOME version: ---


Attachments
tasklist: Port to GtkStyleContext (8.70 KB, patch)
2011-01-26 20:33 UTC, Carlos Garcia Campos
none Details | Review
selector: Port to GtkStyleContext (5.33 KB, patch)
2011-01-27 11:54 UTC, Carlos Garcia Campos
none Details | Review
pager: Port to GtkStyleContext (14.75 KB, patch)
2011-01-27 16:50 UTC, Carlos Garcia Campos
none Details | Review
tasklist: Port to GtkStyleContext (9.23 KB, patch)
2011-02-01 18:48 UTC, Carlos Garcia Campos
none Details | Review
selector: Port to GtkStyleContext (5.34 KB, patch)
2011-02-01 18:49 UTC, Carlos Garcia Campos
committed Details | Review
pager: Port to GtkStyleContext (14.68 KB, patch)
2011-02-01 18:49 UTC, Carlos Garcia Campos
reviewed Details | Review
tasklist: Port to GtkStyleContext (9.27 KB, patch)
2011-02-02 17:34 UTC, Carlos Garcia Campos
committed Details | Review
pager: Port to GtkStyleContext (14.67 KB, patch)
2011-02-02 17:35 UTC, Carlos Garcia Campos
none Details | Review
pager: Port to GtkStyleContext (16.07 KB, patch)
2011-02-02 17:54 UTC, Carlos Garcia Campos
committed Details | Review

Description Carlos Garcia Campos 2011-01-26 18:49:12 UTC
gtk3 branch needs to be ported to GtkStyleContext
Comment 1 Vincent Untz 2011-01-26 20:20:23 UTC
s/gtk3 branch/master/ :-)
Comment 2 Carlos Garcia Campos 2011-01-26 20:33:30 UTC
Created attachment 179405 [details] [review]
tasklist: Port to GtkStyleContext
Comment 3 Carlos Garcia Campos 2011-01-27 11:54:00 UTC
Created attachment 179424 [details] [review]
selector: Port to GtkStyleContext
Comment 4 Carlos Garcia Campos 2011-01-27 16:50:30 UTC
Created attachment 179443 [details] [review]
pager: Port to GtkStyleContext
Comment 5 Carlos Garcia Campos 2011-02-01 18:48:19 UTC
Created attachment 179817 [details] [review]
tasklist: Port to GtkStyleContext

Updated to current git master
Comment 6 Carlos Garcia Campos 2011-02-01 18:49:07 UTC
Created attachment 179818 [details] [review]
selector: Port to GtkStyleContext

Updated to current git master
Comment 7 Carlos Garcia Campos 2011-02-01 18:49:59 UTC
Created attachment 179819 [details] [review]
pager: Port to GtkStyleContext

Updated to current git master
Comment 8 Vincent Untz 2011-02-01 23:28:11 UTC
Review of attachment 179818 [details] [review]:

::: libwnck/selector.c
@@ +1221,3 @@
+                                   "#gnome-panel-window-menu-menu-bar {\n"
+                                   " border-width: 0px; }",
+                                   -1, NULL);

We're losing this part:
  GtkMenuBar::shadow-type = none
  GtkMenuBar::internal-padding = 0

Can't  we use something like:
  -GtkMenuBar-shadow-type: none;
  -GtkMenuBar-internal-padding: 0;

?

(Also, we were not using border-width before, is it needed?)
Comment 9 Vincent Untz 2011-02-01 23:44:17 UTC
Review of attachment 179819 [details] [review]:

::: libwnck/pager.c
@@ +735,3 @@
     {
+      rect->x += padding.left + padding.right;
+      rect->y += padding.top + padding.bottom;

That's wrong: we only want left and top there.

@@ +859,3 @@
+
+    c1 = gtk_symbolic_color_new_literal (&bg);
+    c2 = gtk_symbolic_color_new_shade (c1, 1.3);

Will 1.3 make it lighter enough? I didn't apply the patch, but does it look the same before & after the patch?

@@ +1001,2 @@
+      xthickness = focus_width + padding.left;
+      ythickness = focus_width + padding.top;

I think we need to rework this function a bit more: xthickness is used later on in a place where we should use padding.right. Same for y/bottom.

@@ +1089,3 @@
+  c1 = gtk_symbolic_color_new_literal (&bg);
+
+  c2 = gtk_symbolic_color_new_shade (c1, 0.7);

Same question as above: is 0.7 dark enough?

@@ +1118,3 @@
   is_current = (space == wnck_screen_get_active_workspace (pager->priv->screen));
 
+  state = 0;

state = GTK_STATE_FLAG_NORMAL;
(this is clearer)
Comment 10 Vincent Untz 2011-02-01 23:53:46 UTC
Review of attachment 179817 [details] [review]:

I don't know how the last part of the patch behaves as I'd need to try it out. But generally looks good.

::: libwnck/tasklist.c
@@ +3849,3 @@
+
+      gtk_style_context_get_padding (context, gtk_widget_get_state_flags (widget), &padding);
+      state = (task->tasklist->priv->active_class_group == task) ? GTK_STATE_FLAG_ACTIVE : 0;

Use GTK_STATE_FLAG_NORMAL instead of 0.
Comment 11 Carlos Garcia Campos 2011-02-02 07:53:07 UTC
(In reply to comment #8)
> Review of attachment 179818 [details] [review]:
> 
> ::: libwnck/selector.c
> @@ +1221,3 @@
> +                                   "#gnome-panel-window-menu-menu-bar {\n"
> +                                   " border-width: 0px; }",
> +                                   -1, NULL);
> 
> We're losing this part:
>   GtkMenuBar::shadow-type = none
>   GtkMenuBar::internal-padding = 0
> 
> Can't  we use something like:
>   -GtkMenuBar-shadow-type: none;
>   -GtkMenuBar-internal-padding: 0;
> 
> ?

We don't need it, it breaks the background with transparent panels, I had to do the same in gnome-panel for the main menu applet. 

> (Also, we were not using border-width before, is it needed?)

There wasn't border-width with GtkStyle I think
Comment 12 Carlos Garcia Campos 2011-02-02 07:58:53 UTC
(In reply to comment #9)
> Review of attachment 179819 [details] [review]:
> 
> ::: libwnck/pager.c
> @@ +735,3 @@
>      {
> +      rect->x += padding.left + padding.right;
> +      rect->y += padding.top + padding.bottom;
> 
> That's wrong: we only want left and top there.

right

> @@ +859,3 @@
> +
> +    c1 = gtk_symbolic_color_new_literal (&bg);
> +    c2 = gtk_symbolic_color_new_shade (c1, 1.3);
> 
> Will 1.3 make it lighter enough? I didn't apply the patch, but does it look the
> same before & after the patch?

I'm using the same values of gtk+, so it should be the same than before when using style->light or style->dark, see:

http://git.gnome.org/browse/gtk+/tree/gtk/gtkstyle.c#n71
http://git.gnome.org/browse/gtk+/tree/gtk/gtkstyle.c#n735

> @@ +1001,2 @@
> +      xthickness = focus_width + padding.left;
> +      ythickness = focus_width + padding.top;
> 
> I think we need to rework this function a bit more: xthickness is used later on
> in a place where we should use padding.right. Same for y/bottom.

Ok, I'll look at it.

> @@ +1089,3 @@
> +  c1 = gtk_symbolic_color_new_literal (&bg);
> +
> +  c2 = gtk_symbolic_color_new_shade (c1, 0.7);
> 
> Same question as above: is 0.7 dark enough?

Same answer :-)

> @@ +1118,3 @@
>    is_current = (space == wnck_screen_get_active_workspace
> (pager->priv->screen));
> 
> +  state = 0;
> 
> state = GTK_STATE_FLAG_NORMAL;
> (this is clearer)

Ok
Comment 13 Vincent Untz 2011-02-02 10:20:27 UTC
(In reply to comment #12)
> (In reply to comment #9)
> > @@ +859,3 @@
> > +
> > +    c1 = gtk_symbolic_color_new_literal (&bg);
> > +    c2 = gtk_symbolic_color_new_shade (c1, 1.3);
> > 
> > Will 1.3 make it lighter enough? I didn't apply the patch, but does it look the
> > same before & after the patch?
> 
> I'm using the same values of gtk+, so it should be the same than before when
> using style->light or style->dark, see:
> 
> http://git.gnome.org/browse/gtk+/tree/gtk/gtkstyle.c#n71
> http://git.gnome.org/browse/gtk+/tree/gtk/gtkstyle.c#n735

Yeah, I know, but I've been hit by this somewhere else, where the result was a tiny bit different different. Ah, but it could because it was style->mid... Anyway. I've filed bug 641228 to have gtk+ define some macros for those values.
Comment 14 Carlos Garcia Campos 2011-02-02 17:34:23 UTC
Created attachment 179908 [details] [review]
tasklist: Port to GtkStyleContext

Updated patch according to review
Comment 15 Carlos Garcia Campos 2011-02-02 17:35:13 UTC
Created attachment 179909 [details] [review]
pager: Port to GtkStyleContext

Updated patch according to review
Comment 16 Carlos Garcia Campos 2011-02-02 17:54:46 UTC
Created attachment 179910 [details] [review]
pager: Port to GtkStyleContext

I forgot this comment, sorry.

@@ +1001,2 @@
+      xthickness = focus_width + padding.left;
+      ythickness = focus_width + padding.top;

I think we need to rework this function a bit more: xthickness is used later on
in a place where we should use padding.right. Same for y/bottom.
Comment 17 Vincent Untz 2011-02-03 12:41:50 UTC
Thanks, I've committed everything -- with small fixes for tasklist.c