all repos — fluxbox @ af7deab37956a180996f4420144c484fa7cdb5ed

custom fork of the fluxbox windowmanager

tweak winbutton icon drawing, plus a little fix to icon changes
rathnor rathnor
commit

af7deab37956a180996f4420144c484fa7cdb5ed

parent

b88f9b2a9e6a08cfb663b7177a9c037250d48fea

3 files changed, 26 insertions(+), 12 deletions(-)

jump to
M ChangeLogChangeLog

@@ -1,6 +1,8 @@

(Format: Year/Month/Day) Changes for 0.9.6: *03/10/31: + * Tweak some positioning for winbutton drawn icons (Simon) + WinButton.cc * Fix iconbar button alignment and squash inactive tools (Simon) - also fix a bunch of rounding issues -> keep in mind that titlebar/iconbar width may not be exactly
M src/IconButton.ccsrc/IconButton.cc

@@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: IconButton.cc,v 1.9 2003/10/31 10:37:09 rathnor Exp $ +// $Id: IconButton.cc,v 1.10 2003/10/31 19:32:39 rathnor Exp $ #include "IconButton.hh"

@@ -144,14 +144,14 @@

if (hints->flags & IconPixmapHint && hints->icon_pixmap != 0) { // setup icon window m_icon_window.show(); - int new_height = height() - m_icon_window.y(); - int new_width = height(); - m_icon_window.resize(new_width ? new_width : 1, new_height ? new_height : 1); + int new_height = height() - 2*m_icon_window.y(); // equally padded + int new_width = new_height; + m_icon_window.resize((new_width>0) ? new_width : 1, (new_height>0) ? new_height : 1); m_icon_pixmap.copy(hints->icon_pixmap); - m_icon_pixmap.scale(m_icon_window.height(), m_icon_window.height()); + m_icon_pixmap.scale(m_icon_window.width(), m_icon_window.height()); - setBackgroundPixmap(m_icon_pixmap.drawable()); + m_icon_window.setBackgroundPixmap(m_icon_pixmap.drawable()); } else { // no icon pixmap m_icon_window.move(0, 0);

@@ -185,6 +185,8 @@ setupWindow();

} void IconButton::setupWindow() { + + m_icon_window.clear(); if (!m_win.clientList().empty()) { setText(m_win.winClient().title());
M src/WinButton.ccsrc/WinButton.cc

@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -/// $Id: WinButton.cc,v 1.15 2003/09/22 12:07:00 rathnor Exp $ +/// $Id: WinButton.cc,v 1.16 2003/10/31 19:32:40 rathnor Exp $ #include "WinButton.hh" #include "App.hh"

@@ -49,6 +49,10 @@ }

void WinButton::drawType() { bool used = false; + + // if it's odd and we're centring, we need to add one + int oddW = width()%2; + int oddH = height()%2; switch (m_type) { case MAXIMIZE:

@@ -177,14 +181,15 @@

if (used) FbTk::FbWindow::clear(); else if (gc() != 0) { + // width/4 != width/2, so we use /4*2 so that it's properly centred if (m_listen_to.isStuck()) { fillRectangle(gc(), width()/2 - width()/4, height()/2 - height()/4, - width()/2, height()/2); + width()/4*2 + oddW, height()/4*2 + oddH); } else { fillRectangle(gc(), width()/2 - width()/10, height()/2 - height()/10, - width()/5, height()/5); + width()/10*2 + oddW, height()/10*2 + oddH); } } break;

@@ -222,10 +227,15 @@ else if (gc() != 0) { // must have valid graphic context

drawLine(gc(), 2, 2, - width() - 3, height() - 3); + width() - 2, height() - 2); + // I can't figure out why this second one needs a y offset of 1????? + // but it does - at least on my box: + // XFree86 Version 4.2.1.1 (Debian 4.2.1-12.1 20031003005825) + // (protocol Version 11, revision 0, vendor release 6600) + drawLine(gc(), - 2, width() - 3, - height() - 3, 2); + 2, height() - 3, + width() - 2, 1); } break; case SHADE: