diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_Tooltip.cxx | 6 | ||||
| -rw-r--r-- | src/fl_draw.cxx | 42 |
2 files changed, 24 insertions, 24 deletions
diff --git a/src/Fl_Tooltip.cxx b/src/Fl_Tooltip.cxx index 2834b3cec..acba0be7d 100644 --- a/src/Fl_Tooltip.cxx +++ b/src/Fl_Tooltip.cxx @@ -194,7 +194,7 @@ Fl_Tooltip::exit_(Fl_Widget *w) { widget_ = 0; Fl::remove_timeout(tooltip_timeout); Fl::remove_timeout(recent_timeout); - if (window) window->hide(); + if (window && window->visible()) window->hide(); if (recent_tooltip) { if (Fl::event_state() & FL_BUTTONS) recent_tooltip = 0; else Fl::add_timeout(Fl_Tooltip::hoverdelay(), recent_timeout); @@ -233,11 +233,11 @@ Fl_Tooltip::enter_area(Fl_Widget* wid, int x,int y,int w,int h, const char* t) #ifdef WIN32 // possible fix for the Windows titlebar, it seems to want the // window to be destroyed, moving it messes up the parenting: - if (window) window->hide(); + if (window && window->visible()) window->hide(); #endif // WIN32 tooltip_timeout(0); } else { - if (window) window->hide(); + if (window && window->visible()) window->hide(); Fl::add_timeout(Fl_Tooltip::delay(), tooltip_timeout); } diff --git a/src/fl_draw.cxx b/src/fl_draw.cxx index d1fe15839..64aabb690 100644 --- a/src/fl_draw.cxx +++ b/src/fl_draw.cxx @@ -158,15 +158,13 @@ void fl_draw( symtotal = symwidth[0] + symwidth[1]; - if (str) { - for (p = str, lines=0; p;) { - e = expand(p, buf, w - symtotal, buflen, width, align&FL_ALIGN_WRAP, - draw_symbols); - lines++; - if (!*e || (*e == '@' && e[1] != '@' && draw_symbols)) break; - p = e; - } - } else lines = 0; + for (p = str, lines=0; p;) { + e = expand(p, buf, w - symtotal, buflen, width, align&FL_ALIGN_WRAP, + draw_symbols); + lines++; + if (!*e || (*e == '@' && e[1] != '@' && draw_symbols)) break; + p = e; + } if ((symwidth[0] || symwidth[1]) && lines) { if (symwidth[0]) symwidth[0] = lines * fl_height(); @@ -295,19 +293,21 @@ void fl_measure(const char* str, int& w, int& h, int draw_symbols) { symbol[1][0] = '\0'; symwidth[1] = 0; - if (str && str[0] == '@' && str[1] && str[1] != '@') { - // Start with a symbol... - for (symptr = symbol[0]; - *str && !isspace(*str) && symptr < (symbol[0] + sizeof(symbol[0]) - 1); - *symptr++ = *str++); - *symptr = '\0'; - if (isspace(*str)) str++; - symwidth[0] = h; - } + if (draw_symbols) { + if (str && str[0] == '@' && str[1] && str[1] != '@') { + // Start with a symbol... + for (symptr = symbol[0]; + *str && !isspace(*str) && symptr < (symbol[0] + sizeof(symbol[0]) - 1); + *symptr++ = *str++); + *symptr = '\0'; + if (isspace(*str)) str++; + symwidth[0] = min(w,h); + } - if (str && (p = strrchr(str, '@')) != NULL && p > (str + 1) && p[-1]!='@') { - strlcpy(symbol[1], p, sizeof(symbol[1])); - symwidth[1] = h; + if (str && (p = strrchr(str, '@')) != NULL && p > (str + 1) && p[-1]!='@') { + strlcpy(symbol[1], p, sizeof(symbol[1])); + symwidth[1] = min(w,h); + } } symtotal = symwidth[0] + symwidth[1]; |
