Ticket #3658 (closed defect: fixed)

Opened 12 months ago

Last modified 11 months ago

ToolbarButton have grey background in Wikipedia activities

Reported by: godiard Owned by: manuq
Priority: High Milestone: 0.96
Component: sugar-toolkit Version: 0.96.x
Severity: Major Keywords: 12.1.0, patch, olpc-test-passed
Cc: dsd, erikos Distribution/OS: OLPC
Bug Status: Assigned

Description

Tested in os12. The search button (second after the activity button) have a grey background.

Attachments

0001-Search-ToolButton-pass-page-and-icon_name-as-paramet.patch Download (1.3 KB) - added by manuq 12 months ago.
wikipedia-toolbarbuton.png Download (16.7 KB) - added by manuq 12 months ago.
This image shows the bug.
0001-ToolButton-add-icon_name-as-a-GObject-property-SL-36.patch Download (1.2 KB) - added by manuq 12 months ago.
GTK+3 patch
0001-ToolButton-add-icon_name-as-a-GObject-property-SL-36.2.patch Download (1.2 KB) - added by manuq 12 months ago.
GTK+2 patch

Change History

Changed 12 months ago by manuq

Passing page and icon_name as parameters to the ToolButton fixes this.

The attached patch for Wikipedia activity should fix it.

Changed 12 months ago by manuq

The issue happens when not passing icon_name to the constructor, and setting it as toolbutton.props.icon_name = 'name' instead.

I will check in sugar-toolkit-gtk3 now.

Changed 12 months ago by manuq

  • cc dsd added

Adding icon_name as a gobject property of ToolButton class would solve this too, in the toolkit. However, I don't see this in GTK2 toolkit.

--- a/src/sugar3/graphics/toolbutton.py
+++ b/src/sugar3/graphics/toolbutton.py
@@ -120,6 +120,8 @@ class ToolButton(Gtk.ToolButton):
         self.set_icon_widget(icon)
         icon.show()
 
+    icon_name = GObject.property(type=str, setter=set_icon)
+
     def create_palette(self):
         return None

Changed 12 months ago by manuq

This is the current state in both toolkits (gtk2 and gtk3):

Sugar's ToolButton, which inherits from Gtk.ToolButton, has a set_icon() method that adds a Sugar Icon to the widget. If icon_name is passed in the constructor, set_icon method is called. If ToolButton.props.icon_name is changed, set_icon is _not_ called, it is a property of Gtk.ToolButton.

The issue in this particular ticket is that previouly, the Gtk icon looked like the Sugar icon, in GTK3 it looks different.

What do we want? Change Wikipedia, or change both toolkits?

Changed 12 months ago by godiard

  • cc erikos added

Thanks manuq by looking at this.

I think the proper fix is change the toolkits.

Adding erikos to see if he agree.

Changed 12 months ago by manuq

This image shows the bug.

Changed 12 months ago by erikos

  • severity changed from Unspecified to Major
  • component changed from sugar-artwork to sugar-toolkit
  • priority changed from Unspecified by Maintainer to High
  • version changed from Unspecified to 0.96.x
  • milestone changed from Unspecified by Release Team to 0.96
  • distribution changed from Unspecified to OLPC
  • status_field changed from Unconfirmed to Assigned

Thanks Manuel for the close lookup of this issue. So it sounds like we could trigger the same issue when using that new icon with the old toolkit.

Patch looks good to me. Can you prepare a fancy patch for toolkit-gtk2 and toolkit-gtk3?

Changed 12 months ago by manuq

GTK+3 patch

Changed 12 months ago by manuq

GTK+2 patch

Changed 12 months ago by manuq

  • keywords 12.1.0, patch, olpc-test-pending added
  • status changed from new to closed
  • resolution set to fixed

Thanks erikos for the review. Pushed to both tookkits.

Changed 11 months ago by greenfeld

  • keywords olpc-test-passed added; olpc-test-pending removed

The search button does not have a gray background in OLPC 12.1.0 os16/Wikipedia{EN}-35.

Note: See TracTickets for help on using tickets.