Add hover to ClipboardIcon.
This commit is contained in:
parent
52fc6826ab
commit
940b50b4e6
@ -4,6 +4,7 @@ from sugar.graphics.canvasicon import CanvasIcon
|
||||
from view.clipboardmenu import ClipboardMenu
|
||||
from sugar.graphics.xocolor import XoColor
|
||||
from sugar.graphics import units
|
||||
from sugar.graphics import color
|
||||
from sugar.activity import activityfactory
|
||||
from sugar.clipboard import clipboardservice
|
||||
from sugar import util
|
||||
@ -81,3 +82,9 @@ class ClipboardIcon(CanvasIcon):
|
||||
|
||||
def get_object_id(self):
|
||||
return self._object_id
|
||||
|
||||
def prelight(self, enter):
|
||||
if enter:
|
||||
self.props.background_color = color.BLACK.get_int()
|
||||
else:
|
||||
self.props.background_color = color.TOOLBAR_BACKGROUND.get_int()
|
||||
|
@ -13,7 +13,7 @@ class ClipboardProgressBar(ClipboardBubble):
|
||||
def __init__(self, percent = 0):
|
||||
self._text_item = None
|
||||
ClipboardBubble.__init__(self, percent=percent)
|
||||
|
||||
|
||||
self._text_item = hippo.CanvasText(text=str(percent) + ' %')
|
||||
self._text_item.props.color = color.LABEL_TEXT.get_int()
|
||||
self._text_item.props.font_desc = font.DEFAULT.get_pango_desc()
|
||||
@ -35,6 +35,7 @@ class ClipboardMenu(Menu):
|
||||
|
||||
def __init__(self, name, percent, preview, activity):
|
||||
Menu.__init__(self, name)
|
||||
self.props.border = 0
|
||||
|
||||
if percent < 100:
|
||||
self._progress_bar = ClipboardProgressBar(percent)
|
||||
|
Loading…
Reference in New Issue
Block a user