diff options
| author | Kim F. Storm | 2006-05-17 22:24:13 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2006-05-17 22:24:13 +0000 |
| commit | 914dee7a62684fad3fe2b543373d750f27ee69eb (patch) | |
| tree | 89ddff5789ae44737682696d315cc65fc4dd3433 /src | |
| parent | e410360421363eff50dafe5397b26af0e1b42a2c (diff) | |
| download | emacs-914dee7a62684fad3fe2b543373d750f27ee69eb.tar.gz emacs-914dee7a62684fad3fe2b543373d750f27ee69eb.zip | |
(display_tool_bar_line): Restore entire tool-bar geometry when
backtracking in case last image doesn't fit on line.
(display_tool_bar_line): Don't adjust tool-bar height by more than
height of one frame default line. From: MIYOSHI Masanori.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index c0caaf4daf2..87764e5ecb6 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -9492,6 +9492,7 @@ display_tool_bar_line (it, height) | |||
| 9492 | while (it->current_x < max_x) | 9492 | while (it->current_x < max_x) |
| 9493 | { | 9493 | { |
| 9494 | int x_before, x, n_glyphs_before, i, nglyphs; | 9494 | int x_before, x, n_glyphs_before, i, nglyphs; |
| 9495 | struct it it_before; | ||
| 9495 | 9496 | ||
| 9496 | /* Get the next display element. */ | 9497 | /* Get the next display element. */ |
| 9497 | if (!get_next_display_element (it)) | 9498 | if (!get_next_display_element (it)) |
| @@ -9505,9 +9506,10 @@ display_tool_bar_line (it, height) | |||
| 9505 | /* Produce glyphs. */ | 9506 | /* Produce glyphs. */ |
| 9506 | x_before = it->current_x; | 9507 | x_before = it->current_x; |
| 9507 | n_glyphs_before = it->glyph_row->used[TEXT_AREA]; | 9508 | n_glyphs_before = it->glyph_row->used[TEXT_AREA]; |
| 9509 | it_before = *it; | ||
| 9508 | PRODUCE_GLYPHS (it); | 9510 | PRODUCE_GLYPHS (it); |
| 9509 | 9511 | ||
| 9510 | nglyphs = it->glyph_row->used[TEXT_AREA] - n_glyphs_before; | 9512 | nglyphs = row->used[TEXT_AREA] - n_glyphs_before; |
| 9511 | i = 0; | 9513 | i = 0; |
| 9512 | x = x_before; | 9514 | x = x_before; |
| 9513 | while (i < nglyphs) | 9515 | while (i < nglyphs) |
| @@ -9516,9 +9518,9 @@ display_tool_bar_line (it, height) | |||
| 9516 | 9518 | ||
| 9517 | if (x + glyph->pixel_width > max_x) | 9519 | if (x + glyph->pixel_width > max_x) |
| 9518 | { | 9520 | { |
| 9519 | /* Glyph doesn't fit on line. */ | 9521 | /* Glyph doesn't fit on line. Backtrack. */ |
| 9520 | it->glyph_row->used[TEXT_AREA] = n_glyphs_before + i; | 9522 | row->used[TEXT_AREA] = n_glyphs_before; |
| 9521 | it->current_x = x; | 9523 | *it = it_before; |
| 9522 | goto out; | 9524 | goto out; |
| 9523 | } | 9525 | } |
| 9524 | 9526 | ||
| @@ -9549,6 +9551,8 @@ display_tool_bar_line (it, height) | |||
| 9549 | /* Make line the desired height and center it vertically. */ | 9551 | /* Make line the desired height and center it vertically. */ |
| 9550 | if ((height -= it->max_ascent + it->max_descent) > 0) | 9552 | if ((height -= it->max_ascent + it->max_descent) > 0) |
| 9551 | { | 9553 | { |
| 9554 | /* Don't add more than one line height. */ | ||
| 9555 | height %= FRAME_LINE_HEIGHT (it->f); | ||
| 9552 | it->max_ascent += height / 2; | 9556 | it->max_ascent += height / 2; |
| 9553 | it->max_descent += (height + 1) / 2; | 9557 | it->max_descent += (height + 1) / 2; |
| 9554 | } | 9558 | } |