From 394b8bf829371b6a6f69854eac35d20ad0232814 Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Wed, 21 Nov 2012 12:57:11 +0100 Subject: observer: Fix font sizes On wxWidgets 2.9 they seem to have fixed font sizes in GC's --- lib/observer/src/observer_app_wx.erl | 3 ++- lib/observer/src/observer_perf_wx.erl | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/observer') diff --git a/lib/observer/src/observer_app_wx.erl b/lib/observer/src/observer_app_wx.erl index 380532e90c..b574307007 100644 --- a/lib/observer/src/observer_app_wx.erl +++ b/lib/observer/src/observer_app_wx.erl @@ -115,8 +115,9 @@ init([Notebook, Parent]) -> end, UseGC = haveGC(DrawingArea), + Version28 = ?wxMAJOR_VERSION =:= 2 andalso ?wxMINOR_VERSION =:= 8, Font = case os:type() of - {unix,_} when UseGC -> + {unix,_} when UseGC, Version28 -> wxFont:new(12,?wxFONTFAMILY_DECORATIVE,?wxFONTSTYLE_NORMAL,?wxFONTWEIGHT_NORMAL); _ -> wxSystemSettings:getFont(?wxSYS_DEFAULT_GUI_FONT) diff --git a/lib/observer/src/observer_perf_wx.erl b/lib/observer/src/observer_perf_wx.erl index abf90ac612..d0dd46b402 100644 --- a/lib/observer/src/observer_perf_wx.erl +++ b/lib/observer/src/observer_perf_wx.erl @@ -91,10 +91,11 @@ init([Notebook, Parent]) -> end, UseGC = haveGC(Panel), + Version28 = ?wxMAJOR_VERSION =:= 2 andalso ?wxMINOR_VERSION =:= 8, {Font, SmallFont} = case os:type() of - {unix, _} when UseGC -> - %% Def font is really small when using Graphics contexts for some reason + {unix, _} when UseGC, Version28 -> + %% Def font is really small when using Graphics contexts in 2.8 %% Hardcode it F = wxFont:new(12,?wxFONTFAMILY_DECORATIVE,?wxFONTSTYLE_NORMAL,?wxFONTWEIGHT_BOLD), SF = wxFont:new(10, ?wxFONTFAMILY_DECORATIVE, ?wxFONTSTYLE_NORMAL, ?wxFONTWEIGHT_NORMAL), -- cgit v1.2.3