Commits

Jeff Sparkes committed 8267a5d

Use Gtk style to draw horizontal line.

* redisplay-gtk.c (XLIKE_output_horizontal_line): Use a Gtk style
to draw the line.

* redisplay-xlike-inc.c (XLIKE_output_horizontal_line): Remove.

Comments (0)

Files changed (3)

src/ChangeLog.GTK

+2012-04-24  Jeff Sparkes  <jsparkes@gmail.com>
+
+	* redisplay-gtk.c (XLIKE_output_horizontal_line): Use a Gtk style
+	to draw the line.
+
+	* redisplay-xlike-inc.c (XLIKE_output_horizontal_line): Remove.
+
 2012-04-23  Jeff Sparkes  <jsparkes@gmail.com>
 
 	* redisplay-gtk.c (XLIKE_output_horizontal_line): Copied to here,

src/redisplay-gtk.c

 
   if (ypos3 - ypos2 > 0)
     {
-      gtk_fill_rectangle (cr, x, ypos3, width, rb->object.hline.thickness);
+      GtkStyle *style = FRAME_GTK_TEXT_WIDGET (f)->style;
+      XLIKE_WINDOW x_win = GET_XLIKE_WINDOW (f);
+
+      gtk_paint_hline (style, x_win, GTK_STATE_NORMAL, NULL,
+		       FRAME_GTK_TEXT_WIDGET (f), "hline", x, x + width,
+		       ypos3 + rb->object.hline.thickness / 2);
+      /* gtk_fill_rectangle (cr, x, ypos3, width, rb->object.hline.thickness); */
     }
 }
 

src/redisplay-xlike-inc.c

     }
 }
 
-/*****************************************************************************
- XLIKE_output_horizontal_line
-
- Output a horizontal line in the foreground of its face.
- ****************************************************************************/
-static void
-XLIKE_output_horizontal_line (struct window *w, struct display_line *dl,
-			      struct rune *rb)
-{
-  struct frame *f = XFRAME (w->frame);
-  struct device *d = XDEVICE (f->device);
-
-  XLIKE_DISPLAY dpy = GET_XLIKE_X_DISPLAY (d);
-  XLIKE_WINDOW x_win = GET_XLIKE_WINDOW (f);
-  XLIKE_GC gc;
-
-  int x = rb->xpos;
-  int width = rb->width;
-  int height = XLIKE_DISPLAY_LINE_HEIGHT (dl);
-  int ypos1, ypos2, ypos3, ypos4;
-
-  ypos1 = XLIKE_DISPLAY_LINE_YPOS (dl);
-  ypos2 = ypos1 + rb->object.hline.yoffset;
-  ypos3 = ypos2 + rb->object.hline.thickness;
-  ypos4 = dl->ypos + dl->descent - dl->clip;
-
-  /* First clear the area not covered by the line. */
-  if (height - rb->object.hline.thickness > 0)
-    {
-      gc = XLIKE_get_gc (f, Qnil,
-			 WINDOW_FACE_CACHEL_FOREGROUND (w, rb->findex),
-			 Qnil, Qnil, Qnil, Qnil);
-
-      if (ypos2 - ypos1 > 0)
-	XLIKE_FILL_RECTANGLE (dpy, x_win, gc, x, ypos1, width, ypos2 - ypos1);
-      if (ypos4 - ypos3 > 0)
-	XLIKE_FILL_RECTANGLE (dpy, x_win, gc, x, ypos1, width, ypos2 - ypos1);
-    }
-
-#ifdef THIS_IS_GTK
-  {
-    GtkStyle *style = FRAME_GTK_TEXT_WIDGET (f)->style;
-    gtk_paint_hline (style, x_win, GTK_STATE_NORMAL, NULL,
-		     FRAME_GTK_TEXT_WIDGET (f), "hline", x, x + width, ypos2);
-  }
-#else /* THIS_IS_X */
-  /* Now draw the line. */
-  gc = XLIKE_get_gc (f, Qnil, WINDOW_FACE_CACHEL_BACKGROUND (w, rb->findex),
-		     Qnil, Qnil, Qnil, Qnil);
-
-  if (ypos2 < ypos1)
-    ypos2 = ypos1;
-  if (ypos3 > ypos4)
-    ypos3 = ypos4;
-
-  if (ypos3 - ypos2 > 0)
-    XLIKE_FILL_RECTANGLE (dpy, x_win, gc, x, ypos2, width, ypos3 - ypos2);
-#endif /* THIS_IS_X */
-}
-
 static void
 XLIKE_clear_frame_window (Lisp_Object window)
 {
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.