summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/IconButton.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/IconButton.cc b/src/IconButton.cc
index f2fe45c..ba6fff8 100644
--- a/src/IconButton.cc
+++ b/src/IconButton.cc
@@ -20,7 +20,7 @@
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21// DEALINGS IN THE SOFTWARE. 21// DEALINGS IN THE SOFTWARE.
22 22
23// $Id: IconButton.cc,v 1.1 2003/08/11 15:45:50 fluxgen Exp $ 23// $Id: IconButton.cc,v 1.2 2003/08/12 00:16:16 fluxgen Exp $
24 24
25#include "IconButton.hh" 25#include "IconButton.hh"
26 26
@@ -30,6 +30,7 @@
30#include "IconButtonTheme.hh" 30#include "IconButtonTheme.hh"
31#include "Window.hh" 31#include "Window.hh"
32#include "WinClient.hh" 32#include "WinClient.hh"
33#include "SimpleCommand.hh"
33 34
34#ifdef HAVE_CONFIG_H 35#ifdef HAVE_CONFIG_H
35#include "config.h" 36#include "config.h"
@@ -50,6 +51,9 @@ IconButton::IconButton(const FbTk::FbWindow &parent, const FbTk::Font &font,
50 m_icon_window(window(), 1, 1, 1, 1, 51 m_icon_window(window(), 1, 1, 1, 1,
51 ExposureMask | ButtonPressMask | ButtonReleaseMask) { 52 ExposureMask | ButtonPressMask | ButtonReleaseMask) {
52 53
54 FbTk::RefCount<FbTk::Command> focus(new FbTk::SimpleCommand<FluxboxWindow>(m_win, &FluxboxWindow::raiseAndFocus));
55 setOnClick(focus);
56
53 m_win.hintSig().attach(this); 57 m_win.hintSig().attach(this);
54 58
55 FbTk::EventManager::instance()->add(*this, m_icon_window); 59 FbTk::EventManager::instance()->add(*this, m_icon_window);
@@ -115,16 +119,16 @@ void IconButton::update(FbTk::Subject *subj) {
115 119
116 if(hints->flags & IconMaskHint) { 120 if(hints->flags & IconMaskHint) {
117 m_icon_mask.copy(hints->icon_mask); 121 m_icon_mask.copy(hints->icon_mask);
118 m_icon_mask.scale(height(), height()); 122 m_icon_mask.scale(m_icon_pixmap.width(), m_icon_pixmap.height());
119 } else 123 } else
120 m_icon_mask = 0; 124 m_icon_mask = 0;
121 125
122 XFree(hints); 126 XFree(hints);
127 hints = 0;
123 128
124#ifdef SHAPE 129#ifdef SHAPE
125 //!! TODO! bugs!?! 130
126 /* 131 if (m_icon_mask.drawable() != 0) {
127 if (m_icon_mask.drawable() != 0) {
128 XShapeCombineMask(FbTk::App::instance()->display(), 132 XShapeCombineMask(FbTk::App::instance()->display(),
129 m_icon_window.drawable(), 133 m_icon_window.drawable(),
130 ShapeBounding, 134 ShapeBounding,
@@ -132,7 +136,7 @@ void IconButton::update(FbTk::Subject *subj) {
132 m_icon_mask.drawable(), 136 m_icon_mask.drawable(),
133 ShapeSet); 137 ShapeSet);
134 } 138 }
135 */ 139
136#endif // SHAPE 140#endif // SHAPE
137 141
138 setupWindow(); 142 setupWindow();