After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 101859 - Gtk units need to be based on font size
Gtk units need to be based on font size
Status: RESOLVED WONTFIX
Product: gtk+
Classification: Platform
Component: Widget: Other
2.1.x
Other All
: Normal enhancement
: 3.0
Assigned To: gtk-bugs
gtk-bugs
AP4
: 125158 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2002-12-23 16:41 UTC by Calum Benson
Modified: 2015-03-08 14:51 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Calum Benson 2002-12-23 16:41:10 UTC
Currently, gtk measurements are specified in pixels.  Particularly now that
we're being accessibility-friendly, people often want to change their font
sizes without adversely affecting the layout of their windows.

The only surefire way to do this is to base all measurements on some metric
of the current system font (typically the width of the letter 'm' at some
standard point size) at the current resolution, rather than using
pixel-based measurement.  Windoze does this with its Dialog Units (DLUs),
not sure what the Mac does.

This is obviously a Big Job :)
Comment 1 Havoc Pennington 2002-12-23 16:42:50 UTC
I think I can confidently punt this off all near-future milestones, 
even though Owen may be on vacation already. ;-)
Comment 2 Calum Benson 2003-04-03 14:56:15 UTC
Updating status_whiteboard field to reflect A11Y team's assessment 
of accessibility impact.
Comment 3 Matthias Clasen 2003-07-29 18:28:50 UTC
See
http://mail.gnome.org/archives/gtk-devel-list/2003-February/msg00009.html
for a concrete proposal
Comment 4 Calum Benson 2003-08-07 16:17:57 UTC
Apologies for spam... marking as GNOMEVER2.3 so it appears on the official GNOME
bug list :)
Comment 5 Owen Taylor 2003-10-21 20:50:57 UTC
*** Bug 125158 has been marked as a duplicate of this bug. ***
Comment 6 Michael P. Jung 2003-10-21 21:02:25 UTC
"Bug 125158" is a duplicate, but proposes another solution for that
issue. Instead of specifying concrete sizes in metric units I think
this should be a question of the used theme engine. It would be better
to provide the application programmer with a predefined set of styles
for a given widget. That way the theme engine developer could set the
padding/margin/... values according to the given style of the widget.
Comment 7 Calum Benson 2004-10-21 16:51:46 UTC
Apologies for spam-- ensuring Sun a11y team are cc'ed on all current a11y bugs.
 Filter on "SUN A11Y SPAM" to ignore.
Comment 8 Calum Benson 2006-04-26 17:12:09 UTC
Apologies for spam... ensuring Sun a11y folks are cc'ed on all current accessibility bugs.
Comment 9 Magnus Bergman 2008-06-11 01:21:41 UTC
This could be considered two different, but related, issues with slightly different solutions IMHO.

The first one is to set the default size of GtkWindow and the default position of GtkPaned. (Setting the size of most other things makes little sense since GTK is very good at this on it's own). In this case I think Calum Bensons solution is adequate.
An alternative approach could be to set sizes in points and calculate the pixel size from DPI and a global size modifier (which defaults to 1 and need not to be changed in most cases) which could also be used to set default font sizes.

The other case is the size of paddings and spacings (as described in "Bug 125158"). The Gnome HIG partially solves this issue by saying that spacings should always be any multiplier of 6 (section 8.2.3). Most developers interpret this as 6 or 12, but some (with very large screens I guess) as 24 or more. The best size of spacings is depending on the monitor size and, perhaps more importantly, the users personal taste. So I think the best solution would be to only let the developer decide if there should be a spacing or not and let the theme decide the size of the spacing.
Since the Gnome HIG suggests that some spacings should be differ in cases GTK might not be able distingish by itself it might be a good idea to let developers have a set of spacings to choose from, like for example:
GTK_SPACING_NONE = 0
GTK_SPACING_WIDGETS = -1
GTK_SPACING_GROUP_SEPARATOR = -2
GTK_SPACING_ICON_LABEL = -3
GTK_SPACING_DIALOG_BORDER = -4
(The last one, on the other hand, would be really easy for GTK to figure out by itself.)

Comment 10 Matthias Clasen 2015-03-08 14:51:18 UTC
It seems clear by now that we're going in a different direction