From 9207eb135c2b26d6b86afee42ff389afa8d3003f Mon Sep 17 00:00:00 2001 From: fluxgen Date: Tue, 12 Nov 2002 22:57:03 +0000 Subject: check string size before draw --- src/Tab.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Tab.cc b/src/Tab.cc index 2cc3c84..6c87b6e 100644 --- a/src/Tab.cc +++ b/src/Tab.cc @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Tab.cc,v 1.38 2002/11/12 16:13:24 rathnor Exp $ +// $Id: Tab.cc,v 1.39 2002/11/12 22:57:03 fluxgen Exp $ #include "Tab.hh" @@ -358,6 +358,10 @@ void Tab::shade() { // TODO: the "draw in pressed mode" //----------------------------------- void Tab::draw(bool pressed) const { + XClearWindow(m_display, m_tabwin); + + if (m_win->getTitle().size() == 0) // we don't have anything to draw + return; GC gc = ((m_win->isFocused()) ? m_win->getScreen()->getWindowStyle()->tab.l_text_focus_gc : m_win->getScreen()->getWindowStyle()->tab.l_text_unfocus_gc); @@ -404,9 +408,7 @@ void Tab::draw(bool pressed) const { break; default: break; - } - - XClearWindow(m_display, m_tabwin); + } m_win->getScreen()->getWindowStyle()->tab.font.drawText( m_tabwin, -- cgit v0.11.2