summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-04-01 14:58:07 +0000
committerManolo Gouy <Manolo>2016-04-01 14:58:07 +0000
commita53297ebab1828aaa93a54a7b627586fbe3bbd10 (patch)
tree3ec321705438b2d648b09e5de1a81a1446c00ff6 /src
parent20b00f29ce8097565e329638e19a25ab16a86e16 (diff)
Begin to remove platform-specific code from Fl_Text_Display.cxx
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11498 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl_Text_Display.cxx17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/Fl_Text_Display.cxx b/src/Fl_Text_Display.cxx
index 7417bb5b5..d3967b70d 100644
--- a/src/Fl_Text_Display.cxx
+++ b/src/Fl_Text_Display.cxx
@@ -2170,11 +2170,10 @@ void Fl_Text_Display::draw_string(int style,
if (style & PRIMARY_MASK) {
if (Fl::focus() == (Fl_Widget*)this) {
-#ifdef __APPLE__ // PORTME: Fl_Screen_Driver - platform compose
- if (Fl::compose_state) background = color();// Mac OS: underline marked text
+ if (Fl::screen_driver()->has_marked_text() && Fl::compose_state)
+ background = color();// Mac OS: underline marked text
else
-#endif
- background = selection_color();
+ background = selection_color();
}
else background = fl_color_average(color(), selection_color(), 0.4f);
} else if (style & HIGHLIGHT_MASK) {
@@ -2212,12 +2211,10 @@ 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 // PORTME: platform editor feel
- if (Fl::compose_state && (style & PRIMARY_MASK)) {
+ if (Fl::screen_driver()->has_marked_text() && 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 // PORTME: platform editor feel
fl_pop_clip();
#endif
@@ -3734,10 +3731,8 @@ void Fl_Text_Display::draw(void) {
int has_selection = buffer()->selection_position(&start, &end);
if (damage() & (FL_DAMAGE_ALL | FL_DAMAGE_SCROLL | FL_DAMAGE_EXPOSE)
&& (
-#ifdef __APPLE__ // PORTME: Fl_Screen_Driver - platform compose
- Fl::compose_state ||
-#endif
- !has_selection || mCursorPos < start || mCursorPos > end) &&
+ (Fl::screen_driver()->has_marked_text() && Fl::compose_state) ||
+ (!has_selection) || mCursorPos < start || mCursorPos > end) &&
mCursorOn && Fl::focus() == (Fl_Widget*)this ) {
fl_push_clip(text_area.x-LEFT_MARGIN,
text_area.y,