[gtk+/rendering-cleanup-next: 92/199] frame: Remove unneeded is_drawable() check
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/rendering-cleanup-next: 92/199] frame: Remove unneeded is_drawable() check
- Date: Thu, 23 Sep 2010 21:26:49 +0000 (UTC)
commit 2f209b3b91bae05238c858d038f8f3aadc9829fc
Author: Benjamin Otte <otte redhat com>
Date: Wed Sep 8 15:32:50 2010 +0200
frame: Remove unneeded is_drawable() check
gtk/gtkframe.c | 91 +++++++++++++++++++++++++++-----------------------------
1 files changed, 44 insertions(+), 47 deletions(-)
---
diff --git a/gtk/gtkframe.c b/gtk/gtkframe.c
index b2945c5..49de29d 100644
--- a/gtk/gtkframe.c
+++ b/gtk/gtkframe.c
@@ -588,57 +588,54 @@ gtk_frame_paint (GtkWidget *widget,
GdkWindow *window;
gint x, y, width, height;
- if (gtk_widget_is_drawable (widget))
- {
- frame = GTK_FRAME (widget);
- priv = frame->priv;
+ frame = GTK_FRAME (widget);
+ priv = frame->priv;
- style = gtk_widget_get_style (widget);
- window = gtk_widget_get_window (widget);
- state = gtk_widget_get_state (widget);
+ style = gtk_widget_get_style (widget);
+ window = gtk_widget_get_window (widget);
+ state = gtk_widget_get_state (widget);
- x = priv->child_allocation.x - style->xthickness;
- y = priv->child_allocation.y - style->ythickness;
- width = priv->child_allocation.width + 2 * style->xthickness;
- height = priv->child_allocation.height + 2 * style->ythickness;
+ x = priv->child_allocation.x - style->xthickness;
+ y = priv->child_allocation.y - style->ythickness;
+ width = priv->child_allocation.width + 2 * style->xthickness;
+ height = priv->child_allocation.height + 2 * style->ythickness;
- if (priv->label_widget)
- {
- gfloat xalign;
- gint height_extra;
- gint x2;
-
- if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
- xalign = priv->label_xalign;
- else
- xalign = 1 - priv->label_xalign;
-
- height_extra = MAX (0, priv->label_allocation.height - style->ythickness)
- - priv->label_yalign * priv->label_allocation.height;
- y -= height_extra;
- height += height_extra;
-
- x2 = style->xthickness + (priv->child_allocation.width - priv->label_allocation.width - 2 * LABEL_PAD - 2 * LABEL_SIDE_PAD) * xalign + LABEL_SIDE_PAD;
- /* If the label is completely over or under the frame we can omit the gap */
- if (priv->label_yalign == 0.0 || priv->label_yalign == 1.0)
- gtk_paint_shadow (style, window,
- state, priv->shadow_type,
- area, widget, "frame",
- x, y, width, height);
- else
- gtk_paint_shadow_gap (style, window,
- state, priv->shadow_type,
- area, widget, "frame",
- x, y, width, height,
- GTK_POS_TOP,
- x2, priv->label_allocation.width + 2 * LABEL_PAD);
- }
- else
- gtk_paint_shadow (style, window,
- state, priv->shadow_type,
- area, widget, "frame",
- x, y, width, height);
+ if (priv->label_widget)
+ {
+ gfloat xalign;
+ gint height_extra;
+ gint x2;
+
+ if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
+ xalign = priv->label_xalign;
+ else
+ xalign = 1 - priv->label_xalign;
+
+ height_extra = MAX (0, priv->label_allocation.height - style->ythickness)
+ - priv->label_yalign * priv->label_allocation.height;
+ y -= height_extra;
+ height += height_extra;
+
+ x2 = style->xthickness + (priv->child_allocation.width - priv->label_allocation.width - 2 * LABEL_PAD - 2 * LABEL_SIDE_PAD) * xalign + LABEL_SIDE_PAD;
+ /* If the label is completely over or under the frame we can omit the gap */
+ if (priv->label_yalign == 0.0 || priv->label_yalign == 1.0)
+ gtk_paint_shadow (style, window,
+ state, priv->shadow_type,
+ area, widget, "frame",
+ x, y, width, height);
+ else
+ gtk_paint_shadow_gap (style, window,
+ state, priv->shadow_type,
+ area, widget, "frame",
+ x, y, width, height,
+ GTK_POS_TOP,
+ x2, priv->label_allocation.width + 2 * LABEL_PAD);
}
+ else
+ gtk_paint_shadow (style, window,
+ state, priv->shadow_type,
+ area, widget, "frame",
+ x, y, width, height);
}
static gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]