Tweak sizing for general SetWindowVariant() implementation.

Previously, the generic implementation closely mirrored OS X's scaling
factors, with the small size being 3/4 of the normal one and mini 2/3.
This works well with OS X's UI font and font rendering, but less so on
other platforms: wxWINDOW_VARIANT_SMALL is barely readable on Windows
and wxWINDOW_VARIANT_MINI is illegible.  In wxGTK, both sizes are
readable, but don't match small text used in native GNOME interfaces.

Change the sizing to use the same scaling factor of 1.2 between all
variant steps.  This is the same factor that CSS 1.2 defines for
relative sizes and is also used by Pango's (and so GTK+) size scaling in
markup.  This makes wxWINDOW_VARIANT_SMALL identical in size to <small>
markup used in GTK+.

On Windows, this changes default UI font scaling to be less steep and
while wxWINDOW_VARIANT_MINI is still tiny and hard to read (as it is on
OS X), wxWINDOW_VARIANT_SMALL is now readable, thanks to being only 1pt
smaller than the full size (for default GUI font).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77519 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík 2014-09-03 06:54:59 +00:00
parent 56d0a94ec8
commit 796c8079a0

View File

@ -1017,15 +1017,15 @@ void wxWindowBase::DoSetWindowVariant( wxWindowVariant variant )
break;
case wxWINDOW_VARIANT_SMALL:
size = wxRound(size * 3.0 / 4.0);
size = wxRound(size / 1.2);
break;
case wxWINDOW_VARIANT_MINI:
size = wxRound(size * 2.0 / 3.0);
size = wxRound(size / (1.2 * 1.2));
break;
case wxWINDOW_VARIANT_LARGE:
size = wxRound(size * 5.0 / 4.0);
size = wxRound(size * 1.2);
break;
default: