[gtk+] inspector: Show full allocation + clip
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] inspector: Show full allocation + clip
- Date: Thu, 21 Jan 2016 03:54:55 +0000 (UTC)
commit e33bda3078c64a723edde86906d6a551d9f3ffd5
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Jan 20 22:52:05 2016 -0500
inspector: Show full allocation + clip
Previously, we were only showing the size of the allocation
and clip area. But there is no good reason to hide the position
of these rectangles, so add them, in the traditional format
of X geometry strings: wxh+x+y
gtk/inspector/misc-info.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/gtk/inspector/misc-info.c b/gtk/inspector/misc-info.c
index d8aa3ec..7ad9d75 100644
--- a/gtk/inspector/misc-info.c
+++ b/gtk/inspector/misc-info.c
@@ -133,21 +133,25 @@ state_flags_changed (GtkWidget *w, GtkStateFlags old_flags, GtkInspectorMiscInfo
static void
allocation_changed (GtkWidget *w, GdkRectangle *allocation, GtkInspectorMiscInfo *sl)
{
+ GtkAllocation alloc;
GtkAllocation clip;
gchar *size_label;
GEnumClass *class;
GEnumValue *value;
- size_label = g_strdup_printf ("%d × %d",
- gtk_widget_get_allocated_width (w),
- gtk_widget_get_allocated_height (w));
+ gtk_widget_get_allocation (w, &alloc);
+ size_label = g_strdup_printf ("%d × %d +%d +%d",
+ alloc.width, alloc.height,
+ alloc.x, alloc.y);
gtk_label_set_label (GTK_LABEL (sl->priv->allocated_size), size_label);
g_free (size_label);
gtk_widget_get_clip (w, &clip);
- size_label = g_strdup_printf ("%d × %d", clip.width, clip.height);
+ size_label = g_strdup_printf ("%d × %d +%d +%d",
+ clip.width, clip.height,
+ clip.x, clip.y);
gtk_label_set_label (GTK_LABEL (sl->priv->clip_area), size_label);
g_free (size_label);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]