summaryrefslogtreecommitdiff
path: root/gtk/gtkgrid.c
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2011-01-12 22:28:43 +0100
committerCarlos Garnacho <carlosg@gnome.org>2011-01-12 22:28:43 +0100
commitefae64be666e7d7489f1a7b8b19d6a9d760a6cda (patch)
tree1799d0cd7fb216556552fe41a5182fa78f026d8b /gtk/gtkgrid.c
parent8ad724ebcc07a5cd167bfde8c9387a9b8da96fdd (diff)
downloadgtk+-efae64be666e7d7489f1a7b8b19d6a9d760a6cda.tar.gz
Set vertical/horizontal class on all widgets overriding GtkOrientable::orientation
This is so g_object_set() on that property leaves widgets' style in a meaningful state. Fully fixes bugĀ 639157.
Diffstat (limited to 'gtk/gtkgrid.c')
-rw-r--r--gtk/gtkgrid.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gtk/gtkgrid.c b/gtk/gtkgrid.c
index 3557c16949..525f970df6 100644
--- a/gtk/gtkgrid.c
+++ b/gtk/gtkgrid.c
@@ -187,10 +187,23 @@ gtk_grid_set_orientation (GtkGrid *grid,
GtkOrientation orientation)
{
GtkGridPrivate *priv = grid->priv;
+ GtkStyleContext *context;
if (priv->orientation != orientation)
{
priv->orientation = orientation;
+ context = gtk_widget_get_style_context (GTK_WIDGET (grid));
+
+ if (grid->priv->orientation == GTK_ORIENTATION_VERTICAL)
+ {
+ gtk_style_context_add_class (context, GTK_STYLE_CLASS_VERTICAL);
+ gtk_style_context_remove_class (context, GTK_STYLE_CLASS_HORIZONTAL);
+ }
+ else
+ {
+ gtk_style_context_add_class (context, GTK_STYLE_CLASS_HORIZONTAL);
+ gtk_style_context_remove_class (context, GTK_STYLE_CLASS_VERTICAL);
+ }
g_object_notify (G_OBJECT (grid), "orientation");
}