From f6ea00f15f9bc92835b91112054e3b653fbd2a63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Wed, 22 Aug 2012 10:29:04 +0000 Subject: [PATCH] [GB.GTK] * BUG: Take Label.Padding and TextLabel.Padding properties into account correctly. git-svn-id: svn://localhost/gambas/trunk@5069 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- gb.gtk/src/glabel.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/gb.gtk/src/glabel.cpp b/gb.gtk/src/glabel.cpp index 7891a2155..a006eba06 100644 --- a/gb.gtk/src/glabel.cpp +++ b/gb.gtk/src/glabel.cpp @@ -31,7 +31,7 @@ static gboolean cb_expose(GtkWidget *draw, GdkEventExpose *e, gLabel *d) GtkStyle *style = gtk_widget_get_style(draw); GdkGC *gc; int vw, vh, lw, lh; - int fw = d->getFrameWidth(); + int fw = Max(d->getFramePadding(), d->getFrameWidth()); gc = gdk_gc_new(draw->window); gdk_gc_set_clip_rectangle(gc, &e->area); @@ -82,7 +82,7 @@ static gboolean cb_expose(GtkWidget *draw, GdkEventExpose *e, gLabel *d) vw += draw->allocation.x; vh += draw->allocation.y; - if (d->_transparent && d->_mask_dirty) + /*if (d->_transparent && d->_mask_dirty) { GdkBitmap *mask = gt_make_text_mask(draw->window, d->width(), d->height(), d->layout, vw, vh); @@ -105,7 +105,7 @@ static gboolean cb_expose(GtkWidget *draw, GdkEventExpose *e, gLabel *d) gtk_widget_shape_combine_mask(d->border, mask, 0, 0); g_object_unref(mask); d->_mask_dirty = false; - } + }*/ //fprintf(stderr, "draw label: %s: %d %d\n", d->name(), vw, vh); gdk_draw_layout(draw->window, gc, vw, vh, d->layout); @@ -179,7 +179,7 @@ void gLabel::updateSize(bool adjust, bool noresize_width) if (_locked || !textdata || !*textdata) return; - fw = getFrameWidth(); + fw = Max(getFrameWidth(), getFramePadding()); if (markup && _wrap) { @@ -234,8 +234,8 @@ void gLabel::setTransparent(bool vl) return; _transparent = vl; - gtk_widget_shape_combine_mask(border, NULL, 0, 0); - refresh(); + //gtk_widget_shape_combine_mask(border, NULL, 0, 0); + //refresh(); } char *gLabel::text() @@ -245,7 +245,7 @@ char *gLabel::text() void gLabel::setText(char *vl) { - bool no_text_before = !textdata || !*textdata; + //bool no_text_before = !textdata || !*textdata; g_free(textdata); @@ -257,11 +257,11 @@ void gLabel::setText(char *vl) updateLayout(); updateSize(); - if (_transparent) + /*if (_transparent) { if (no_text_before) gtk_widget_shape_combine_mask(border, NULL, 0, 0); - } + }*/ refresh(); }