X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=otk%2Flabel.cc;h=da9edfd179708c591b30b6fbbe2e6f4ff6ceed59;hb=9e8f89b61976424c7d1c6e6a37498da74b7850ce;hp=4a61efd078fca007c669a6c8b010b43da167c7a1;hpb=2ae2b257d39ea62640c2590f794e4275c6db1cd4;p=chaz%2Fopenbox diff --git a/otk/label.cc b/otk/label.cc index 4a61efd0..da9edfd1 100644 --- a/otk/label.cc +++ b/otk/label.cc @@ -8,34 +8,34 @@ namespace otk { -OtkLabel::OtkLabel(OtkWidget *parent) - : OtkWidget(parent), _text("") +Label::Label(Widget *parent) + : Widget(parent), _text("") { - const ScreenInfo *info = OBDisplay::screenInfo(screen()); - _xftdraw = XftDrawCreate(OBDisplay::display, window(), info->visual(), + const ScreenInfo *info = display->screenInfo(screen()); + _xftdraw = XftDrawCreate(**display, window(), info->visual(), info->colormap()); } -OtkLabel::~OtkLabel() +Label::~Label() { XftDrawDestroy(_xftdraw); } -void OtkLabel::setStyle(Style *style) +void Label::setStyle(Style *style) { - OtkWidget::setStyle(style); + Widget::setStyle(style); setTexture(style->getLabelUnfocus()); } -void OtkLabel::update(void) +void Label::update(void) { if (_dirty) { - const BFont *ft = style()->getFont(); + 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 @@ -64,11 +64,11 @@ void OtkLabel::update(void) } } - OtkWidget::update(); + Widget::update(); ft->drawString(_xftdraw, x, 0, *style()->getTextUnfocus(), t); } else - OtkWidget::update(); + Widget::update(); } }