Hi Tomeu,
I found and have fixes two issues regarding the redesign:
a) the devices in the tray does draw the palette but not the black
border around the icon like they do in the Friendstray for example
b) when you add more than max items to the clipboard tray not the first
but the currently added gets deleted. get_children() seems to have
another order for gtk.Containers than for hippo ones.
Best,
Simon
Tomeu Vizoso wrote:
Hi Eben,
hope you don't mind if I review some code of yours ;)
* Colorize activities in Home view(s) on hover:
- icon = CanvasIcon(size=style.STANDARD_ICON_SIZE, cache=True,
+ self.icon = CanvasIcon(size=style.STANDARD_ICON_SIZE, cache=True,
If icon is only used internally, then it is private and should start
with an underscore.
+ def __icon_hovering_changed_event_cb(self, icon, event):
+ if event:
What you call event should be a boolean called hovering.
+ self._profile = get_profile()
If the profile is not part of the state of the class, then I think we
shouldn't add a reference to it like that. Why don't you call
get_profile() each time it is needed?
+ # passing the icon_size property to the Icon contructor doesn't work
+ activity_icon.props.icon_size=gtk.ICON_SIZE_LARGE_TOOLBAR
Hmm, I think Simon pushed a fix for this some days ago? You may need
to sync your sugar-toolkit tree. Mind the spaces between operators and
operands.
+ Palette.__init__(self, None, None, primary_text=activity_info.name,
Please name the parameters that is not clear what they are, like this:
Palette.__init__(self, label=None, accelerator=None,
primary_text=activity_info.name,
* Add icons to palettes of objects in Groups/Neighborhood:
- p = palette.Palette(self._model.activity.props.name)
I know it isn't your code, but please use more complete names unless
they get really big.
Great work!
Thanks,
Tomeu
_______________________________________________
Sugar mailing list
[email protected]
http://lists.laptop.org/listinfo/sugar
diff --git a/src/view/frame/clipboardtray.py b/src/view/frame/clipboardtray.py
index a85551a..cddd7a0 100644
--- a/src/view/frame/clipboardtray.py
+++ b/src/view/frame/clipboardtray.py
@@ -111,7 +111,7 @@ class ClipboardTray(VTray):
icon.show()
self._icons[object_id] = icon
- objects_to_delete = self.get_children()[self.MAX_ITEMS:]
+ objects_to_delete = self.get_children()[:-self.MAX_ITEMS]
for icon in objects_to_delete:
logging.debug('ClipboardTray: deleting surplus object')
cb_service = clipboardservice.get_instance()
diff --git a/src/view/devices/battery.py b/src/view/devices/battery.py
index 8ab5098..b26a85c 100644
--- a/src/view/devices/battery.py
+++ b/src/view/devices/battery.py
@@ -37,6 +37,7 @@ class DeviceView(TrayIcon):
self._model = model
self.palette = BatteryPalette(_('My Battery life'))
+ self.set_palette(self.palette)
self.palette.props.invoker = FrameWidgetInvoker(self)
self.palette.set_group_id('frame')
diff --git a/src/view/devices/network/mesh.py b/src/view/devices/network/mesh.py
index 121e56a..bcdc0b2 100644
--- a/src/view/devices/network/mesh.py
+++ b/src/view/devices/network/mesh.py
@@ -36,6 +36,7 @@ class DeviceView(TrayIcon):
self._model = model
self.palette = MeshPalette(_("Mesh Network"), model)
+ self.set_palette(self.palette)
self.palette.props.invoker = FrameWidgetInvoker(self)
self.palette.set_group_id('frame')
diff --git a/src/view/devices/network/wireless.py b/src/view/devices/network/wireless.py
index ff1ba53..6b50769 100644
--- a/src/view/devices/network/wireless.py
+++ b/src/view/devices/network/wireless.py
@@ -46,6 +46,7 @@ class DeviceView(TrayIcon):
self._counter = 0
self.palette = WirelessPalette(self._get_palette_primary_text(), meshdev)
+ self.set_palette(self.palette)
self.palette.props.invoker = FrameWidgetInvoker(self)
self.palette.set_group_id('frame')
self.palette.set_frequency(self._model.props.frequency)
_______________________________________________
Sugar mailing list
[email protected]
http://lists.laptop.org/listinfo/sugar