[gtk+] Make GtkFrame propagate the "frame" style class to its header label
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Make GtkFrame propagate the "frame" style class to its header label
- Date: Mon, 17 Jan 2011 03:46:46 +0000 (UTC)
commit 07e62229dacd44d603703192581c36aa244cb774
Author: Carlos Garnacho <carlosg gnome org>
Date: Mon Jan 17 03:55:53 2011 +0100
Make GtkFrame propagate the "frame" style class to its header label
gtk/gtkframe.c | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkframe.c b/gtk/gtkframe.c
index 04950f6..5e6e2fc 100644
--- a/gtk/gtkframe.c
+++ b/gtk/gtkframe.c
@@ -78,6 +78,8 @@ static void gtk_frame_forall (GtkContainer *container,
gboolean include_internals,
GtkCallback callback,
gpointer callback_data);
+static GtkWidgetPath * gtk_frame_get_path_for_child (GtkContainer *container,
+ GtkWidget *child);
static void gtk_frame_compute_child_allocation (GtkFrame *frame,
GtkAllocation *child_allocation);
@@ -177,6 +179,7 @@ gtk_frame_class_init (GtkFrameClass *class)
container_class->remove = gtk_frame_remove;
container_class->forall = gtk_frame_forall;
+ container_class->get_path_for_child = gtk_frame_get_path_for_child;
class->compute_child_allocation = gtk_frame_real_compute_child_allocation;
@@ -334,6 +337,21 @@ gtk_frame_forall (GtkContainer *container,
(* callback) (priv->label_widget, callback_data);
}
+static GtkWidgetPath *
+gtk_frame_get_path_for_child (GtkContainer *container,
+ GtkWidget *child)
+{
+ GtkFramePrivate *priv = GTK_FRAME (container)->priv;
+ GtkWidgetPath *path;
+
+ path = GTK_CONTAINER_CLASS (gtk_frame_parent_class)->get_path_for_child (container, child);
+
+ if (child == priv->label_widget)
+ gtk_widget_path_iter_add_class (path, -1, GTK_STYLE_CLASS_FRAME);
+
+ return path;
+}
+
/**
* gtk_frame_set_label:
* @frame: a #GtkFrame
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]