diff options
| author | Jan Djärv | 2013-01-11 05:57:45 +0100 |
|---|---|---|
| committer | Jan Djärv | 2013-01-11 05:57:45 +0100 |
| commit | ec782c5f13fbcebe3b02106357c7daa0681a2b08 (patch) | |
| tree | 89a2c74f4d1d5d84e1591987e64a526e3b4a8f92 /src | |
| parent | eac4d08fb1864aa178cfa0037352f5a0a7a20597 (diff) | |
| download | emacs-ec782c5f13fbcebe3b02106357c7daa0681a2b08.tar.gz emacs-ec782c5f13fbcebe3b02106357c7daa0681a2b08.zip | |
Introduce scroll-bar-adjust-thumb-portion.
* xterm.c (scroll-bar-adjust-thumb-portion): New variable to
determine whether scroll bar thumb size should be adjusted or
not. Use variable for MOTIF.
* gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for
GTK.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 9 | ||||
| -rw-r--r-- | src/gtkutil.c | 18 | ||||
| -rw-r--r-- | src/xterm.c | 41 |
3 files changed, 46 insertions, 22 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 5c6c5180be5..ce6ce861a79 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2012-12-31 Adam Sjøgren <asjo@koldfront.dk> | ||
| 2 | |||
| 3 | * xterm.c (scroll-bar-adjust-thumb-portion): New variable to | ||
| 4 | determine whether scroll bar thumb size should be adjusted or | ||
| 5 | not. Use variable for MOTIF. | ||
| 6 | |||
| 7 | * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for | ||
| 8 | GTK. | ||
| 9 | |||
| 1 | 2013-01-13 Jan Djärv <jan.h.d@swipnet.se> | 10 | 2013-01-13 Jan Djärv <jan.h.d@swipnet.se> |
| 2 | 11 | ||
| 3 | * nsterm.m (keyDown:): Set processingCompose to NO if an emacs key | 12 | * nsterm.m (keyDown:): Set processingCompose to NO if an emacs key |
diff --git a/src/gtkutil.c b/src/gtkutil.c index 6daf189f74c..af845f69e62 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c | |||
| @@ -3795,13 +3795,17 @@ xg_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar, | |||
| 3795 | 3795 | ||
| 3796 | adj = gtk_range_get_adjustment (GTK_RANGE (wscroll)); | 3796 | adj = gtk_range_get_adjustment (GTK_RANGE (wscroll)); |
| 3797 | 3797 | ||
| 3798 | /* We do the same as for MOTIF in xterm.c, assume 30 chars per line | 3798 | if (scroll_bar_adjust_thumb_portion_p) |
| 3799 | rather than the real portion value. This makes the thumb less likely | 3799 | { |
| 3800 | to resize and that looks better. */ | 3800 | /* We do the same as for MOTIF in xterm.c, use 30 chars per |
| 3801 | portion = WINDOW_TOTAL_LINES (XWINDOW (bar->window)) * 30; | 3801 | line rather than the real portion value. This makes the |
| 3802 | /* When the thumb is at the bottom, position == whole. | 3802 | thumb less likely to resize and that looks better. */ |
| 3803 | So we need to increase `whole' to make space for the thumb. */ | 3803 | portion = WINDOW_TOTAL_LINES (XWINDOW (bar->window)) * 30; |
| 3804 | whole += portion; | 3804 | |
| 3805 | /* When the thumb is at the bottom, position == whole. | ||
| 3806 | So we need to increase `whole' to make space for the thumb. */ | ||
| 3807 | whole += portion; | ||
| 3808 | } | ||
| 3805 | 3809 | ||
| 3806 | if (whole <= 0) | 3810 | if (whole <= 0) |
| 3807 | top = 0, shown = 1; | 3811 | top = 0, shown = 1; |
diff --git a/src/xterm.c b/src/xterm.c index f63f10566f6..cbae1bc4b0d 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -4802,21 +4802,24 @@ x_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar, int portion, int positio | |||
| 4802 | 4802 | ||
| 4803 | #ifdef USE_MOTIF | 4803 | #ifdef USE_MOTIF |
| 4804 | 4804 | ||
| 4805 | /* We use an estimate of 30 chars per line rather than the real | 4805 | if (scroll_bar_adjust_thumb_portion_p) |
| 4806 | `portion' value. This has the disadvantage that the thumb size | 4806 | { |
| 4807 | is not very representative, but it makes our life a lot easier. | 4807 | /* We use an estimate of 30 chars per line rather than the real |
| 4808 | Otherwise, we have to constantly adjust the thumb size, which | 4808 | `portion' value. This has the disadvantage that the thumb size |
| 4809 | we can't always do quickly enough: while dragging, the size of | 4809 | is not very representative, but it makes our life a lot easier. |
| 4810 | the thumb might prevent the user from dragging the thumb all the | 4810 | Otherwise, we have to constantly adjust the thumb size, which |
| 4811 | way to the end. but Motif and some versions of Xaw3d don't allow | 4811 | we can't always do quickly enough: while dragging, the size of |
| 4812 | updating the thumb size while dragging. Also, even if we can update | 4812 | the thumb might prevent the user from dragging the thumb all the |
| 4813 | its size, the update will often happen too late. | 4813 | way to the end. but Motif and some versions of Xaw3d don't allow |
| 4814 | If you don't believe it, check out revision 1.650 of xterm.c to see | 4814 | updating the thumb size while dragging. Also, even if we can update |
| 4815 | what hoops we were going through and the still poor behavior we got. */ | 4815 | its size, the update will often happen too late. |
| 4816 | portion = WINDOW_TOTAL_LINES (XWINDOW (bar->window)) * 30; | 4816 | If you don't believe it, check out revision 1.650 of xterm.c to see |
| 4817 | /* When the thumb is at the bottom, position == whole. | 4817 | what hoops we were going through and the still poor behavior we got. */ |
| 4818 | So we need to increase `whole' to make space for the thumb. */ | 4818 | portion = WINDOW_TOTAL_LINES (XWINDOW (bar->window)) * 30; |
| 4819 | whole += portion; | 4819 | /* When the thumb is at the bottom, position == whole. |
| 4820 | So we need to increase `whole' to make space for the thumb. */ | ||
| 4821 | whole += portion; | ||
| 4822 | } | ||
| 4820 | 4823 | ||
| 4821 | if (whole <= 0) | 4824 | if (whole <= 0) |
| 4822 | top = 0, shown = 1; | 4825 | top = 0, shown = 1; |
| @@ -10784,6 +10787,14 @@ With MS Windows or Nextstep, the value is t. */); | |||
| 10784 | Vx_toolkit_scroll_bars = Qnil; | 10787 | Vx_toolkit_scroll_bars = Qnil; |
| 10785 | #endif | 10788 | #endif |
| 10786 | 10789 | ||
| 10790 | DEFVAR_BOOL ("scroll-bar-adjust-thumb-portion", | ||
| 10791 | scroll_bar_adjust_thumb_portion_p, | ||
| 10792 | doc: /* Non-nil means adjust the thumb in the | ||
| 10793 | scroll bar to be less likely to resize which looks better. | ||
| 10794 | Set to nil if you want the thumb to fill the whole scroll bar | ||
| 10795 | when the entire buffer is visible. */); | ||
| 10796 | scroll_bar_adjust_thumb_portion_p = 1; | ||
| 10797 | |||
| 10787 | staticpro (&last_mouse_motion_frame); | 10798 | staticpro (&last_mouse_motion_frame); |
| 10788 | last_mouse_motion_frame = Qnil; | 10799 | last_mouse_motion_frame = Qnil; |
| 10789 | 10800 | ||