comparison src/gui_gtk_x11.c @ 12317:2a8890b80923 v8.0.1038

patch 8.0.1038: strike-through text not supported commit https://github.com/vim/vim/commit/cf4b00c856ef714482d8d060332ac9a4d74e6b88 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Sep 2 18:33:56 2017 +0200 patch 8.0.1038: strike-through text not supported Problem: Strike-through text not supported. Solution: Add support for the "strikethrough" attribute. (Christian Brabandt, Ken Takata)
author Christian Brabandt <cb@256bit.org>
date Sat, 02 Sep 2017 18:45:04 +0200
parents ac8b2f9c1409
children 2c020bc30f62
comparison
equal deleted inserted replaced
12316:a1d3a6d6af2c 12317:2a8890b80923
5906 } 5906 }
5907 gdk_gc_set_foreground(gui.text_gc, gui.fgcolor); 5907 gdk_gc_set_foreground(gui.text_gc, gui.fgcolor);
5908 #endif 5908 #endif
5909 } 5909 }
5910 5910
5911 /* Draw a strikethrough line */
5912 if (flags & DRAW_STRIKE)
5913 {
5914 #if GTK_CHECK_VERSION(3,0,0)
5915 cairo_set_line_width(cr, 1.0);
5916 cairo_set_line_cap(cr, CAIRO_LINE_CAP_BUTT);
5917 cairo_set_source_rgba(cr,
5918 gui.spcolor->red, gui.spcolor->green, gui.spcolor->blue,
5919 gui.spcolor->alpha);
5920 cairo_move_to(cr, FILL_X(col), y + 1 - gui.char_height/2 + 0.5);
5921 cairo_line_to(cr, FILL_X(col + cells), y + 1 - gui.char_height/2 + 0.5);
5922 cairo_stroke(cr);
5923 #else
5924 gdk_gc_set_foreground(gui.text_gc, gui.spcolor);
5925 gdk_draw_line(gui.drawarea->window, gui.text_gc,
5926 FILL_X(col), y + 1 - gui.char_height/2,
5927 FILL_X(col + cells), y + 1 - gui.char_height/2);
5928 gdk_gc_set_foreground(gui.text_gc, gui.fgcolor);
5929 #endif
5930 }
5931
5911 /* Underline: draw a line at the bottom of the character cell. */ 5932 /* Underline: draw a line at the bottom of the character cell. */
5912 if (flags & DRAW_UNDERL) 5933 if (flags & DRAW_UNDERL)
5913 { 5934 {
5914 /* When p_linespace is 0, overwrite the bottom row of pixels. 5935 /* When p_linespace is 0, overwrite the bottom row of pixels.
5915 * Otherwise put the line just below the character. */ 5936 * Otherwise put the line just below the character. */
5916 if (p_linespace > 1) 5937 if (p_linespace > 1)
5917 y -= p_linespace - 1; 5938 y -= p_linespace - 1;
5918 #if GTK_CHECK_VERSION(3,0,0) 5939 #if GTK_CHECK_VERSION(3,0,0)
5919 { 5940 cairo_set_line_width(cr, 1.0);
5920 cairo_set_line_width(cr, 1.0); 5941 cairo_set_line_cap(cr, CAIRO_LINE_CAP_BUTT);
5921 cairo_set_line_cap(cr, CAIRO_LINE_CAP_BUTT); 5942 cairo_set_source_rgba(cr,
5922 cairo_set_source_rgba(cr, 5943 gui.fgcolor->red, gui.fgcolor->green, gui.fgcolor->blue,
5923 gui.fgcolor->red, gui.fgcolor->green, gui.fgcolor->blue, 5944 gui.fgcolor->alpha);
5924 gui.fgcolor->alpha); 5945 cairo_move_to(cr, FILL_X(col), y + 0.5);
5925 cairo_move_to(cr, FILL_X(col), y + 0.5); 5946 cairo_line_to(cr, FILL_X(col + cells), y + 0.5);
5926 cairo_line_to(cr, FILL_X(col + cells), y + 0.5); 5947 cairo_stroke(cr);
5927 cairo_stroke(cr);
5928 }
5929 #else 5948 #else
5930 gdk_draw_line(gui.drawarea->window, gui.text_gc, 5949 gdk_draw_line(gui.drawarea->window, gui.text_gc,
5931 FILL_X(col), y, 5950 FILL_X(col), y,
5932 FILL_X(col + cells) - 1, y); 5951 FILL_X(col + cells) - 1, y);
5933 #endif 5952 #endif