Mercurial > vim
comparison src/gui.c @ 674:4b8583e82cb8 v7.0201
updated for version 7.0201
author | vimboss |
---|---|
date | Sat, 18 Feb 2006 22:14:51 +0000 |
parents | b945c6d9f3c7 |
children | 9364d114ed8d |
comparison
equal
deleted
inserted
replaced
673:513866ffe6af | 674:4b8583e82cb8 |
---|---|
3596 /* | 3596 /* |
3597 * Don't want to update a scrollbar while we're dragging it. But if we | 3597 * Don't want to update a scrollbar while we're dragging it. But if we |
3598 * have both a left and right scrollbar, and we drag one of them, we still | 3598 * have both a left and right scrollbar, and we drag one of them, we still |
3599 * need to update the other one. | 3599 * need to update the other one. |
3600 */ | 3600 */ |
3601 if ( (gui.dragged_sb == SBAR_LEFT | 3601 if (!force && (gui.dragged_sb == SBAR_LEFT || gui.dragged_sb == SBAR_RIGHT) |
3602 || gui.dragged_sb == SBAR_RIGHT) | 3602 && gui.which_scrollbars[SBAR_LEFT] |
3603 && (!gui.which_scrollbars[SBAR_LEFT] | 3603 && gui.which_scrollbars[SBAR_RIGHT]) |
3604 || !gui.which_scrollbars[SBAR_RIGHT]) | |
3605 && !force) | |
3606 return; | |
3607 | |
3608 if (!force && (gui.dragged_sb == SBAR_LEFT || gui.dragged_sb == SBAR_RIGHT)) | |
3609 { | 3604 { |
3610 /* | 3605 /* |
3611 * If we have two scrollbars and one of them is being dragged, just | 3606 * If we have two scrollbars and one of them is being dragged, just |
3612 * copy the scrollbar position from the dragged one to the other one. | 3607 * copy the scrollbar position from the dragged one to the other one. |
3613 */ | 3608 */ |
3616 gui_mch_set_scrollbar_thumb( | 3611 gui_mch_set_scrollbar_thumb( |
3617 &gui.dragged_wp->w_scrollbars[which_sb], | 3612 &gui.dragged_wp->w_scrollbars[which_sb], |
3618 gui.dragged_wp->w_scrollbars[0].value, | 3613 gui.dragged_wp->w_scrollbars[0].value, |
3619 gui.dragged_wp->w_scrollbars[0].size, | 3614 gui.dragged_wp->w_scrollbars[0].size, |
3620 gui.dragged_wp->w_scrollbars[0].max); | 3615 gui.dragged_wp->w_scrollbars[0].max); |
3621 return; | |
3622 } | 3616 } |
3623 | 3617 |
3624 /* avoid that moving components around generates events */ | 3618 /* avoid that moving components around generates events */ |
3625 ++hold_gui_events; | 3619 ++hold_gui_events; |
3626 | 3620 |
3627 for (wp = firstwin; wp != NULL; wp = W_NEXT(wp)) | 3621 for (wp = firstwin; wp != NULL; wp = W_NEXT(wp)) |
3628 { | 3622 { |
3629 if (wp->w_buffer == NULL) /* just in case */ | 3623 if (wp->w_buffer == NULL) /* just in case */ |
3630 continue; | 3624 continue; |
3625 /* Skip a scrollbar that is being dragged. */ | |
3626 if (!force && (gui.dragged_sb == SBAR_LEFT | |
3627 || gui.dragged_sb == SBAR_RIGHT) | |
3628 && gui.dragged_wp == wp) | |
3629 continue; | |
3630 | |
3631 #ifdef SCROLL_PAST_END | 3631 #ifdef SCROLL_PAST_END |
3632 max = wp->w_buffer->b_ml.ml_line_count - 1; | 3632 max = wp->w_buffer->b_ml.ml_line_count - 1; |
3633 #else | 3633 #else |
3634 max = wp->w_buffer->b_ml.ml_line_count + wp->w_height - 2; | 3634 max = wp->w_buffer->b_ml.ml_line_count + wp->w_height - 2; |
3635 #endif | 3635 #endif |
3757 #ifdef FEAT_GUI_ATHENA | 3757 #ifdef FEAT_GUI_ATHENA |
3758 sb->pixval = y; | 3758 sb->pixval = y; |
3759 #endif | 3759 #endif |
3760 sb->size = size; | 3760 sb->size = size; |
3761 sb->max = max; | 3761 sb->max = max; |
3762 if (gui.which_scrollbars[SBAR_LEFT] && gui.dragged_sb != SBAR_LEFT) | 3762 if (gui.which_scrollbars[SBAR_LEFT] |
3763 && (gui.dragged_sb != SBAR_LEFT || gui.dragged_wp != wp)) | |
3763 gui_mch_set_scrollbar_thumb(&wp->w_scrollbars[SBAR_LEFT], | 3764 gui_mch_set_scrollbar_thumb(&wp->w_scrollbars[SBAR_LEFT], |
3764 val, size, max); | 3765 val, size, max); |
3765 if (gui.which_scrollbars[SBAR_RIGHT] | 3766 if (gui.which_scrollbars[SBAR_RIGHT] |
3766 && gui.dragged_sb != SBAR_RIGHT) | 3767 && (gui.dragged_sb != SBAR_RIGHT || gui.dragged_wp != wp)) |
3767 gui_mch_set_scrollbar_thumb(&wp->w_scrollbars[SBAR_RIGHT], | 3768 gui_mch_set_scrollbar_thumb(&wp->w_scrollbars[SBAR_RIGHT], |
3768 val, size, max); | 3769 val, size, max); |
3769 } | 3770 } |
3770 } | 3771 } |
3771 #ifdef FEAT_VERTSPLIT | 3772 #ifdef FEAT_VERTSPLIT |