[Bugs] #1208 UNSP: Accelerators for zoom toolbar

SugarLabs Bugs bugtracker-noreply at sugarlabs.org
Wed Aug 19 09:46:18 EDT 2009


#1208: Accelerators for zoom toolbar
------------------------------------------+---------------------------------
    Reporter:  erikos                     |          Owner:  tomeu 
        Type:  enhancement                |         Status:  new   
    Priority:  Unspecified by Maintainer  |      Milestone:  0.86  
   Component:  sugar                      |        Version:  0.85.x
    Severity:  Unspecified                |       Keywords:  r?    
Distribution:  Unspecified                |   Status_field:  New   
------------------------------------------+---------------------------------
 {{{
 diff --git a/src/jarabe/frame/zoomtoolbar.py
 b/src/jarabe/frame/zoomtoolbar.py
 index 43cc358..030e41e 100644
 --- a/src/jarabe/frame/zoomtoolbar.py
 +++ b/src/jarabe/frame/zoomtoolbar.py
 @@ -33,25 +33,26 @@ class ZoomToolbar(gtk.Toolbar):
          self.set_direction(gtk.TEXT_DIR_LTR)

          self._mesh_button = self._add_button('zoom-neighborhood',
 -                _('Neighborhood'), shell.ShellModel.ZOOM_MESH)
 +                _('Neighborhood'), 'F1', shell.ShellModel.ZOOM_MESH)
          self._groups_button = self._add_button('zoom-groups',
 -                _('Group'), shell.ShellModel.ZOOM_GROUP)
 +                _('Group'), 'F2', shell.ShellModel.ZOOM_GROUP)
          self._home_button = self._add_button('zoom-home',
 -                _('Home'), shell.ShellModel.ZOOM_HOME)
 +                _('Home'), 'F3', shell.ShellModel.ZOOM_HOME)
          self._activity_button = self._add_button('zoom-activity',
 -                _('Activity'), shell.ShellModel.ZOOM_ACTIVITY)
 +                _('Activity'), 'F4', shell.ShellModel.ZOOM_ACTIVITY)

          shell_model = shell.get_model()
          self._set_zoom_level(shell_model.zoom_level)
 shell_model.zoom_level_changed.connect(self.__zoom_level_changed_cb)

 -    def _add_button(self, icon_name, label, zoom_level):
 +    def _add_button(self, icon_name, label, accelerator, zoom_level):
          if self.get_children():
              group = self.get_children()[0]
          else:
              group = None

 -        button = RadioToolButton(named_icon=icon_name, group=group)
 +        button = RadioToolButton(named_icon=icon_name, group=group,
 +                                 accelerator=accelerator)
          button.connect('clicked', self.__level_clicked_cb, zoom_level)
          self.add(button)
 }}}

-- 
Ticket URL: <http://dev.sugarlabs.org/ticket/1208>
Sugar Labs <http://sugarlabs.org/>
Sugar Labs bug tracking system


More information about the Bugs mailing list