X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=otk%2Fbutton.cc;h=774aa11bf87eeb10e03a9a332604074297b21737;hb=e451c08ac5a103362adbece9b8a11a16ade739c1;hp=8d63ed0c3b71a6268b353904d31040a668907ddd;hpb=99cd843fc6dc7a7f55b6c90fd1162f233853aad2;p=chaz%2Fopenbox diff --git a/otk/button.cc b/otk/button.cc index 8d63ed0c..774aa11b 100644 --- a/otk/button.cc +++ b/otk/button.cc @@ -1,15 +1,14 @@ // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*- -#ifdef HAVE_CONFIG_H -# include "../config.h" -#endif +#include "config.h" #include "button.hh" namespace otk { Button::Button(Widget *parent) - : Label(parent), _default(false), _pressed(false) + : Label(parent), + _pressed(false) { setHorizontalJustify(RenderStyle::CenterJustify); setVerticalJustify(RenderStyle::CenterJustify); @@ -53,16 +52,9 @@ void Button::buttonReleaseHandler(const XButtonEvent &e) release(e.button); } -void Button::setDefault(bool d) -{ - _default = d; - styleChanged(*RenderStyle::style(screen())); - refresh(); -} - void Button::styleChanged(const RenderStyle &style) { - if (_default) { + if (isHighlighted()) { if (_pressed) _texture = style.buttonPressFocusBackground(); else @@ -75,7 +67,7 @@ void Button::styleChanged(const RenderStyle &style) _texture = style.buttonUnpressUnfocusBackground(); _forecolor = style.buttonUnfocusColor(); } - Widget::styleChanged(style); + refresh(); } }