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_Input_.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_Input_.cxx')
| -rw-r--r-- | src/Fl_Input_.cxx | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/Fl_Input_.cxx b/src/Fl_Input_.cxx index da3d8e3ba..bf96bd4c9 100644 --- a/src/Fl_Input_.cxx +++ b/src/Fl_Input_.cxx @@ -339,10 +339,25 @@ void Fl_Input_::drawtext(int X, int Y, int W, int H) { int offset2; if (pp <= e) x2 = xpos + (float)expandpos(p, pp, buf, &offset2); else offset2 = (int) strlen(buf); +#ifdef __APPLE__ // Mac OS: underline marked ( = selected + Fl::compose_state != 0) text + if (Fl::compose_state) { + fl_color(textcolor()); + } + else +#endif + { fl_color(selection_color()); fl_rectf((int)(x1+0.5), Y+ypos, (int)(x2-x1+0.5), height); fl_color(fl_contrast(textcolor(), selection_color())); + } fl_draw(buf+offset1, offset2-offset1, x1, (float)(Y+ypos+desc)); +#ifdef __APPLE__ // Mac OS: underline marked ( = selected + Fl::compose_state != 0) text + if (Fl::compose_state) { + fl_color( fl_color_average(textcolor(), color(), 0.6) ); + float width = fl_width(buf+offset1, offset2-offset1); + fl_line(x1, Y+ypos+height-1, x1+width, Y+ypos+height-1); + } +#endif if (pp < e) { fl_color(tc); fl_draw(buf+offset2, (int) strlen(buf+offset2), x2, (float)(Y+ypos+desc)); @@ -357,7 +372,7 @@ void Fl_Input_::drawtext(int X, int Y, int W, int H) { CONTINUE2: // draw the cursor: - if (Fl::focus() == this && selstart == selend && + if (Fl::focus() == this && (Fl::compose_state || selstart == selend) && position() >= p-value() && position() <= e-value()) { fl_color(cursor_color()); // cursor position may need to be recomputed (see STR #2486) |
