]>
Dogcows Code - chaz/openbox/blob - otk/focuswidget.cc
f5b176bfc4bc1bd90dde1dc3fbbce33a9248e3b8
1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
4 # include "../config.h"
7 #include "focuswidget.hh"
11 OtkFocusWidget::OtkFocusWidget(OtkWidget
*parent
, Direction direction
)
12 : OtkWidget(parent
, direction
), _unfocus_texture(0), _unfocus_bcolor(0)
15 _focus_texture
= parent
->getTexture();
16 _focus_bcolor
= parent
->getBorderColor();
19 OtkFocusWidget::~OtkFocusWidget()
24 void OtkFocusWidget::focus(void)
26 if (!isVisible() || _focused
)
33 OtkWidget::setBorderColor(_focus_bcolor
);
35 OtkWidget::setTexture(_focus_texture
);
39 void OtkFocusWidget::unfocus(void)
41 if (!isVisible() || !_focused
)
48 OtkWidget::setBorderColor(_unfocus_bcolor
);
50 OtkWidget::setTexture(_unfocus_texture
);
53 OtkWidget::OtkWidgetList children
= OtkWidget::getChildren();
55 OtkWidget::OtkWidgetList::iterator it
= children
.begin(),
58 OtkFocusWidget
*tmp
= 0;
59 for (; it
!= end
; ++it
) {
60 tmp
= dynamic_cast<OtkFocusWidget
*>(*it
);
61 if (tmp
) tmp
->unfocus();
65 void OtkFocusWidget::setTexture(BTexture
*texture
)
67 OtkWidget::setTexture(texture
);
68 _focus_texture
= texture
;
71 void OtkFocusWidget::setBorderColor(const BColor
*color
)
73 OtkWidget::setBorderColor(color
);
74 _focus_bcolor
= color
;
This page took 0.038742 seconds and 3 git commands to generate.