Implement tooltips for the zoom levels.
This commit is contained in:
parent
587c1347e1
commit
c3c0810def
@ -7,4 +7,5 @@ shell/view/Shell.py
|
||||
shell/view/clipboardicon.py
|
||||
shell/view/home/HomeBox.py
|
||||
shell/view/home/MeshBox.py
|
||||
shell/view/devices/battery.py
|
||||
sugar/activity/activity.py
|
||||
|
@ -8,6 +8,6 @@ sugar_PYTHON = \
|
||||
FriendsBox.py \
|
||||
eventarea.py \
|
||||
frame.py \
|
||||
ZoomBox.py \
|
||||
overlaybox.py \
|
||||
framewindow.py
|
||||
framewindow.py \
|
||||
zoombox.py
|
||||
|
@ -27,7 +27,7 @@ from sugar.clipboard import clipboardservice
|
||||
|
||||
from view.frame.eventarea import EventArea
|
||||
from view.frame.ActivitiesBox import ActivitiesBox
|
||||
from view.frame.ZoomBox import ZoomBox
|
||||
from view.frame.zoombox import ZoomBox
|
||||
from view.frame.overlaybox import OverlayBox
|
||||
from view.frame.FriendsBox import FriendsBox
|
||||
from view.frame.framewindow import FrameWindow
|
||||
|
@ -14,10 +14,14 @@
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
from gettext import gettext as _
|
||||
|
||||
import hippo
|
||||
|
||||
from sugar.graphics import color
|
||||
from sugar.graphics.palette import Palette
|
||||
from sugar.graphics.iconbutton import IconButton
|
||||
from frameinvoker import FrameCanvasInvoker
|
||||
|
||||
from model.shellmodel import ShellModel
|
||||
|
||||
@ -35,6 +39,11 @@ class ZoomBox(hippo.CanvasBox):
|
||||
ShellModel.ZOOM_MESH)
|
||||
self.append(icon)
|
||||
|
||||
palette = Palette(_('Neighborhood'))
|
||||
palette.props.invoker = FrameCanvasInvoker(icon)
|
||||
palette.set_group_id('frame')
|
||||
icon.set_palette(palette)
|
||||
|
||||
icon = IconButton(icon_name='theme:stock-zoom-friends',
|
||||
stroke_color=color.BLACK,
|
||||
fill_color=color.WHITE)
|
||||
@ -43,6 +52,11 @@ class ZoomBox(hippo.CanvasBox):
|
||||
ShellModel.ZOOM_FRIENDS)
|
||||
self.append(icon)
|
||||
|
||||
palette = Palette(_('Group'))
|
||||
palette.props.invoker = FrameCanvasInvoker(icon)
|
||||
palette.set_group_id('frame')
|
||||
icon.set_palette(palette)
|
||||
|
||||
icon = IconButton(icon_name='theme:stock-zoom-home',
|
||||
stroke_color=color.BLACK,
|
||||
fill_color=color.WHITE)
|
||||
@ -51,6 +65,11 @@ class ZoomBox(hippo.CanvasBox):
|
||||
ShellModel.ZOOM_HOME)
|
||||
self.append(icon)
|
||||
|
||||
palette = Palette(_('Home'))
|
||||
palette.props.invoker = FrameCanvasInvoker(icon)
|
||||
palette.set_group_id('frame')
|
||||
icon.set_palette(palette)
|
||||
|
||||
icon = IconButton(icon_name='theme:stock-zoom-activity',
|
||||
stroke_color=color.BLACK,
|
||||
fill_color=color.WHITE)
|
||||
@ -59,5 +78,10 @@ class ZoomBox(hippo.CanvasBox):
|
||||
ShellModel.ZOOM_ACTIVITY)
|
||||
self.append(icon)
|
||||
|
||||
palette = Palette(_('Activity'))
|
||||
palette.props.invoker = FrameCanvasInvoker(icon)
|
||||
palette.set_group_id('frame')
|
||||
icon.set_palette(palette)
|
||||
|
||||
def _level_clicked_cb(self, item, level):
|
||||
self._shell.set_zoom_level(level)
|
Loading…
Reference in New Issue
Block a user