diff options
| author | Manolo Gouy <Manolo> | 2012-12-19 08:50:34 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2012-12-19 08:50:34 +0000 |
| commit | 7ab1a8b2045a03b401043ab32aed0e3646662821 (patch) | |
| tree | f55f3e82ee47bd84fa39fc18fb93b050568fcc26 /src/Fl_Text_Display.cxx | |
| parent | 81c98f228bd22c1b305ddca16c4e0c71a2b255b5 (diff) | |
Mac OS text input: marked text is now underlined.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9767 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Text_Display.cxx')
| -rw-r--r-- | src/Fl_Text_Display.cxx | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/Fl_Text_Display.cxx b/src/Fl_Text_Display.cxx index 03be48e60..fb0eee61c 100644 --- a/src/Fl_Text_Display.cxx +++ b/src/Fl_Text_Display.cxx @@ -1940,7 +1940,13 @@ void Fl_Text_Display::draw_string(int style, fsize = styleRec->size; if (style & PRIMARY_MASK) { - if (Fl::focus() == (Fl_Widget*)this) background = selection_color(); + if (Fl::focus() == (Fl_Widget*)this) { +#ifdef __APPLE__ + if (Fl::compose_state) background = color();// Mac OS: underline marked text + else +#endif + background = selection_color(); + } else background = fl_color_average(color(), selection_color(), 0.4f); } else if (style & HIGHLIGHT_MASK) { if (Fl::focus() == (Fl_Widget*)this) background = fl_color_average(color(), selection_color(), 0.5f); @@ -1972,6 +1978,12 @@ void Fl_Text_Display::draw_string(int style, fl_push_clip(X, Y, toX - X, mMaxsize); #endif fl_draw( string, nChars, X, Y + mMaxsize - fl_descent()); +#ifdef __APPLE__ // Mac OS: underline marked (= selected + Fl::compose_state != 0) text + if (Fl::compose_state && (style & PRIMARY_MASK)) { + fl_color( fl_color_average(foreground, background, 0.6) ); + fl_line(X, Y + mMaxsize - 1, X + fl_width(string, nChars), Y + mMaxsize - 1); + } +#endif #if !(defined(__APPLE__) || defined(WIN32)) && USE_XFT fl_pop_clip(); #endif @@ -3457,7 +3469,7 @@ void Fl_Text_Display::draw(void) { // draw the text cursor if (damage() & (FL_DAMAGE_ALL | FL_DAMAGE_SCROLL | FL_DAMAGE_EXPOSE) - && !buffer()->primary_selection()->selected() && + && (Fl::compose_state || !buffer()->primary_selection()->selected()) && mCursorOn && Fl::focus() == (Fl_Widget*)this ) { fl_push_clip(text_area.x-LEFT_MARGIN, text_area.y, |
