From 26adc8853bc04f3f2f2d2e5f5ac94121f23b72e2 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Tue, 3 Dec 2002 19:10:03 +0000 Subject: label and focuslabel update their textures automatically on a style change --- otk/focuslabel.cc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'otk/focuslabel.cc') 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) { -- cgit v1.2.3