]> Dogcows Code - chaz/openbox/blob - otk/focuswidget.cc
rm consts that wont compile on some libfreetype's
[chaz/openbox] / otk / focuswidget.cc
1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
2
3 #ifdef HAVE_CONFIG_H
4 # include "../config.h"
5 #endif
6
7 #include "focuswidget.hh"
8
9 namespace otk {
10
11 OtkFocusWidget::OtkFocusWidget(OtkWidget *parent, Direction direction)
12 : OtkWidget(parent, direction), _unfocus_texture(0), _unfocus_bcolor(0)
13 {
14 _focused = true;
15 _focus_texture = parent->texture();
16 _focus_bcolor = parent->borderColor();
17 }
18
19 OtkFocusWidget::~OtkFocusWidget()
20 {
21 }
22
23 #include <stdio.h>
24 void OtkFocusWidget::focus(void)
25 {
26 if (_focused)
27 return;
28
29 OtkWidget::focus();
30
31 if (_focus_bcolor)
32 OtkWidget::setBorderColor(_focus_bcolor);
33
34 OtkWidget::setTexture(_focus_texture);
35 update();
36 }
37
38 void OtkFocusWidget::unfocus(void)
39 {
40 if (!_focused)
41 return;
42
43 OtkWidget::unfocus();
44
45 if (_unfocus_bcolor)
46 OtkWidget::setBorderColor(_unfocus_bcolor);
47
48 OtkWidget::setTexture(_unfocus_texture);
49 update();
50 }
51
52 void OtkFocusWidget::setTexture(BTexture *texture)
53 {
54 OtkWidget::setTexture(texture);
55 _focus_texture = texture;
56 }
57
58 void OtkFocusWidget::setBorderColor(const BColor *color)
59 {
60 OtkWidget::setBorderColor(color);
61 _focus_bcolor = color;
62 }
63
64 }
This page took 0.042887 seconds and 4 git commands to generate.