From 796c8079a0d4e9657b4fc94ba12a2232e454debc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Wed, 3 Sep 2014 06:54:59 +0000 Subject: [PATCH] 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 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 --- src/common/wincmn.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index 25b487449d..9b9da9a023 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -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: