Updated sc_scroll behaviour

This commit is contained in:
Moritz Lipp 2010-06-13 16:39:46 +02:00
parent 532101ce63
commit b61b8ac2b6

View File

@ -1601,9 +1601,23 @@ sc_scroll(Argument* argument)
gdouble value = gtk_adjustment_get_value(adjustment);
gdouble max = gtk_adjustment_get_upper(adjustment) - view_size;
if( (argument->n == LEFT) || (argument->n == UP))
if(argument->n == UP && value == 0)
{
Argument arg;
arg.n = PREVIOUS;
sc_navigate(&arg);
arg.n = BOTTOM;
sc_scroll(&arg);
}
else if(argument->n == DOWN && value == max)
{
Argument arg;
arg.n = NEXT;
sc_navigate(&arg);
}
else if((argument->n == LEFT) || (argument->n == UP))
gtk_adjustment_set_value(adjustment, (value - SCROLL_STEP) < 0 ? 0 : (value - SCROLL_STEP));
else if (argument->n == TOP)
else if(argument->n == TOP)
gtk_adjustment_set_value(adjustment, 0);
else if(argument->n == BOTTOM)
gtk_adjustment_set_value(adjustment, max);