[gnumeric] GUI: Add debug code for toolbar size.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] GUI: Add debug code for toolbar size.
- Date: Fri, 7 Feb 2014 01:03:10 +0000 (UTC)
commit d43a583ad3c809e025d074c52c316e884f0568a1
Author: Morten Welinder <terra gnome org>
Date: Fri Jan 31 21:56:15 2014 -0500
GUI: Add debug code for toolbar size.
src/wbc-gtk.c | 24 ++++++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/src/wbc-gtk.c b/src/wbc-gtk.c
index 1364301..84c4846 100644
--- a/src/wbc-gtk.c
+++ b/src/wbc-gtk.c
@@ -4204,6 +4204,27 @@ cb_tcm_hide (GtkWidget *widget, GtkWidget *box)
}
static void
+dump_size_tree (GtkWidget *w, gpointer indent_)
+{
+ int indent = GPOINTER_TO_INT (indent_);
+ int h1, h2;
+
+ g_printerr ("%*s", indent, "");
+ if (gtk_widget_get_name (w))
+ g_printerr ("\"%s\" ", gtk_widget_get_name (w));
+
+ gtk_widget_get_preferred_height (w, &h1, &h2);
+ g_printerr ("%s %p %d %d\n", g_type_name_from_instance ((GTypeInstance *)w), w, h1, h2);
+
+ if (GTK_IS_CONTAINER (w)) {
+ gtk_container_foreach (GTK_CONTAINER (w),
+ dump_size_tree,
+ GINT_TO_POINTER (indent + 2));
+ }
+}
+
+
+static void
toolbar_context_menu (GtkToolbar *tb, WBCGtk *gtk, GdkEvent *event)
{
GtkWidget *box = gtk_widget_get_parent (GTK_WIDGET (tb));
@@ -4221,6 +4242,9 @@ toolbar_context_menu (GtkToolbar *tb, WBCGtk *gtk, GdkEvent *event)
{ N_("Display to the right of sheets"), GTK_POS_RIGHT }
};
+ if (gnm_debug_flag ("toolbar-size"))
+ dump_size_tree (GTK_WIDGET (tb), GINT_TO_POINTER (0));
+
#ifdef HAVE_GTK_HANDLE_BOX_FLOAT_WINDOW
detached = (GTK_IS_HANDLE_BOX (box) &&
GTK_HANDLE_BOX (box)->child_detached);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]