Make the sizes of mesh icons match Eben spec.
This commit is contained in:
parent
bc49fc4257
commit
8aa31a6095
1
NEWS
1
NEWS
@ -1,3 +1,4 @@
|
|||||||
|
* Make the sizes of mesh icons match Eben spec. (marco)
|
||||||
* #3364: When joining an activity, pick up its sharing scope, so we don't
|
* #3364: When joining an activity, pick up its sharing scope, so we don't
|
||||||
try to re-share already shared activities in order to invite someone (smcv)
|
try to re-share already shared activities in order to invite someone (smcv)
|
||||||
|
|
||||||
|
@ -16,12 +16,14 @@
|
|||||||
|
|
||||||
from sugar.graphics.icon import CanvasIcon
|
from sugar.graphics.icon import CanvasIcon
|
||||||
from sugar.graphics.palette import Palette
|
from sugar.graphics.palette import Palette
|
||||||
|
from sugar.graphics import style
|
||||||
|
|
||||||
from view.BuddyMenu import BuddyMenu
|
from view.BuddyMenu import BuddyMenu
|
||||||
|
|
||||||
class BuddyIcon(CanvasIcon):
|
class BuddyIcon(CanvasIcon):
|
||||||
def __init__(self, shell, buddy):
|
def __init__(self, shell, buddy, size=style.STANDARD_ICON_SIZE):
|
||||||
CanvasIcon.__init__(self, icon_name='computer-xo',
|
CanvasIcon.__init__(self, icon_name='computer-xo',
|
||||||
xo_color=buddy.get_color())
|
xo_color=buddy.get_color(), size=size)
|
||||||
|
|
||||||
self._shell = shell
|
self._shell = shell
|
||||||
self._buddy = buddy
|
self._buddy = buddy
|
||||||
|
@ -46,7 +46,7 @@ _ICON_NAME = 'network-wireless'
|
|||||||
|
|
||||||
class AccessPointView(PulsingIcon):
|
class AccessPointView(PulsingIcon):
|
||||||
def __init__(self, model, mesh_device=None):
|
def __init__(self, model, mesh_device=None):
|
||||||
PulsingIcon.__init__(self, size=style.MEDIUM_ICON_SIZE, cache=True)
|
PulsingIcon.__init__(self, size=style.STANDARD_ICON_SIZE, cache=True)
|
||||||
self._model = model
|
self._model = model
|
||||||
self._meshdev = mesh_device
|
self._meshdev = mesh_device
|
||||||
self._disconnect_item = None
|
self._disconnect_item = None
|
||||||
@ -159,7 +159,7 @@ class MeshDeviceView(PulsingIcon):
|
|||||||
if not channel in [1, 6, 11]:
|
if not channel in [1, 6, 11]:
|
||||||
raise ValueError("Invalid channel %d" % channel)
|
raise ValueError("Invalid channel %d" % channel)
|
||||||
|
|
||||||
PulsingIcon.__init__(self, size=style.MEDIUM_ICON_SIZE,
|
PulsingIcon.__init__(self, size=style.STANDARD_ICON_SIZE,
|
||||||
icon_name=_MESH_ICON_NAME, cache=True)
|
icon_name=_MESH_ICON_NAME, cache=True)
|
||||||
|
|
||||||
self._nm_device = nm_device
|
self._nm_device = nm_device
|
||||||
@ -249,8 +249,9 @@ class ActivityView(hippo.CanvasBox):
|
|||||||
self._layout = SnowflakeLayout()
|
self._layout = SnowflakeLayout()
|
||||||
self.set_layout(self._layout)
|
self.set_layout(self._layout)
|
||||||
|
|
||||||
self._icon = CanvasIcon(file_name=model.get_icon_name(), cache=True,
|
self._icon = CanvasIcon(file_name=model.get_icon_name(),
|
||||||
xo_color=model.get_color(), box_width=80)
|
xo_color=model.get_color(), cache=True,
|
||||||
|
size=style.STANDARD_ICON_SIZE)
|
||||||
self._icon.connect('activated', self._clicked_cb)
|
self._icon.connect('activated', self._clicked_cb)
|
||||||
self._icon.set_tooltip(self._model.activity.props.name)
|
self._icon.set_tooltip(self._model.activity.props.name)
|
||||||
self._layout.add_center(self._icon)
|
self._layout.add_center(self._icon)
|
||||||
@ -402,7 +403,8 @@ class MeshBox(hippo.CanvasBox):
|
|||||||
else:
|
else:
|
||||||
activity = self._activities[activity_model.get_id()]
|
activity = self._activities[activity_model.get_id()]
|
||||||
|
|
||||||
icon = BuddyIcon(self._shell, buddy_model)
|
icon = BuddyIcon(self._shell, buddy_model,
|
||||||
|
style.SMALL_ICON_SIZE)
|
||||||
activity.add_buddy_icon(buddy_model.get_key(), icon)
|
activity.add_buddy_icon(buddy_model.get_key(), icon)
|
||||||
|
|
||||||
def _add_activity(self, activity_model):
|
def _add_activity(self, activity_model):
|
||||||
|
Loading…
Reference in New Issue
Block a user