#3569 closed defect (fixed)
Icons inside text entries are not centered vertically
Reported by: | tonyforster | Owned by: | erikos |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | Sugar | Version: | Unspecified |
Severity: | Unspecified | Keywords: | screenshot, regression, r+, olpc-test-pending |
Cc: | manuq, humitos, garnacho | Distribution/OS: | Unspecified |
Bug Status: | Unconfirmed |
Description
Browse137 OS9 (and earlier)
The clear search field button (X) is too big and displaced down
Attachments (21)
Change History (44)
Changed 11 years ago by humitos
comment:1 Changed 11 years ago by humitos
- Cc manuq humitos added
- Keywords screenshot added
- Priority changed from Unspecified by Maintainer to Normal
comment:2 follow-up: ↓ 3 Changed 11 years ago by tonyforster
Browse140 Sugar build 21 (XO-1.75)
The button is still too big and also misaligned
Maybe you have patches that I don't
comment:3 in reply to: ↑ 2 Changed 11 years ago by humitos
Replying to tonyforster:
Maybe you have patches that I don't
I tested it from sugar-build that has the latest patches from sugar-artwork.
comment:4 Changed 11 years ago by manuq
Yes the big size was fixed upstream, see:
https://bugzilla.gnome.org/show_bug.cgi?id=678087
and this gtk+ commits: b5d45a9e - 77221c18 - 37262f97 .
What is pending is the alignment.
comment:5 Changed 11 years ago by greenfeld
This is a general issue with search fields in Sugar in 13.1.0 os7.
The (X) for filtering Activities or Network View also is large and offset.
comment:6 Changed 11 years ago by manuq
- Milestone changed from Unspecified by Release Team to 0.98
comment:7 Changed 11 years ago by godiard
- Keywords regression added
comment:8 Changed 11 years ago by manuq
- Summary changed from Browse clear search button too big to Icons inside text entries are not centered vertically
Changed 10 years ago by humitos
A Gtk.Entry without padding makes the text to be vertical-center aligned but not the icon
comment:9 Changed 10 years ago by humitos
I talked to garnacho and he pointed me to the {{{.image}} class for the CSS theme
With that class we are able to catch the images inside the entries: .entry.image. So, I wrote this rule:
.entry.image { padding-bottom: 6px; }
but, for some reason, padding-top and padding-bottom does not take effect. In fact, I could change padding-left and padding-right without no problem (screenshot attached)
Changed 10 years ago by humitos
test case to run inside a "make shell" (sugar-build); we can switch between run it with the sugar theme or not
comment:10 Changed 10 years ago by manuq
Commenting out gtk-icon-sizes from artwork settings.ini gets back the
alignment, with the icon in the wrong size.
comment:11 Changed 10 years ago by godiard
- Cc garnacho added
Carlos, it's possible the patch to solve https://bugzilla.gnome.org/show_bug.cgi?id=678087 need set the position x,y according to the icon size?
comment:12 follow-up: ↓ 13 Changed 10 years ago by manuq
- Component changed from Browse to sugar-artwork
Related ticket with more information: #3569
comment:13 in reply to: ↑ 12 Changed 10 years ago by manuq
comment:14 Changed 10 years ago by manuq
So commenting out set_fonts() in sugar-session the icon looks right. This shows that the icon inside the entry at the position Gtk.EntryIconPosition.SECONDARY depends on the font. The attached animation also shows that the other icon of position Gtk.EntryIconPosition.PRIMARY is not affected by the font.
I have added debug prints in the XO to know the font values before and after and they are:
TEST current font: 'Sans 10' TEST new font: 'Sans Serif 7.000000'
--- a/bin/sugar-session +++ b/bin/sugar-session @@ -242,7 +242,11 @@ def set_fonts(): face = client.get_string('/desktop/sugar/font/default_face') size = client.get_float('/desktop/sugar/font/default_size') settings = Gtk.Settings.get_default() + curfont = settings.get_property("gtk-font-name") + logging.debug("TEST current font: %r", curfont) settings.set_property("gtk-font-name", "%s %f" % (face, size)) + newfont = settings.get_property("gtk-font-name") + logging.debug("TEST new font: %r", newfont)
The difference that humitos and I noticed from running a simple test script in a sugar shell was because that script is not setting the font like sugar-session or the Activity class constructor do.
Changed 10 years ago by manuq
Another test, dialog-cancel in both sides. Looks like this is the only one which is wrong.
Changed 10 years ago by manuq
Workaround: scale the pixbuf before setting the icon as Carlos proposed in http://bugs.sugarlabs.org/ticket/3385#comment:15
comment:15 Changed 10 years ago by manuq
After more testings I found that the icons are not scaled right by GTK+ to the size needed in the entry, if they are of 55x55 pixels.
The current dialog-cancel.svg is 55x55 because it can also be used in the standard icon size, like in toolbars. Other icons that display properly inside entries, like system-search.svg, are of size 22x22.
icon name | size of the svgs | size of the pixbuf dialog-cancel | 55.125 55 | 55 55 system-search | 22.156 22.156 | 22 22
"size of the pixbuf" is the size of the GdkPixbuf returned to IconEntry from _SVGLoader .
Proposal 1: add a workaround that resizes the icons if the size is not 22x22. Patch attached.
Proposal 2: add a new icon for this usage: entry-cancel.svg. proposed SVG attached.
- has the benefit that we can remove the space around the circle, needed in the 55x55 flavour for margin around the graphic, and make the circle 22px diameter. This seems to look better to me.
comment:16 Changed 10 years ago by manuq
- Keywords r? added
comment:17 follow-up: ↓ 18 Changed 10 years ago by garycmartin
Fab. From a visual standpoint, I do like the extra size provided by the new entry-canvas.svg approach. If we go this route we should keep in mind to check we do the same (doesn't need to be right now) with other icons used in the entry areas, to keep them consistent.
comment:18 in reply to: ↑ 17 Changed 10 years ago by garycmartin
Replying to garycmartin:
Fab. From a visual standpoint, I do like the extra size provided by the new entry-canvas.svg approach. If we go this route we should keep in mind to check we do the same (doesn't need to be right now) with other icons used in the entry areas, to keep them consistent.
Typo, entry-canvas.svg should be entry-cancel.svg
comment:19 Changed 10 years ago by erikos
From #3385: https://bugzilla.gnome.org/show_bug.cgi?id=678087
This was the upstream bug, there are commits around: http://git.gnome.org/browse/gtk+/commit/?id=77221c18a3e41d8ebd0754987359738b5bf6ab5d
comment:20 Changed 10 years ago by manuq
Thanks Gary for your feedback.
After discussing with Simon, here is the plan I will follow.
So as an specification we can do:
- standard icons at 55px, with the corresponding margin around the SVG page
- entry icons at 22px, with no margin, the shape can touch the bounds of the SVG page
Planned changes:
- add new cancel icon for usage in entries. Name it entry-cancel.svg
- rename system-search as entry-search. Change Sugar accordingly
- make new search icon for usage in toolbars, at 55px size. Name it system-search.svg
- move Browse reload icon to entry-reload.svg to entry-refresh.svg in artwork. Change Browse accordingly
- Shell Home Activity List: "no matches" message, use new 55px system-search
- Wikipedia Activity, search subtoolbar: use search icon on the left of the entry, cancel icon on the right of the entry
- Browse Activity: remove custom browse-dialog-cancel.svg
Changes for users:
- entry-cancel.svg - 22px size, new icon, use instead of dialog-cancel to improve entries
- entry-search.svg - 22px size, renamed from system-search.svg, change your code accordingly
- dialog-cancel.svg - 55px size, stays the same, use it in toolbars
- system-search.svg - 55px size, new, use it in toolbars
comment:21 Changed 10 years ago by manuq
- Keywords r+ olpc-test-pending added; r? removed
- Resolution set to fixed
- Status changed from new to closed
Pushed:
- artwork f3e16adf
- toolkit e36513f9
- shell 97178f9d
- browse f95ed83c
Changed 10 years ago by manuq
Toolkit gtk3 backport of the entry-cancel icon for sucrose-0.98 branch
comment:22 Changed 10 years ago by dnarvaez
- Component changed from sugar-artwork to Sugar
The size button is fixed, but it seems that is not well aligned. Take a look at the screenshot. Although, it seems that I'm having another problem with the theme.