]>
Dogcows Code - chaz/openbox/blob - otk/button.cc
1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
9 Button::Button(Widget
*parent
)
13 setHorizontalJustify(RenderStyle::CenterJustify
);
14 setVerticalJustify(RenderStyle::CenterJustify
);
15 styleChanged(*RenderStyle::style(screen()));
22 void Button::press(unsigned int mouse_button
)
27 _mouse_button
= mouse_button
;
29 styleChanged(*RenderStyle::style(screen()));
33 void Button::release(unsigned int mouse_button
)
35 if (!_pressed
|| _mouse_button
!= mouse_button
) return; // wrong button
39 styleChanged(*RenderStyle::style(screen()));
42 clickHandler(_mouse_button
);
45 void Button::buttonPressHandler(const XButtonEvent
&e
)
47 Widget::buttonPressHandler(e
);
51 void Button::buttonReleaseHandler(const XButtonEvent
&e
)
53 Widget::buttonReleaseHandler(e
);
57 void Button::styleChanged(const RenderStyle
&style
)
59 if (isHighlighted()) {
61 _texture
= style
.buttonPressFocusBackground();
63 _texture
= style
.buttonUnpressFocusBackground();
64 _forecolor
= style
.buttonFocusColor();
67 _texture
= style
.buttonPressUnfocusBackground();
69 _texture
= style
.buttonUnpressUnfocusBackground();
70 _forecolor
= style
.buttonUnfocusColor();
This page took 0.03634 seconds and 4 git commands to generate.