diff options
| author | Chong Yidong | 2010-10-08 01:02:56 -0400 |
|---|---|---|
| committer | Chong Yidong | 2010-10-08 01:02:56 -0400 |
| commit | 389454fb57bafee5a0b1a22adb4ed90504ee6e71 (patch) | |
| tree | 08b3b40a8d44a480cdf013cfc260af883dd0e76d /src | |
| parent | 775f75bcbc8e935ce49571ee32640edf7ee185e3 (diff) | |
| download | emacs-389454fb57bafee5a0b1a22adb4ed90504ee6e71.tar.gz emacs-389454fb57bafee5a0b1a22adb4ed90504ee6e71.zip | |
* xterm.c (x_draw_relief_rect): If box width is larger than 1,
draw the outermost line using the black relief, for legibility.
Omit drawing the four corner pixels.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/xterm.c | 55 |
2 files changed, 51 insertions, 10 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 6f388cd7283..2effe2ea84c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2010-10-08 Chong Yidong <cyd@stupidchicken.com> | ||
| 2 | |||
| 3 | * xterm.c (x_draw_relief_rect): If box width is larger than 1, | ||
| 4 | draw the outermost line using the black relief, for legibility. | ||
| 5 | Omit drawing the four corner pixels. | ||
| 6 | |||
| 1 | 2010-10-04 Chong Yidong <cyd@stupidchicken.com> | 7 | 2010-10-04 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 8 | ||
| 3 | * keyboard.c (echo_prompt): Function moved into read_key_sequence. | 9 | * keyboard.c (echo_prompt): Function moved into read_key_sequence. |
diff --git a/src/xterm.c b/src/xterm.c index abeb7712bc8..8b28b1afa27 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -1942,18 +1942,35 @@ x_draw_relief_rect (struct frame *f, | |||
| 1942 | gc = f->output_data.x->black_relief.gc; | 1942 | gc = f->output_data.x->black_relief.gc; |
| 1943 | XSetClipRectangles (dpy, gc, 0, 0, clip_rect, 1, Unsorted); | 1943 | XSetClipRectangles (dpy, gc, 0, 0, clip_rect, 1, Unsorted); |
| 1944 | 1944 | ||
| 1945 | /* This code is more complicated than it has to be, because of two | ||
| 1946 | minor hacks to make the boxes look nicer: (i) if width > 1, draw | ||
| 1947 | the outermost line using the black relief. (ii) Omit the four | ||
| 1948 | corner pixels. */ | ||
| 1949 | |||
| 1945 | /* Top. */ | 1950 | /* Top. */ |
| 1946 | if (top_p) | 1951 | if (top_p) |
| 1947 | for (i = 0; i < width; ++i) | 1952 | { |
| 1948 | XDrawLine (dpy, window, gc, | 1953 | if (width == 1) |
| 1949 | left_x + i * left_p, top_y + i, | 1954 | XDrawLine (dpy, window, gc, |
| 1950 | right_x + 1 - i * right_p, top_y + i); | 1955 | left_x + (left_p ? 1 : 0), top_y, |
| 1956 | right_x + (right_p ? 0 : 1), top_y); | ||
| 1957 | |||
| 1958 | for (i = 1; i < width; ++i) | ||
| 1959 | XDrawLine (dpy, window, gc, | ||
| 1960 | left_x + i * left_p, top_y + i, | ||
| 1961 | right_x + 1 - i * right_p, top_y + i); | ||
| 1962 | } | ||
| 1951 | 1963 | ||
| 1952 | /* Left. */ | 1964 | /* Left. */ |
| 1953 | if (left_p) | 1965 | if (left_p) |
| 1954 | for (i = 0; i < width; ++i) | 1966 | { |
| 1955 | XDrawLine (dpy, window, gc, | 1967 | if (width == 1) |
| 1956 | left_x + i, top_y + i, left_x + i, bottom_y - i + 1); | 1968 | XDrawLine (dpy, window, gc, left_x, top_y + 1, left_x, bottom_y); |
| 1969 | |||
| 1970 | for (i = (width > 1 ? 1 : 0); i < width; ++i) | ||
| 1971 | XDrawLine (dpy, window, gc, | ||
| 1972 | left_x + i, top_y + i, left_x + i, bottom_y - i + 1); | ||
| 1973 | } | ||
| 1957 | 1974 | ||
| 1958 | XSetClipMask (dpy, gc, None); | 1975 | XSetClipMask (dpy, gc, None); |
| 1959 | if (raised_p) | 1976 | if (raised_p) |
| @@ -1962,12 +1979,30 @@ x_draw_relief_rect (struct frame *f, | |||
| 1962 | gc = f->output_data.x->white_relief.gc; | 1979 | gc = f->output_data.x->white_relief.gc; |
| 1963 | XSetClipRectangles (dpy, gc, 0, 0, clip_rect, 1, Unsorted); | 1980 | XSetClipRectangles (dpy, gc, 0, 0, clip_rect, 1, Unsorted); |
| 1964 | 1981 | ||
| 1982 | if (width > 1) | ||
| 1983 | { | ||
| 1984 | /* Outermost top line. */ | ||
| 1985 | if (top_p) | ||
| 1986 | XDrawLine (dpy, window, gc, | ||
| 1987 | left_x + (left_p ? 1 : 0), top_y, | ||
| 1988 | right_x + (right_p ? 0 : 1), top_y); | ||
| 1989 | |||
| 1990 | /* Outermost left line. */ | ||
| 1991 | if (left_p) | ||
| 1992 | XDrawLine (dpy, window, gc, left_x, top_y + 1, left_x, bottom_y); | ||
| 1993 | } | ||
| 1994 | |||
| 1965 | /* Bottom. */ | 1995 | /* Bottom. */ |
| 1966 | if (bot_p) | 1996 | if (bot_p) |
| 1967 | for (i = 0; i < width; ++i) | 1997 | { |
| 1968 | XDrawLine (dpy, window, gc, | 1998 | XDrawLine (dpy, window, gc, |
| 1969 | left_x + i * left_p, bottom_y - i, | 1999 | left_x + (left_p ? 1 : 0), bottom_y, |
| 1970 | right_x + 1 - i * right_p, bottom_y - i); | 2000 | right_x + (right_p ? 0 : 1), bottom_y); |
| 2001 | for (i = 1; i < width; ++i) | ||
| 2002 | XDrawLine (dpy, window, gc, | ||
| 2003 | left_x + i * left_p, bottom_y - i, | ||
| 2004 | right_x + 1 - i * right_p, bottom_y - i); | ||
| 2005 | } | ||
| 1971 | 2006 | ||
| 1972 | /* Right. */ | 2007 | /* Right. */ |
| 1973 | if (right_p) | 2008 | if (right_p) |