Ticket #1305 (assigned defect)

Opened 4 years ago

Last modified 4 years ago

gtk.Image().set_from_icon_name() provides incorrectly scaled icon image

Reported by: garycmartin Owned by: alsroot
Priority: Low Milestone: 0.86
Component: sugar Version: Git as of bugdate
Severity: Unspecified Keywords:
Cc: Distribution/OS: Unspecified
Bug Status: Unconfirmed

Description

Using:

image = gtk.Image()
image.set_from_icon_name('insert-table', -1)

... to generate an image to place into a gtk.Button (in the toolbar) seems to be acquiring an incorrectly sized icon. When sugar scaling is set to 75 the icon is too large, and when set to 100 it is a little too small.

Code exhibiting the issue can be seen at line 187:

 http://git.sugarlabs.org/projects/write/repos/garycmartins-toolbar-clone/blobs/master/toolbar.py

Change History

  Changed 4 years ago by alsroot

  • owner changed from tomeu to alsroot
  • status changed from new to assigned

  Changed 4 years ago by alsroot

  • priority changed from Unspecified by Maintainer to Normal

follow-up: ↓ 5   Changed 4 years ago by tomeu

Aren't we doing the same in other parts of Sugar? Maybe the icon doesn't follow the guidelines in the HIG?

I see that we are passing gtk.ICON_SIZE_LARGE_TOOLBAR instead of -1 in the control panel.

  Changed 4 years ago by tomeu

  • milestone changed from Unspecified by Release Team to 0.86

in reply to: ↑ 3   Changed 4 years ago by garycmartin

  • priority changed from Normal to Low

Replying to tomeu:

Aren't we doing the same in other parts of Sugar? Maybe the icon doesn't follow the guidelines in the HIG?

Already checked the svg icon, it is fine, and it looks fine when added as a toolbar button. It is just when using set_from_icon_name() that the size doesn't match the rest of what sugar is doing. Note that I'm using this for abiword.TableCreator() as it doesn't take parameters for an icon to use (if you leave it alone it shows a blurry grey bitmap). As TableCreator() is a child of GtkButton, I went for using set_from_icon_name() to try and provide the correct sugar icon.

Note: See TracTickets for help on using tickets.