mirror of
https://github.com/fltk/fltk.git
synced 2026-06-03 22:17:12 +08:00
Tricking Fl_Text_Display into using bearable colors for CodeView in Fluid.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10672 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
@@ -427,6 +427,16 @@ CodeViewer::CodeViewer(int X, int Y, int W, int H, const char *L)
|
|||||||
cursor_style(CARET_CURSOR);
|
cursor_style(CARET_CURSOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void CodeViewer::draw()
|
||||||
|
{
|
||||||
|
// Tricking Fl_Text_Display into using bearable colors for this specific task
|
||||||
|
Fl_Color c = Fl::get_color(FL_SELECTION_COLOR);
|
||||||
|
Fl::set_color(FL_SELECTION_COLOR, fl_color_average(FL_BACKGROUND_COLOR, FL_FOREGROUND_COLOR, 0.9));
|
||||||
|
CodeEditor::draw();
|
||||||
|
Fl::set_color(FL_SELECTION_COLOR, c);
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// End of "$Id$".
|
// End of "$Id$".
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ class CodeViewer : public CodeEditor {
|
|||||||
protected:
|
protected:
|
||||||
|
|
||||||
int handle(int ev) { return Fl_Text_Display::handle(ev); }
|
int handle(int ev) { return Fl_Text_Display::handle(ev); }
|
||||||
|
void draw();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // !CodeEditor_h
|
#endif // !CodeEditor_h
|
||||||
|
|||||||
Reference in New Issue
Block a user