X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=otk%2Flabel.cc;h=2d8b944261878cbca576b083d6db366f0022677a;hb=9b6e5f9cf49df78be25720f9c4b33a733b856c9b;hp=cacbb08e18f8df6c2ae1293566c502796c6a94e4;hpb=74061b4e2d33d7e2101c4edda26cfc2a1294f32b;p=chaz%2Fopenbox diff --git a/otk/label.cc b/otk/label.cc index cacbb08e..2d8b9442 100644 --- a/otk/label.cc +++ b/otk/label.cc @@ -11,14 +11,10 @@ namespace otk { Label::Label(Widget *parent) : Widget(parent), _text("") { - const ScreenInfo *info = Display::screenInfo(screen()); - _xftdraw = XftDrawCreate(Display::display, window(), info->visual(), - info->colormap()); } Label::~Label() { - XftDrawDestroy(_xftdraw); } void Label::setStyle(Style *style) @@ -35,7 +31,7 @@ void Label::update(void) const Font *ft = style()->getFont(); unsigned int sidemargin = style()->getBevelWidth() * 2; - userstring t = _text; // the actual text to draw + ustring t = _text; // the actual text to draw int x = sidemargin; // x coord for the text // find a string that will fit inside the area for text @@ -66,7 +62,8 @@ void Label::update(void) Widget::update(); - ft->drawString(_xftdraw, x, 0, *style()->getTextUnfocus(), t); + display->renderControl(_screen)-> + drawString(this, *ft, x, 0, *style()->getTextUnfocus(), t); } else Widget::update(); }