check string size before draw
fluxgen fluxgen
1 files changed,
6 insertions(+),
4 deletions(-)
jump to
M
src/Tab.cc
→
src/Tab.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: 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 @@ // mode else it draws it in normal mode
// 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 @@ dx += (m_size_w - l) / 2;
break; default: break; - } - - XClearWindow(m_display, m_tabwin); + } m_win->getScreen()->getWindowStyle()->tab.font.drawText( m_tabwin,