[Sugar-devel] [PATCH Browse] Step scroll with the keypad arrow keys OLPC #11806
Manuel Quiñones
manuq at laptop.org
Mon Apr 30 09:27:22 EDT 2012
2012/4/30 Simon Schampijer <simon at schampijer.de>:
> Hi Manuel,
>
> thanks for the patch.
>
> Please state in the patch description that it has been working before, that
> it is a regression and how it has been lost, why we need to re-add it.
Thanks, I did.
>
> On 04/29/2012 01:06 AM, Manuel Quiñones wrote:
>>
>> Signed-off-by: Manuel Quiñones<manuq at laptop.org>
>> ---
>> webactivity.py | 17 +++++++++++++++++
>> 1 files changed, 17 insertions(+), 0 deletions(-)
>>
>> diff --git a/webactivity.py b/webactivity.py
>> index 156ea3c..2e93ae6 100644
>> --- a/webactivity.py
>> +++ b/webactivity.py
>> @@ -464,6 +464,23 @@ class WebActivity(activity.Activity):
>>
>> return True
>>
>> + elif key_name in ('KP_Up', 'KP_Down', 'KP_Left', 'KP_Right'):
>> + scrolled = browser.get_parent()
>
>
> scrolled_window is more descriptive here imho.
Right! Also changed adj to adjustment . Is pushed now with your ACK.
>
>> + if key_name in ('KP_Up', 'KP_Down'):
>> + adj = scrolled.get_vadjustment()
>> + elif key_name in ('KP_Left', 'KP_Right'):
>> + adj = scrolled.get_hadjustment()
>> + value = adj.get_value()
>> + step = adj.get_step_increment()
>> +
>> + if key_name in ('KP_Up', 'KP_Left'):
>> + adj.set_value(value - step)
>> + elif key_name in ('KP_Down', 'KP_Right'):
>> + adj.set_value(value + step)
>> +
>> + return True
>> +
>> return False
>>
>> def _add_link(self):
>
>
> Looks good to me and does work fine on the XO.
>
> Regards,
> Simon
>
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
--
.. manuq ..
More information about the Sugar-devel
mailing list