summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2002-12-03 19:10:03 +0000
committerDana Jansens <danakj@orodu.net>2002-12-03 19:10:03 +0000
commit26adc8853bc04f3f2f2d2e5f5ac94121f23b72e2 (patch)
tree363f53c275dfb53731c60c92f419d40adccae19d
parentf890d31d6bf41db5c565e4f1b25132a6df1bd044 (diff)
label and focuslabel update their textures automatically on a style change
-rw-r--r--otk/focuslabel.cc14
-rw-r--r--otk/focuslabel.hh2
-rw-r--r--otk/label.cc10
-rw-r--r--otk/label.hh2
4 files changed, 24 insertions, 4 deletions
diff --git a/otk/focuslabel.cc b/otk/focuslabel.cc
index 50b473d8..234aca04 100644
--- a/otk/focuslabel.cc
+++ b/otk/focuslabel.cc
@@ -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) {
diff --git a/otk/focuslabel.hh b/otk/focuslabel.hh
index cc94f05a..042082eb 100644
--- a/otk/focuslabel.hh
+++ b/otk/focuslabel.hh
@@ -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;
diff --git a/otk/label.cc b/otk/label.cc
index 24cf8402..170974ac 100644
--- a/otk/label.cc
+++ b/otk/label.cc
@@ -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) {
diff --git a/otk/label.hh b/otk/label.hh
index c959a2fa..0dd81442 100644
--- a/otk/label.hh
+++ b/otk/label.hh
@@ -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;