aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/text
diff options
context:
space:
mode:
authorjacob berkman <jacob@ximian.com>2001-06-07 23:50:51 +0800
committerJacob Berkman <jberkman@src.gnome.org>2001-06-07 23:50:51 +0800
commit011e2ddb2e7663b015f6c30730753188cc6f11ee (patch)
treeda35dc8a26c9cf55dee8f3e1714af96c6aff572f /widgets/text
parenta274139653e48e3e8160cf1614408339adbf1988 (diff)
downloadgsoc2013-evolution-011e2ddb2e7663b015f6c30730753188cc6f11ee.tar
gsoc2013-evolution-011e2ddb2e7663b015f6c30730753188cc6f11ee.tar.gz
gsoc2013-evolution-011e2ddb2e7663b015f6c30730753188cc6f11ee.tar.bz2
gsoc2013-evolution-011e2ddb2e7663b015f6c30730753188cc6f11ee.tar.lz
gsoc2013-evolution-011e2ddb2e7663b015f6c30730753188cc6f11ee.tar.xz
gsoc2013-evolution-011e2ddb2e7663b015f6c30730753188cc6f11ee.tar.zst
gsoc2013-evolution-011e2ddb2e7663b015f6c30730753188cc6f11ee.zip
we can ignore the border, as e-text takes care of that for us
2001-06-07 jacob berkman <jacob@ximian.com> * gal/e-text/e-entry.c (canvas_size_allocate): we can ignore the border, as e-text takes care of that for us (canvas_size_request): correctly handle when borders should be drawn * gal/e-text/e-completion-view.c (e_completion_view_paint): fix a small bug in the drawing-2-pixel-border change to my patch svn path=/trunk/; revision=10149
Diffstat (limited to 'widgets/text')
-rw-r--r--widgets/text/e-completion-view.c4
-rw-r--r--widgets/text/e-entry.c35
2 files changed, 15 insertions, 24 deletions
diff --git a/widgets/text/e-completion-view.c b/widgets/text/e-completion-view.c
index aac38ccec9..e62209efe6 100644
--- a/widgets/text/e-completion-view.c
+++ b/widgets/text/e-completion-view.c
@@ -84,8 +84,8 @@ e_completion_view_paint (GtkWidget *widget, GdkRectangle *area)
gdk_draw_rectangle (widget->window,
widget->style->black_gc,
FALSE, i, i,
- widget->allocation.width-1-i,
- widget->allocation.height-1-i);
+ widget->allocation.width-1-2*i,
+ widget->allocation.height-1-2*i);
}
diff --git a/widgets/text/e-entry.c b/widgets/text/e-entry.c
index 7d87b76587..648f8603ba 100644
--- a/widgets/text/e-entry.c
+++ b/widgets/text/e-entry.c
@@ -58,7 +58,6 @@
#endif
#define MIN_ENTRY_WIDTH 150
-#define INNER_BORDER 2
#define PARENT_TYPE gtk_table_get_type ()
@@ -143,8 +142,6 @@ static void
canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc,
EEntry *entry)
{
- gint xthick;
- gint ythick;
gnome_canvas_set_scroll_region (entry->canvas,
0, 0, alloc->width, alloc->height);
gtk_object_set (GTK_OBJECT (entry->item),
@@ -152,26 +149,18 @@ canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc,
"clip_height", (double) (alloc->height),
NULL);
- if (!entry->priv->draw_borders) {
- xthick = 0;
- ythick = 0;
- } else {
- xthick = widget->style->klass->xthickness;
- ythick = widget->style->klass->ythickness;
- }
-
switch (entry->priv->justification) {
case GTK_JUSTIFY_RIGHT:
e_canvas_item_move_absolute(GNOME_CANVAS_ITEM(entry->item),
- alloc->width - xthick, ythick);
+ alloc->width, 0);
break;
case GTK_JUSTIFY_CENTER:
e_canvas_item_move_absolute(GNOME_CANVAS_ITEM(entry->item),
- alloc->width / 2, ythick);
+ alloc->width / 2, 0);
break;
default:
e_canvas_item_move_absolute(GNOME_CANVAS_ITEM(entry->item),
- xthick, ythick);
+ 0, 0);
break;
}
}
@@ -180,21 +169,23 @@ static void
canvas_size_request (GtkWidget *widget, GtkRequisition *requisition,
EEntry *entry)
{
- int border;
+ int xthick, ythick;
g_return_if_fail (widget != NULL);
g_return_if_fail (GNOME_IS_CANVAS (widget));
g_return_if_fail (requisition != NULL);
- if (entry->priv->draw_borders)
- border = INNER_BORDER;
- else
- border = 0;
+ if (entry->priv->draw_borders) {
+ xthick = 2 * widget->style->klass->xthickness;
+ ythick = 2 * widget->style->klass->ythickness;
+ } else {
+ xthick = ythick = 0;
+ }
- requisition->width = MIN_ENTRY_WIDTH + (widget->style->klass->xthickness + border) * 2;
- requisition->height = (widget->style->font->ascent +
+ requisition->width = 2 + MIN_ENTRY_WIDTH + xthick;
+ requisition->height = (2 + widget->style->font->ascent +
widget->style->font->descent +
- (widget->style->klass->ythickness + border) * 2);
+ ythick);
}
static gint