]> Dogcows Code - chaz/openbox/blobdiff - otk/label.cc
provide RenderControls to all otk from the display class. initialize them all there...
[chaz/openbox] / otk / label.cc
index 6b6a8e358424406a34a2ca95678f501cbfeeb1ad..2d8b944261878cbca576b083d6db366f0022677a 100644 (file)
@@ -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;
 
-    std::string 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();
 }
This page took 0.024752 seconds and 4 git commands to generate.