[gtk+] Remove GtkWidget::draw-border
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Remove GtkWidget::draw-border
- Date: Wed, 18 Aug 2010 16:48:39 +0000 (UTC)
commit 501eeaff11fc4baba0d9769c7c0be85f1d05b582
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Aug 18 12:46:57 2010 -0400
Remove GtkWidget::draw-border
This is a never-used style property that came out of some old
themeing experiments, and handling it has some performance
overhead. Bug 426924
gtk/gtkrc.c | 5 ---
gtk/gtkwidget.c | 90 ++----------------------------------------------------
2 files changed, 4 insertions(+), 91 deletions(-)
---
diff --git a/gtk/gtkrc.c b/gtk/gtkrc.c
index 19d0f6c..d462136 100644
--- a/gtk/gtkrc.c
+++ b/gtk/gtkrc.c
@@ -903,11 +903,6 @@ _gtk_rc_init (void)
" text[PRELIGHT] = \"#ffffff\"\n"
"}\n"
"\n"
- /* Work around clipping of accelerator underlines */
- "style \"gtk-default-label-style\" {\n"
- " GtkWidget::draw-border = {0,0,0,1}\n"
- "}\n"
- "\n"
"class \"GtkProgressBar\" style : gtk \"gtk-default-progress-bar-style\"\n"
"class \"GtkEntry\" style : gtk \"gtk-default-entry-style\"\n"
"widget \"gtk-tooltip*\" style : gtk \"gtk-default-tooltips-style\"\n"
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 62ad959..98f1723 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -360,8 +360,6 @@ static void gtk_widget_queue_tooltip_query (GtkWidget *widg
static void gtk_widget_set_usize_internal (GtkWidget *widget,
gint width,
gint height);
-static void gtk_widget_get_draw_rectangle (GtkWidget *widget,
- GdkRectangle *rect);
static void gtk_widget_add_events_internal (GtkWidget *widget,
GdkDevice *device,
@@ -2498,21 +2496,6 @@ gtk_widget_class_init (GtkWidgetClass *klass)
GTK_PARAM_READWRITE));
/**
- * GtkWidget:draw-border:
- *
- * The "draw-border" style property defines the size of areas outside
- * the widget's allocation to draw.
- *
- * Since: 2.8
- */
- gtk_widget_class_install_style_property (klass,
- g_param_spec_boxed ("draw-border",
- P_("Draw Border"),
- P_("Size of areas outside the widget's allocation to draw"),
- GTK_TYPE_BORDER,
- GTK_PARAM_READABLE));
-
- /**
* GtkWidget:link-color:
*
* The "link-color" style property defines the color of unvisited links.
@@ -3712,57 +3695,6 @@ gtk_widget_queue_draw_area (GtkWidget *widget,
gdk_window_invalidate_rect (widget->window, &invalid_rect, TRUE);
}
-static void
-widget_add_child_draw_rectangle (GtkWidget *widget,
- GdkRectangle *rect)
-{
- GdkRectangle child_rect;
-
- if (!gtk_widget_get_mapped (widget) ||
- widget->window != widget->parent->window)
- return;
-
- gtk_widget_get_draw_rectangle (widget, &child_rect);
- gdk_rectangle_union (rect, &child_rect, rect);
-}
-
-static void
-gtk_widget_get_draw_rectangle (GtkWidget *widget,
- GdkRectangle *rect)
-{
- if (!gtk_widget_get_has_window (widget))
- {
- GtkBorder *draw_border = NULL;
-
- *rect = widget->allocation;
-
- gtk_widget_style_get (widget,
- "draw-border", &draw_border,
- NULL);
- if (draw_border)
- {
- rect->x -= draw_border->left;
- rect->y -= draw_border->top;
- rect->width += draw_border->left + draw_border->right;
- rect->height += draw_border->top + draw_border->bottom;
-
- gtk_border_free (draw_border);
- }
-
- if (GTK_IS_CONTAINER (widget))
- gtk_container_forall (GTK_CONTAINER (widget),
- (GtkCallback)widget_add_child_draw_rectangle,
- rect);
- }
- else
- {
- rect->x = 0;
- rect->y = 0;
- rect->width = widget->allocation.width;
- rect->height = widget->allocation.height;
- }
-}
-
/**
* gtk_widget_queue_draw:
* @widget: a #GtkWidget
@@ -3777,7 +3709,7 @@ gtk_widget_queue_draw (GtkWidget *widget)
g_return_if_fail (GTK_IS_WIDGET (widget));
- gtk_widget_get_draw_rectangle (widget, &rect);
+ gtk_widget_get_allocation (widget, &rect);
gtk_widget_queue_draw_area (widget,
rect.x, rect.y,
@@ -3938,26 +3870,12 @@ gtk_widget_queue_shallow_draw (GtkWidget *widget)
{
GdkRectangle rect;
cairo_region_t *region;
-
+
if (!gtk_widget_get_realized (widget))
return;
- gtk_widget_get_draw_rectangle (widget, &rect);
+ gtk_widget_get_allocation (widget, &rect);
- /* get_draw_rectangle() gives us window coordinates, we
- * need to convert to the coordinates that widget->allocation
- * is in.
- */
- if (gtk_widget_get_has_window (widget) && widget->parent)
- {
- int wx, wy;
-
- gdk_window_get_position (widget->window, &wx, &wy);
-
- rect.x += wx;
- rect.y += wy;
- }
-
region = cairo_region_create_rectangle (&rect);
gtk_widget_invalidate_widget_windows (widget, region);
cairo_region_destroy (region);
@@ -5207,7 +5125,7 @@ gtk_widget_region_intersect (GtkWidget *widget,
g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
g_return_val_if_fail (region != NULL, NULL);
- gtk_widget_get_draw_rectangle (widget, &rect);
+ gtk_widget_get_allocation (widget, &rect);
dest = cairo_region_create_rectangle (&rect);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]