[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Extending fringe backgrounds to scroll bar gaps
From: |
YAMAMOTO Mitsuharu |
Subject: |
Re: Extending fringe backgrounds to scroll bar gaps |
Date: |
Thu, 21 Jun 2007 11:18:39 +0900 |
User-agent: |
Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shijō) APEL/10.6 Emacs/22.1.50 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI) |
>>>>> On Thu, 21 Jun 2007 00:42:27 +0200, "Juanma Barranquero" <address@hidden>
>>>>> said:
>> Yes. But as I can't test it with W32, could Windows users try the
>> following patch?
> I've had to use "do {...} while (0)" in the definition of
> w32_fill_area() in w32term.h in order to compile with your patch.
Thanks for testing.
> As for results, see the attached image. I don't think that was the
> intended effect...
Could you try the following one?
YAMAMOTO Mitsuharu
address@hidden
Index: src/w32term.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/w32term.c,v
retrieving revision 1.260
diff -c -p -r1.260 w32term.c
*** src/w32term.c 20 Jun 2007 08:32:59 -0000 1.260
--- src/w32term.c 21 Jun 2007 01:33:18 -0000
*************** w32_draw_fringe_bitmap (w, row, p)
*** 682,687 ****
--- 682,719 ----
hdc = get_frame_dc (f);
+ if (p->bx >= 0 && !p->overlay_p)
+ {
+ int bx = p->bx, nx = p->nx;
+
+ /* If the fringe is adjacent to the left (right) scroll bar of a
+ leftmost (rightmost, respectively) window, then extend its
+ background to the gap between the fringe and the bar. */
+ if ((WINDOW_LEFTMOST_P (w)
+ && WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w))
+ || (WINDOW_RIGHTMOST_P (w)
+ && WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w)))
+ {
+ int sb_width = WINDOW_CONFIG_SCROLL_BAR_WIDTH (w);
+
+ if (sb_width > 0)
+ {
+ int left = WINDOW_SCROLL_BAR_AREA_X (w);
+ int width = (WINDOW_CONFIG_SCROLL_BAR_COLS (w)
+ * FRAME_COLUMN_WIDTH (f));
+
+ if (left + width == bx)
+ {
+ bx = left + sb_width;
+ nx += width - sb_width;
+ }
+ else if (bx + nx == left)
+ nx += width - sb_width;
+ }
+ }
+ w32_fill_area (f, hdc, face->background, bx, p->by, nx, p->ny);
+ }
+
/* Must clip because of partially visible lines. */
rowY = WINDOW_TO_FRAME_PIXEL_Y (w, row->y);
if (p->y < rowY)
*************** w32_draw_fringe_bitmap (w, row, p)
*** 699,710 ****
else
w32_clip_to_row (w, row, -1, hdc);
- if (p->bx >= 0 && !p->overlay_p)
- {
- w32_fill_area (f, hdc, face->background,
- p->bx, p->by, p->nx, p->ny);
- }
-
if (p->which && p->which < max_fringe_bmp)
{
HBITMAP pixmap = fringe_bmp[p->which];
--- 731,736 ----
*************** x_scroll_bar_create (w, top, left, width
*** 3637,3642 ****
--- 3663,3669 ----
XSETINT (bar->start, 0);
XSETINT (bar->end, 0);
bar->dragging = Qnil;
+ bar->fringe_extended_p = Qnil;
/* Requires geometry to be set before call to create the real window */
*************** w32_set_vertical_scroll_bar (w, portion,
*** 3700,3705 ****
--- 3727,3733 ----
struct scroll_bar *bar;
int top, height, left, sb_left, width, sb_width;
int window_y, window_height;
+ int fringe_extended_p;
/* Get window dimensions. */
window_box (w, -1, 0, &window_y, 0, &window_height);
*************** w32_set_vertical_scroll_bar (w, portion,
*** 3719,3727 ****
/* Compute the left edge of the scroll bar. */
if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w))
! sb_left = left + width - sb_width - (width - sb_width) / 2;
else
! sb_left = left + (width - sb_width) / 2;
/* Does the scroll bar exist yet? */
if (NILP (w->vertical_scroll_bar))
--- 3747,3766 ----
/* Compute the left edge of the scroll bar. */
if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w))
! sb_left = left + (WINDOW_RIGHTMOST_P (w) ? width - sb_width : 0);
else
! sb_left = left + (WINDOW_LEFTMOST_P (w) ? 0 : width - sb_width);
!
! if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w))
! fringe_extended_p = (WINDOW_LEFTMOST_P (w)
! && WINDOW_LEFT_FRINGE_WIDTH (w)
! && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w)
! || WINDOW_LEFT_MARGIN_COLS (w) == 0));
! else
! fringe_extended_p = (WINDOW_RIGHTMOST_P (w)
! && WINDOW_RIGHT_FRINGE_WIDTH (w)
! && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w)
! || WINDOW_RIGHT_MARGIN_COLS (w) == 0));
/* Does the scroll bar exist yet? */
if (NILP (w->vertical_scroll_bar))
*************** w32_set_vertical_scroll_bar (w, portion,
*** 3731,3737 ****
if (width > 0 && height > 0)
{
hdc = get_frame_dc (f);
! w32_clear_area (f, hdc, left, top, width, height);
release_frame_dc (f, hdc);
}
UNBLOCK_INPUT;
--- 3770,3779 ----
if (width > 0 && height > 0)
{
hdc = get_frame_dc (f);
! if (fringe_extended_p)
! w32_clear_area (f, hdc, sb_left, top, sb_width, height);
! else
! w32_clear_area (f, hdc, left, top, width, height);
release_frame_dc (f, hdc);
}
UNBLOCK_INPUT;
*************** w32_set_vertical_scroll_bar (w, portion,
*** 3750,3756 ****
if ( XINT (bar->left) == sb_left
&& XINT (bar->top) == top
&& XINT (bar->width) == sb_width
! && XINT (bar->height) == height )
{
/* Redraw after clear_frame. */
if (!my_show_window (f, hwnd, SW_NORMAL))
--- 3792,3799 ----
if ( XINT (bar->left) == sb_left
&& XINT (bar->top) == top
&& XINT (bar->width) == sb_width
! && XINT (bar->height) == height
! && !NILP (bar->fringe_extended_p) == fringe_extended_p )
{
/* Redraw after clear_frame. */
if (!my_show_window (f, hwnd, SW_NORMAL))
*************** w32_set_vertical_scroll_bar (w, portion,
*** 3767,3777 ****
hdc = get_frame_dc (f);
/* Since Windows scroll bars are smaller than the space reserved
for them on the frame, we have to clear "under" them. */
! w32_clear_area (f, hdc,
! left,
! top,
! width,
! height);
release_frame_dc (f, hdc);
}
/* Make sure scroll bar is "visible" before moving, to ensure the
--- 3810,3819 ----
hdc = get_frame_dc (f);
/* Since Windows scroll bars are smaller than the space reserved
for them on the frame, we have to clear "under" them. */
! if (fringe_extended_p)
! w32_clear_area (f, hdc, sb_left, top, sb_width, height);
! else
! w32_clear_area (f, hdc, left, top, width, height);
release_frame_dc (f, hdc);
}
/* Make sure scroll bar is "visible" before moving, to ensure the
*************** w32_set_vertical_scroll_bar (w, portion,
*** 3801,3806 ****
--- 3843,3850 ----
UNBLOCK_INPUT;
}
}
+ bar->fringe_extended_p = fringe_extended_p ? Qt : Qnil;
+
w32_set_scroll_bar_thumb (bar, portion, position, whole);
XSETVECTOR (w->vertical_scroll_bar, bar);
Index: src/w32term.h
===================================================================
RCS file: /cvsroot/emacs/emacs/src/w32term.h,v
retrieving revision 1.68
diff -c -p -r1.68 w32term.h
*** src/w32term.h 22 Feb 2007 22:50:15 -0000 1.68
--- src/w32term.h 21 Jun 2007 01:33:18 -0000
*************** struct scroll_bar {
*** 487,492 ****
--- 487,496 ----
place where the user grabbed it. If the handle isn't currently
being dragged, this is Qnil. */
Lisp_Object dragging;
+
+ /* t if the background of the fringe that is adjacent to a scroll
+ bar is extended to the gap between the fringe and the bar. */
+ Lisp_Object fringe_extended_p;
};
/* The number of elements a vector holding a struct scroll_bar needs. */
*************** extern void w32_fill_rect ();
*** 576,589 ****
extern void w32_clear_window ();
#define w32_fill_area(f,hdc,pix,x,y,nx,ny) \
! { \
RECT rect; \
rect.left = x; \
rect.top = y; \
rect.right = x + nx; \
rect.bottom = y + ny; \
w32_fill_rect (f,hdc,pix,&rect); \
! }
#define w32_clear_rect(f,hdc,lprect) \
w32_fill_rect (f,hdc,f->output_data.x->background_pixel,lprect)
--- 580,593 ----
extern void w32_clear_window ();
#define w32_fill_area(f,hdc,pix,x,y,nx,ny) \
! do { \
RECT rect; \
rect.left = x; \
rect.top = y; \
rect.right = x + nx; \
rect.bottom = y + ny; \
w32_fill_rect (f,hdc,pix,&rect); \
! } while (0)
#define w32_clear_rect(f,hdc,lprect) \
w32_fill_rect (f,hdc,f->output_data.x->background_pixel,lprect)
- Re: Extending fringe backgrounds to scroll bar gaps, YAMAMOTO Mitsuharu, 2007/06/08
- Re: Extending fringe backgrounds to scroll bar gaps, Richard Stallman, 2007/06/10
- Re: Extending fringe backgrounds to scroll bar gaps, YAMAMOTO Mitsuharu, 2007/06/14
- Re: Extending fringe backgrounds to scroll bar gaps, Richard Stallman, 2007/06/15
- Re: Extending fringe backgrounds to scroll bar gaps, YAMAMOTO Mitsuharu, 2007/06/15
- Re: Extending fringe backgrounds to scroll bar gaps, Juanma Barranquero, 2007/06/20
- Re: Extending fringe backgrounds to scroll bar gaps,
YAMAMOTO Mitsuharu <=
- Re: Extending fringe backgrounds to scroll bar gaps, Juanma Barranquero, 2007/06/21
- Re: Extending fringe backgrounds to scroll bar gaps, YAMAMOTO Mitsuharu, 2007/06/21
- Re: Extending fringe backgrounds to scroll bar gaps, Juanma Barranquero, 2007/06/21
- Re: Extending fringe backgrounds to scroll bar gaps, Juanma Barranquero, 2007/06/21
- Re: Extending fringe backgrounds to scroll bar gaps, YAMAMOTO Mitsuharu, 2007/06/21
- Re: Extending fringe backgrounds to scroll bar gaps, Juanma Barranquero, 2007/06/22
- Re: Extending fringe backgrounds to scroll bar gaps, YAMAMOTO Mitsuharu, 2007/06/22
- Re: Extending fringe backgrounds to scroll bar gaps, Juanma Barranquero, 2007/06/25