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 672070 - Gradient system theme background looks wrong on vertical panels
Gradient system theme background looks wrong on vertical panels
Status: RESOLVED FIXED
Product: gnome-panel
Classification: Other
Component: panel
3.2.x
Other Linux
: Normal normal
: ---
Assigned To: Panel Maintainers
Panel Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-03-14 15:09 UTC by Peter Hurley
Modified: 2012-03-14 17:12 UTC
See Also:
GNOME target: ---
GNOME version: 3.1/3.2


Attachments
Vertical panel [with Radiance theme] (42.99 KB, image/png)
2012-03-14 15:09 UTC, Peter Hurley
  Details
[Patch 1/1] Add style class for orientation to menubar (2.45 KB, patch)
2012-03-14 15:12 UTC, Peter Hurley
none Details | Review
[Patch 2/5] Add style class for orientation to PanelAppletFrame (2.34 KB, patch)
2012-03-14 15:12 UTC, Peter Hurley
none Details | Review
[Patch 3/5] Add style class for orientation to PanelWidget (2.34 KB, patch)
2012-03-14 15:13 UTC, Peter Hurley
none Details | Review
[Patch 4/5] Add style class for orientation to PanelApplet (2.73 KB, patch)
2012-03-14 15:14 UTC, Peter Hurley
none Details | Review
[Patch 5/5] Add style class for orientation to PanelToplevel (2.52 KB, patch)
2012-03-14 15:15 UTC, Peter Hurley
none Details | Review
Screenshot of vertical panel [after patches] (56.76 KB, image/png)
2012-03-14 15:17 UTC, Peter Hurley
  Details
[PATCH v2 1/5] panel: Add style class for orientation to menubar (2.43 KB, patch)
2012-03-14 16:44 UTC, Peter Hurley
committed Details | Review
[PATCH v2 2/5] panel: Add style class for orientation to PanelAppletFrame (2.35 KB, patch)
2012-03-14 16:45 UTC, Peter Hurley
committed Details | Review
[PATCH v2 3/5] panel: Add style class for orientation to PanelWidget (2.29 KB, patch)
2012-03-14 16:46 UTC, Peter Hurley
committed Details | Review
[PATCH v2 4/5] libpanel-applet: Add style class for orientation to PanelApplet (2.64 KB, patch)
2012-03-14 16:47 UTC, Peter Hurley
committed Details | Review
[PATCH v2 5/5] panel: Add style class for orientation to PanelToplevel (2.51 KB, patch)
2012-03-14 16:49 UTC, Peter Hurley
committed Details | Review

Description Peter Hurley 2012-03-14 15:09:08 UTC
Created attachment 209729 [details]
Vertical panel [with Radiance theme]

Because there is no mechanism to change the system theme background based on the orientation of the panel, themed vertical panels look wrong.

Attached is a screenshot of a vertical panel themed with Radiance.
Comment 1 Peter Hurley 2012-03-14 15:12:02 UTC
Created attachment 209730 [details] [review]
[Patch 1/1] Add style class for orientation to menubar

Patch series for adding "horizontal" or "vertical" style classes to panel containers
Comment 2 Peter Hurley 2012-03-14 15:12:59 UTC
Created attachment 209731 [details] [review]
[Patch 2/5] Add style class for orientation to PanelAppletFrame
Comment 3 Peter Hurley 2012-03-14 15:13:49 UTC
Created attachment 209732 [details] [review]
[Patch 3/5] Add style class for orientation to PanelWidget
Comment 4 Peter Hurley 2012-03-14 15:14:28 UTC
Created attachment 209734 [details] [review]
[Patch 4/5] Add style class for orientation to PanelApplet
Comment 5 Peter Hurley 2012-03-14 15:15:08 UTC
Created attachment 209736 [details] [review]
[Patch 5/5] Add style class for orientation to PanelToplevel
Comment 6 Peter Hurley 2012-03-14 15:17:44 UTC
Created attachment 209740 [details]
Screenshot of vertical panel [after patches]

Naturally, changes to the system theme were necessary to reflect the new style classes.
Comment 7 Vincent Untz 2012-03-14 15:28:37 UTC
Review of attachment 209730 [details] [review]:

Can you make sure to add a "panel: " prefix to the first line in commit logs?

::: gnome-panel/panel-menu-bar-object.c
@@ +69,3 @@
                                         GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
         g_object_unref (provider);
 	gtk_style_context_add_class (context, "gnome-panel-menu-bar");

Add an empty line here, please.

@@ +344,3 @@
+		gtk_style_context_add_class (context, GTK_STYLE_CLASS_VERTICAL);
+		gtk_style_context_remove_class (context, GTK_STYLE_CLASS_HORIZONTAL);
+	}

Missing call to gtk_widget_reset_style()?
Comment 8 Vincent Untz 2012-03-14 15:30:32 UTC
Review of attachment 209732 [details] [review]:

::: gnome-panel/panel-widget.c
@@ +2540,3 @@
+	GtkStyleContext *context;
+
+	g_return_if_fail (PANEL_IS_WIDGET (panel_widget));

This test is not needed, really :-)
Comment 9 Vincent Untz 2012-03-14 15:34:45 UTC
Review of attachment 209734 [details] [review]:

::: libpanel-applet/panel-applet.c
@@ +679,1 @@
 	applet->priv->orient = orient;

I'd prefer to do "applet->priv->orient = orient;" before your changes. It just feels a bit more natural.
Comment 10 Vincent Untz 2012-03-14 15:36:35 UTC
Review of attachment 209734 [details] [review]:

::: libpanel-applet/panel-applet.c
@@ +2006,3 @@
 
+	context = gtk_widget_get_style_context (GTK_WIDGET (applet));
+	gtk_style_context_add_class (context, GTK_STYLE_CLASS_HORIZONTAL);

Forgot to say: I'd prefer to move this just before the gtk_container_add() at the end of the function.
Comment 11 Vincent Untz 2012-03-14 15:38:48 UTC
Review of attachment 209736 [details] [review]:

::: gnome-panel/panel-toplevel.c
@@ +4341,3 @@
 
+	context = gtk_widget_get_style_context (GTK_WIDGET (toplevel));
+	gtk_style_context_add_class (context, GTK_STYLE_CLASS_HORIZONTAL);

Please move this at the end of the function.

@@ +4818,3 @@
 	}
 
 	toplevel->priv->orientation = orientation;

Please add an empty line here.
Comment 12 Peter Hurley 2012-03-14 16:44:36 UTC
Created attachment 209752 [details] [review]
[PATCH v2 1/5] panel: Add style class for orientation to menubar

Patch series v2
Comment 13 Peter Hurley 2012-03-14 16:45:53 UTC
Created attachment 209753 [details] [review]
[PATCH v2 2/5] panel: Add style class for orientation to PanelAppletFrame
Comment 14 Peter Hurley 2012-03-14 16:46:37 UTC
Created attachment 209754 [details] [review]
[PATCH v2 3/5] panel: Add style class for orientation to PanelWidget
Comment 15 Peter Hurley 2012-03-14 16:47:58 UTC
Created attachment 209755 [details] [review]
[PATCH v2 4/5] libpanel-applet: Add style class for orientation to PanelApplet
Comment 16 Peter Hurley 2012-03-14 16:49:04 UTC
Created attachment 209756 [details] [review]
[PATCH v2 5/5] panel: Add style class for orientation to PanelToplevel
Comment 17 Vincent Untz 2012-03-14 17:12:16 UTC
Thanks, I've pushed all patches.