aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/Button.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-10-13 23:43:11 (GMT)
committerfluxgen <fluxgen>2003-10-13 23:43:11 (GMT)
commit2aef1e67c3fa06157b7607462463f796e881c215 (patch)
tree6b9183f9d9e4a0d84815f5c130db65640af04050 /src/FbTk/Button.cc
parent9911b38f8df93871542e3a7cdd5611e42e9bd106 (diff)
downloadfluxbox-2aef1e67c3fa06157b7607462463f796e881c215.zip
fluxbox-2aef1e67c3fa06157b7607462463f796e881c215.tar.bz2
added pressed color
Diffstat (limited to 'src/FbTk/Button.cc')
-rw-r--r--src/FbTk/Button.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/FbTk/Button.cc b/src/FbTk/Button.cc
index bcbde70..03e1386 100644
--- a/src/FbTk/Button.cc
+++ b/src/FbTk/Button.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: Button.cc,v 1.15 2003/09/10 21:24:36 fluxgen Exp $ 22// $Id: Button.cc,v 1.16 2003/10/13 23:43:11 fluxgen Exp $
23 23
24#include "Button.hh" 24#include "Button.hh"
25 25
@@ -36,6 +36,7 @@ Button::Button(int screen_num, int x, int y,
36 m_foreground_pm(0), 36 m_foreground_pm(0),
37 m_background_pm(0), 37 m_background_pm(0),
38 m_pressed_pm(0), 38 m_pressed_pm(0),
39 m_pressed_color("black", screen_num),
39 m_gc(DefaultGC(FbTk::App::instance()->display(), screen_num)), 40 m_gc(DefaultGC(FbTk::App::instance()->display(), screen_num)),
40 m_pressed(false) { 41 m_pressed(false) {
41 42
@@ -50,6 +51,7 @@ Button::Button(const FbWindow &parent, int x, int y,
50 m_foreground_pm(0), 51 m_foreground_pm(0),
51 m_background_pm(0), 52 m_background_pm(0),
52 m_pressed_pm(0), 53 m_pressed_pm(0),
54 m_pressed_color("black", parent.screenNumber()),
53 m_gc(DefaultGC(FbTk::App::instance()->display(), screenNumber())), 55 m_gc(DefaultGC(FbTk::App::instance()->display(), screenNumber())),
54 m_pressed(false) { 56 m_pressed(false) {
55 // add this to eventmanager 57 // add this to eventmanager
@@ -76,6 +78,10 @@ void Button::setPressedPixmap(Pixmap pm) {
76 m_pressed_pm = pm; 78 m_pressed_pm = pm;
77} 79}
78 80
81void Button::setPressedColor(const FbTk::Color &color) {
82 m_pressed_color = color;
83}
84
79void Button::setBackgroundColor(const Color &color) { 85void Button::setBackgroundColor(const Color &color) {
80 m_background_pm = 0; // we're using background color now 86 m_background_pm = 0; // we're using background color now
81 m_background_color = color; 87 m_background_color = color;
@@ -90,6 +96,9 @@ void Button::setBackgroundPixmap(Pixmap pm) {
90void Button::buttonPressEvent(XButtonEvent &event) { 96void Button::buttonPressEvent(XButtonEvent &event) {
91 if (m_pressed_pm != 0) 97 if (m_pressed_pm != 0)
92 FbWindow::setBackgroundPixmap(m_pressed_pm); 98 FbWindow::setBackgroundPixmap(m_pressed_pm);
99 else if (m_pressed_color.isAllocated())
100 FbWindow::setBackgroundColor(m_pressed_color);
101
93 m_pressed = true; 102 m_pressed = true;
94 clear(); 103 clear();
95 updateTransparent(); 104 updateTransparent();