Skip to content

Commit dbc199f

Browse files
committed
FLTK: fix displaying edit selection color
1 parent e6de93b commit dbc199f

File tree

5 files changed

+10
-4
lines changed

5 files changed

+10
-4
lines changed

src/platform/fltk/BasicEditor.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ Fl_Text_Display::Style_Table_Entry styletable[] = {
3939
{ defaultColor[7], FL_COURIER_ITALIC, 12}, // H - Italic Comments
4040
{ defaultColor[8], FL_COURIER, 12}, // I - Numbers
4141
{ defaultColor[9], FL_COURIER, 12}, // J - Operators
42-
{ FL_WHITE, FL_COURIER, 12}, // K - Background
42+
{ FL_BLUE, FL_COURIER, 12}, // K - Selection Background
43+
{ FL_WHITE, FL_COURIER, 12}, // L - Background
4344
};
4445

4546
#define PLAIN 'A'

src/platform/fltk/EditorWidget.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,7 @@ void EditorWidget::setTheme(EditTheme *theme) {
10141014
_editor->linenumber_bgcolor(get_color(theme->_background));
10151015
_editor->linenumber_fgcolor(get_color(theme->_number_color));
10161016
_editor->cursor_color(get_color(theme->_cursor_color));
1017-
_editor->selection_color(get_color(theme->_selection_color));
1017+
_editor->selection_color(get_color(theme->_selection_background));
10181018
_funcList->color(fl_color_average(get_color(theme->_background), get_color(theme->_color), .92f));
10191019
_funcList->item_labelfgcolor(get_color(theme->_color));
10201020
_tty->color(_editor->color());

src/platform/fltk/EditorWidget.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ enum StyleField {
5555
st_icomments,
5656
st_numbers,
5757
st_operators,
58+
st_selection,
5859
st_background
5960
};
6061

src/platform/fltk/Profile.cxx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ void Profile::loadEditTheme(int themeId) {
7272
styletable[7].color = get_color(_theme._syntax_comments); // H - comments
7373
styletable[8].color = get_color(_theme._syntax_digit); // I - numbers
7474
styletable[9].color = get_color(_theme._syntax_command); // J - operators
75-
styletable[10].color = get_color(_theme._background); // Background
75+
styletable[10].color = get_color(_theme._selection_background); // K Selection Background
76+
styletable[11].color = get_color(_theme._background); // L Background
7677
}
7778

7879
//
@@ -182,7 +183,8 @@ void Profile::updateTheme() {
182183
_theme._syntax_comments = styletable[7].color >> 8;
183184
_theme._syntax_digit = styletable[8].color >> 8;
184185
_theme._syntax_command = styletable[9].color >> 8;
185-
_theme._background = styletable[10].color >> 8;
186+
_theme._selection_background = styletable[10].color >> 8;
187+
_theme._background = styletable[11].color >> 8;
186188
}
187189

188190
//

src/ui/system.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -987,10 +987,12 @@ void System::showMenu() {
987987
items->add(new String(MENU_STR_SOURCE));
988988
_systemMenu[index++] = MENU_CONSOLE;
989989
_systemMenu[index++] = MENU_SOURCE;
990+
#if !defined(_FLTK)
990991
if (!isEditing()) {
991992
items->add(new String(MENU_STR_RESTART));
992993
_systemMenu[index++] = MENU_RESTART;
993994
}
995+
#endif
994996
#if !defined(_SDL) && !defined(_FLTK)
995997
items->add(new String(MENU_STR_KEYPAD));
996998
_systemMenu[index++] = MENU_KEYPAD;

0 commit comments

Comments
 (0)