X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=otk%2Fbutton.cc;h=9f3930873e20453bc50969c26ed474a28039de7b;hb=e9ec2ce0ebccf3b139ebf4fccf093e8ee0366c76;hp=502a226f2d8033362d682ce5d8d9957c8795468a;hpb=1d897f432e54400cb2a0e1499712782b336fd728;p=chaz%2Fopenbox diff --git a/otk/button.cc b/otk/button.cc index 502a226f..9f393087 100644 --- a/otk/button.cc +++ b/otk/button.cc @@ -12,18 +12,24 @@ OtkButton::OtkButton(OtkWidget *parent) : OtkFocusLabel(parent), _pressed(false), _pressed_focus_tx(0), _pressed_unfocus_tx(0), _unpr_focus_tx(0), _unpr_unfocus_tx(0) { - setTexture(getStyle()->getButtonFocus()); - setUnfocusTexture(getStyle()->getButtonUnfocus()); - _pressed_focus_tx = getStyle()->getButtonPressedFocus(); - _pressed_unfocus_tx = getStyle()->getButtonPressedUnfocus(); } OtkButton::~OtkButton() { - if (_pressed_focus_tx) delete _pressed_focus_tx; - if (_pressed_unfocus_tx) delete _pressed_unfocus_tx; } + +void OtkButton::setStyle(Style *style) +{ + OtkFocusLabel::setStyle(style); + + setTexture(style->getButtonFocus()); + setUnfocusTexture(style->getButtonUnfocus()); + _pressed_focus_tx = style->getButtonPressedFocus(); + _pressed_unfocus_tx = style->getButtonPressedUnfocus(); +} + + void OtkButton::press(unsigned int mouse_button) { if (_pressed) return;