aboutsummaryrefslogtreecommitdiff
path: root/src/IconButton.cc
diff options
context:
space:
mode:
authorrathnor <rathnor>2003-10-31 19:32:40 (GMT)
committerrathnor <rathnor>2003-10-31 19:32:40 (GMT)
commitaf7deab37956a180996f4420144c484fa7cdb5ed (patch)
treee31cd5e0231c8cff359a9bc799e57059109bd55c /src/IconButton.cc
parentb88f9b2a9e6a08cfb663b7177a9c037250d48fea (diff)
downloadfluxbox-af7deab37956a180996f4420144c484fa7cdb5ed.zip
fluxbox-af7deab37956a180996f4420144c484fa7cdb5ed.tar.bz2
tweak winbutton icon drawing, plus a little fix to icon changes
Diffstat (limited to 'src/IconButton.cc')
-rw-r--r--src/IconButton.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/IconButton.cc b/src/IconButton.cc
index 2f68ecf..093298e 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.9 2003/10/31 10:37:09 rathnor Exp $ 23// $Id: IconButton.cc,v 1.10 2003/10/31 19:32:39 rathnor Exp $
24 24
25#include "IconButton.hh" 25#include "IconButton.hh"
26 26
@@ -144,14 +144,14 @@ void IconButton::update(FbTk::Subject *subj) {
144 if (hints->flags & IconPixmapHint && hints->icon_pixmap != 0) { 144 if (hints->flags & IconPixmapHint && hints->icon_pixmap != 0) {
145 // setup icon window 145 // setup icon window
146 m_icon_window.show(); 146 m_icon_window.show();
147 int new_height = height() - m_icon_window.y(); 147 int new_height = height() - 2*m_icon_window.y(); // equally padded
148 int new_width = height(); 148 int new_width = new_height;
149 m_icon_window.resize(new_width ? new_width : 1, new_height ? new_height : 1); 149 m_icon_window.resize((new_width>0) ? new_width : 1, (new_height>0) ? new_height : 1);
150 150
151 m_icon_pixmap.copy(hints->icon_pixmap); 151 m_icon_pixmap.copy(hints->icon_pixmap);
152 m_icon_pixmap.scale(m_icon_window.height(), m_icon_window.height()); 152 m_icon_pixmap.scale(m_icon_window.width(), m_icon_window.height());
153 153
154 setBackgroundPixmap(m_icon_pixmap.drawable()); 154 m_icon_window.setBackgroundPixmap(m_icon_pixmap.drawable());
155 } else { 155 } else {
156 // no icon pixmap 156 // no icon pixmap
157 m_icon_window.move(0, 0); 157 m_icon_window.move(0, 0);
@@ -186,6 +186,8 @@ void IconButton::update(FbTk::Subject *subj) {
186 186
187void IconButton::setupWindow() { 187void IconButton::setupWindow() {
188 188
189 m_icon_window.clear();
190
189 if (!m_win.clientList().empty()) { 191 if (!m_win.clientList().empty()) {
190 setText(m_win.winClient().title()); 192 setText(m_win.winClient().title());
191 // draw with x offset and y offset 193 // draw with x offset and y offset