aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2012-06-14 12:48:16 +0800
committerCosimo Cecchi <cosimoc@gnome.org>2012-06-18 22:27:01 +0800
commit4a053b128659299147d1537baea3e865c989b3d6 (patch)
tree27d0c89bae18a1136cd7a25199527156a95ef197
parent86f388e13a518e6853df8e429f504fcd74853c29 (diff)
downloadgsoc2013-evolution-4a053b128659299147d1537baea3e865c989b3d6.tar.gz
gsoc2013-evolution-4a053b128659299147d1537baea3e865c989b3d6.tar.zst
gsoc2013-evolution-4a053b128659299147d1537baea3e865c989b3d6.zip
e-text: remove unused draw_borders property
Nobody ever sets it.
-rw-r--r--widgets/text/e-text.c76
-rw-r--r--widgets/text/e-text.h2
-rw-r--r--widgets/text/gal-a11y-e-text.c10
3 files changed, 6 insertions, 82 deletions
diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c
index f37b61734f..8c312ddc71 100644
--- a/widgets/text/e-text.c
+++ b/widgets/text/e-text.c
@@ -101,7 +101,6 @@ enum {
PROP_MAX_LINES,
PROP_WIDTH,
PROP_HEIGHT,
- PROP_DRAW_BORDERS,
PROP_ALLOW_NEWLINES,
PROP_DRAW_BACKGROUND,
PROP_CURSOR_POS,
@@ -506,11 +505,6 @@ get_bounds (EText *text,
text->text_cx = text->cx;
text->text_cy = text->cy;
- if (text->draw_borders) {
- text->text_cx += BORDER_INDENT;
- text->text_cy += BORDER_INDENT;
- }
-
/* Bounds */
if (text->clip) {
@@ -830,16 +824,6 @@ e_text_set_property (GObject *object,
needs_reflow = 1;
break;
- case PROP_DRAW_BORDERS:
- if (text->draw_borders != g_value_get_boolean (value)) {
- text->draw_borders = g_value_get_boolean (value);
- text->needs_calc_height = 1;
- text->needs_redraw = 1;
- needs_reflow = 1;
- needs_update = 1;
- }
- break;
-
case PROP_DRAW_BACKGROUND:
if (text->draw_background != g_value_get_boolean (value)) {
text->draw_background = g_value_get_boolean (value);
@@ -1001,10 +985,6 @@ e_text_get_property (GObject *object,
text->clip_height : text->height);
break;
- case PROP_DRAW_BORDERS:
- g_value_set_boolean (value, text->draw_borders);
- break;
-
case PROP_DRAW_BACKGROUND:
g_value_set_boolean (value, text->draw_background);
break;
@@ -1186,20 +1166,8 @@ show_pango_rectangle (EText *text,
gint clip_width, clip_height;
clip_width = text->clip_width;
- if (clip_width >= 0 && text->draw_borders) {
- clip_width -= 6;
- if (clip_width < 0)
- clip_width = 0;
- }
-
clip_height = text->clip_height;
- if (clip_height >= 0 && text->draw_borders) {
- clip_height -= 6;
- if (clip_height < 0)
- clip_height = 0;
- }
-
if (x1 < new_xofs_edit)
new_xofs_edit = x1;
@@ -1269,7 +1237,7 @@ e_text_draw (GnomeCanvasItem *item,
( text->rgba & 0xff) / 255.0);
}
- if (text->draw_borders || text->draw_background) {
+ if (text->draw_background) {
gdouble thisx = item->x1 - x;
gdouble thisy = item->y1 - y;
gdouble thiswidth, thisheight;
@@ -1280,15 +1248,6 @@ e_text_draw (GnomeCanvasItem *item,
"height", &thisheight,
NULL);
- if (text->draw_borders) {
-
- gtk_paint_shadow (style, cr,
- GTK_STATE_NORMAL, GTK_SHADOW_IN,
- widget, "entry",
- thisx, thisy, thiswidth, thisheight);
-
- }
-
if (text->draw_background) {
gtk_paint_flat_box (style, cr,
state, GTK_SHADOW_NONE,
@@ -1482,11 +1441,6 @@ get_position_from_xy (EText *text,
gint index;
gint trailing;
- if (text->draw_borders) {
- x -= BORDER_INDENT;
- y -= BORDER_INDENT;
- }
-
x -= text->xofs;
y -= text->yofs;
@@ -1609,7 +1563,7 @@ start_editing (EText *text)
window = gtk_widget_get_window (
GTK_WIDGET (GNOME_CANVAS_ITEM (text)->canvas));
- if (text->default_cursor_shown && (!text->draw_borders)) {
+ if (text->default_cursor_shown) {
gdk_window_set_cursor (window, text->i_cursor);
text->default_cursor_shown = FALSE;
}
@@ -1634,7 +1588,7 @@ e_text_stop_editing (EText *text)
text->revert = NULL;
text->editing = FALSE;
- if ((!text->default_cursor_shown) && (!text->draw_borders)) {
+ if (!text->default_cursor_shown) {
GdkWindow *window;
window = gtk_widget_get_window (
@@ -1725,7 +1679,7 @@ e_text_event (GnomeCanvasItem *item,
g_source_remove (text->timeout_id);
text->timeout_id = 0;
}
- if (text->show_cursor || text->draw_borders) {
+ if (text->show_cursor) {
text->show_cursor = FALSE;
text->needs_redraw = 1;
gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (text));
@@ -1886,7 +1840,7 @@ e_text_event (GnomeCanvasItem *item,
break;
case GDK_ENTER_NOTIFY:
text->pointer_in = TRUE;
- if (text->editing || text->draw_borders) {
+ if (text->editing) {
if (text->default_cursor_shown) {
gdk_window_set_cursor (window, text->i_cursor);
text->default_cursor_shown = FALSE;
@@ -1895,7 +1849,7 @@ e_text_event (GnomeCanvasItem *item,
break;
case GDK_LEAVE_NOTIFY:
text->pointer_in = FALSE;
- if (text->editing || text->draw_borders) {
+ if (text->editing) {
if (!text->default_cursor_shown) {
gdk_window_set_cursor (
window, text->default_cursor);
@@ -2921,11 +2875,6 @@ e_text_command (ETextEventProcessor *tep,
}
clip_width = text->clip_width;
- if (clip_width >= 0 && text->draw_borders) {
- clip_width -= 6;
- if (clip_width < 0)
- clip_width = 0;
- }
if (xpos + pango_pos.width - clip_width > text->xofs_edit) {
text->xofs_edit = xpos + pango_pos.width - clip_width;
@@ -2945,12 +2894,6 @@ e_text_command (ETextEventProcessor *tep,
else
clip_height = text->clip_height;
- if (clip_height >= 0 && text->draw_borders) {
- clip_height -= 6;
- if (clip_height < 0)
- clip_height = 0;
- }
-
if (ypos - clip_height > text->yofs_edit) {
text->yofs_edit = ypos - clip_height;
}
@@ -3200,13 +3143,6 @@ e_text_class_init (ETextClass *class)
0.0, G_MAXDOUBLE, 0.0,
G_PARAM_READWRITE));
- g_object_class_install_property (gobject_class, PROP_DRAW_BORDERS,
- g_param_spec_boolean ("draw_borders",
- "Draw borders",
- "Draw borders",
- FALSE,
- G_PARAM_READWRITE));
-
g_object_class_install_property (gobject_class, PROP_ALLOW_NEWLINES,
g_param_spec_boolean ("allow_newlines",
"Allow newlines",
diff --git a/widgets/text/e-text.h b/widgets/text/e-text.h
index 618d1d47ad..68753f683b 100644
--- a/widgets/text/e-text.h
+++ b/widgets/text/e-text.h
@@ -83,7 +83,6 @@ G_BEGIN_DECLS
* line_wrap boolean RW Line wrap when not editing.
* break_characters string RW List of characters to optionally break on.
* max_lines gint RW Number of lines possible when doing line wrap.
- * draw_borders boolean RW Whether to draw borders.
* draw_background boolean RW Whether to draw the background.
*/
@@ -161,7 +160,6 @@ struct _EText {
guint pointer_in : 1; /* Is the pointer currently over us? */
guint default_cursor_shown : 1; /* Is the default cursor currently shown? */
- guint draw_borders : 1; /* Draw borders? */
guint draw_background : 1; /* Draw background? */
guint line_wrap : 1; /* Do line wrap */
diff --git a/widgets/text/gal-a11y-e-text.c b/widgets/text/gal-a11y-e-text.c
index ba7e7dd35f..49274ae4b7 100644
--- a/widgets/text/gal-a11y-e-text.c
+++ b/widgets/text/gal-a11y-e-text.c
@@ -551,11 +551,6 @@ et_get_character_extents (AtkText *text,
*width = pango_pos.width;
*height = pango_pos.height;
- if (etext->draw_borders) {
- *x += 3; /*BORDER_INDENT;*/
- *y += 3; /*BORDER_INDENT;*/
- }
-
*x += etext->xofs;
*y += etext->yofs;
@@ -630,11 +625,6 @@ et_get_offset_at_point (AtkText *text,
else
return -1;
- if (etext->draw_borders) {
- x -= 3; /*BORDER_INDENT;*/
- y -= 3; /*BORDER_INDENT;*/
- }
-
x -= etext->xofs;
y -= etext->yofs;