X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=otk%2Flabel.hh;h=9c32e544936ea0ebc414633814572690eec585e4;hb=9dd156ce516fe51f846d82e447f060bb4b2a6918;hp=ad938f102e70f7ef72460062cfa1536099853fdf;hpb=5a90d2b671f01f29043ab82f909440de0abfa362;p=chaz%2Fopenbox diff --git a/otk/label.hh b/otk/label.hh index ad938f10..9c32e544 100644 --- a/otk/label.hh +++ b/otk/label.hh @@ -3,7 +3,6 @@ #define __label_hh #include "widget.hh" -#include "font.hh" namespace otk { @@ -17,15 +16,22 @@ public: inline const ustring &getText(void) const { return _text; } void setText(const ustring &text) { _text = text; _dirty = true; } - void update(void); + virtual void renderForeground(void); - virtual void setStyle(Style *style); + virtual void update(); + + void fitString(const std::string &str); + void fitSize(int w, int h); + + virtual void setStyle(RenderStyle *style); private: - //! Object used by Xft to render to the drawable - XftDraw *_xftdraw; - //! Text displayed in the label + //! Text to be displayed in the label ustring _text; + //! The actual text being shown, may be a subset of _text + ustring _drawtext; + //! The drawing offset for the text + int _drawx; }; }