Skip to content
Snippets Groups Projects
Commit b932fd8f authored by Fons Rademakers's avatar Fons Rademakers
Browse files

From Ilka:

Fix in TGLabel::DoRedraw() method - disabled labels were drawn with default
font in spite of different font structure in use (set in the constructor
or by the method TGLabel::SetTextFont). In addition, this patch fixes
the reported case on Forum at:
http://root.cern.ch/phpBB2/viewtopic.php?t=2742


git-svn-id: http://root.cern.ch/svn/root/trunk@13342 27541ba8-7e3a-0410-8455-c3a389f83636
parent e24abc12
No related branches found
No related tags found
No related merge requests found
// @(#)root/gui:$Name: $:$Id: TGLabel.cxx,v 1.18 2005/05/10 15:11:26 rdm Exp $
// @(#)root/gui:$Name: $:$Id: TGLabel.cxx,v 1.19 2005/09/05 13:33:08 rdm Exp $
// Author: Fons Rademakers 06/01/98
/*************************************************************************
......@@ -149,11 +149,20 @@ void TGLabel::DoRedraw()
int max_ascent, max_descent;
gVirtualX->GetFontProperties(fFontStruct, max_ascent, max_descent);
if (!fDisabled) {
fText->Draw(fId, GetBckgndGC()(), x +1, y +1 + max_ascent);
fText->Draw(fId, fNormGC, x, y + max_ascent);
} else {
fText->Draw(fId, GetHilightGC()(), x + 1, y + 1 + max_ascent);
fText->Draw(fId, GetShadowGC()(), x, y + max_ascent);
FontH_t fontH;
if (GetDefaultFontStruct() != fFontStruct)
fontH = gVirtualX->GetFontHandle(fFontStruct);
else
fontH = gVirtualX->GetFontHandle(GetDefaultFontStruct());
TGGC *gc;
gc = fClient->GetResourcePool()->GetGCPool()->FindGC(GetHilightGC()());
gc->SetFont(fontH);
fText->Draw(fId, gc->GetGC(), x + 1, y + 1 + max_ascent);
gc = fClient->GetResourcePool()->GetGCPool()->FindGC(GetShadowGC()());
gc->SetFont(fontH);
fText->Draw(fId, gc->GetGC(), x, y + max_ascent);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment