]> Dogcows Code - chaz/openbox/commitdiff
label and focuslabel update their textures automatically on a style change
authorDana Jansens <danakj@orodu.net>
Tue, 3 Dec 2002 19:10:03 +0000 (19:10 +0000)
committerDana Jansens <danakj@orodu.net>
Tue, 3 Dec 2002 19:10:03 +0000 (19:10 +0000)
otk/focuslabel.cc
otk/focuslabel.hh
otk/label.cc
otk/label.hh

index 50b473d89c8ad2c8d64eb7455d7decac9e7499e6..234aca04c8396a18bdb4ec7247f2430fb20a1099 100644 (file)
@@ -16,9 +16,7 @@ OtkFocusLabel::OtkFocusLabel(OtkWidget *parent)
   const ScreenInfo *info = OBDisplay::screenInfo(getScreen());
   _xftdraw = XftDrawCreate(OBDisplay::display, getWindow(), info->getVisual(),
                            info->getColormap());
-  
-  setTexture(getStyle()->getLabelFocus());
-  setUnfocusTexture(getStyle()->getLabelUnfocus());
+  setStyle(getStyle());
 }
 
 OtkFocusLabel::~OtkFocusLabel()
@@ -26,6 +24,16 @@ OtkFocusLabel::~OtkFocusLabel()
   XftDrawDestroy(_xftdraw);
 }
 
+
+void OtkFocusLabel::setStyle(Style *style)
+{
+  OtkFocusWidget::setStyle(style);
+  
+  setTexture(getStyle()->getLabelFocus());
+  setUnfocusTexture(getStyle()->getLabelUnfocus());
+}
+
+
 void OtkFocusLabel::update(void)
 {
   if (_dirty) {
index cc94f05ad068d1bbd973b0170c247fab3e966c77..042082ebae58578c4c1b0fdef9d0f918b58d5c71 100644 (file)
@@ -18,6 +18,8 @@ public:
 
   void update(void);
 
+  virtual void setStyle(Style *style);
+  
 private:
   //! Object used by Xft to render to the drawable
   XftDraw *_xftdraw;
index 24cf84028ea0f5f31dc261dd0896bd75e79384d7..170974ac2d2c449ef072362cfdf06e7686db5092 100644 (file)
@@ -15,7 +15,7 @@ OtkLabel::OtkLabel(OtkWidget *parent)
   _xftdraw = XftDrawCreate(OBDisplay::display, getWindow(), info->getVisual(),
                            info->getColormap());
   
-  setTexture(getStyle()->getLabelUnfocus());
+  setStyle(getStyle());
 }
 
 OtkLabel::~OtkLabel()
@@ -23,6 +23,14 @@ OtkLabel::~OtkLabel()
   XftDrawDestroy(_xftdraw);
 }
 
+void OtkLabel::setStyle(Style *style)
+{
+  OtkWidget::setStyle(style);
+
+  setTexture(getStyle()->getLabelUnfocus());
+}
+
+
 void OtkLabel::update(void)
 {
   if (_dirty) {
index c959a2fa662688747b82483a89220ed00acf6fcb..0dd81442582cfb13d01b970356d97be666de2d71 100644 (file)
@@ -18,6 +18,8 @@ public:
 
   void update(void);
 
+  virtual void setStyle(Style *style);
+  
 private:
   //! Object used by Xft to render to the drawable
   XftDraw *_xftdraw;
This page took 0.028186 seconds and 4 git commands to generate.