Opened 7 years ago

Closed 7 years ago

Last modified 6 years ago

#3835 closed defect (fixed)

Icon/EventIcon: badge is not drawn at the correct position

Reported by: erikos Owned by: erikos
Priority: Unspecified by Maintainer Milestone:
Component: Sugar Version: 0.97.x
Severity: Critical Keywords: shell-port 13.1.0
Cc: Distribution/OS: Fedora
Bug Status: New

Description

Has to be fixed for the shell port (we draw badges in the Neighborhood View (AP icons)).

Patch to test with HelloWorld attached.

Attachments (2)

test_icon_badges.patch (1.5 KB) - added by erikos 7 years ago.
test with HelloWorld
0001-Add-testcase-for-icon-badges-SL-3835.patch (1.3 KB) - added by manuq 7 years ago.
erikos testcase as a testcase for the toolkit testsuit

Download all attachments as: .zip

Change History (9)

Changed 7 years ago by erikos

test with HelloWorld

comment:1 Changed 7 years ago by erikos

Test patch for the toolkit-gtk3:

diff --git a/src/sugar3/graphics/icon.py b/src/sugar3/graphics/icon.py
index c10273e..956ea44 100644

--- a/src/sugar3/graphics/icon.py
+++ b/src/sugar3/graphics/icon.py
@@ -304,7 +304,7 @@ class _IconBuffer(object):
 
         if self.badge_name:
             context.restore()
-            context.translate(badge_info.attach_x, badge_info.attach_y)
+            context.translate(badge_info.attach_x + 10, badge_info.attach_y + 10)
             self._draw_badge(context, badge_info.size, sensitive, widget)
 
         self._surface_cache[cache_key] = surface

comment:2 Changed 7 years ago by dsd

  • Keywords 13.1.0 added

Changed 7 years ago by manuq

erikos testcase as a testcase for the toolkit testsuit

comment:3 Changed 7 years ago by manuq

in icon.py, _get_attach_points() is returning (0, 0). The pygi-convert.sh in commit 820efa56 did it:

-        attach_points = info.get_attach_points()
+        return 0,0;has_attach_points_, attach_points = info.get_attach_points()

comment:4 Changed 7 years ago by manuq

Yes the previous patch fixes it. I was confused by the testcase, which is wrong. 'document-open' is not good for a testcase because it doesn't have attach points. They are defined in the artwork .icon files, for example 'network-wireless-000' has:

[Icon Data]
AttachPoints=970,850

As per this freedesktop spec.

comment:5 Changed 7 years ago by erikos

  • Resolution set to fixed
  • Status changed from new to closed

Yeah, pushed as: c0756f48d4f75702e3d419c1737cfdd837dd9ca3

comment:6 Changed 6 years ago by dnarvaez

  • Component changed from sugar-toolkit-gtk3 to Sugar

comment:7 Changed 6 years ago by dnarvaez

  • Milestone 0.98 deleted

Milestone 0.98 deleted

Note: See TracTickets for help on using tickets.