kopia lustrzana https://github.com/jamescoxon/dl-fldigi
Fix logbook selection colour
* Use fl_contrast to adjust the foreground colour of the selected row * Make cosmetic change to logbook window titlepull/2/head
rodzic
8e1ef5a7ff
commit
e767b68a8c
|
@ -32,7 +32,9 @@ void start_logbook ()
|
|||
logbook_filename = progdefaults.logbookfilename;
|
||||
|
||||
adifFile.readFile (logbook_filename.c_str(), &qsodb);
|
||||
dlgLogbook->copy_label(fl_filename_name(logbook_filename.c_str()));
|
||||
string label = "Logbook - ";
|
||||
label.append(fl_filename_name(logbook_filename.c_str()));
|
||||
dlgLogbook->copy_label(label.c_str());
|
||||
loadBrowser();
|
||||
qsodb.isdirty(0);
|
||||
|
||||
|
|
|
@ -109,28 +109,34 @@ void Table::drawRow(int row, char *rowData[], int x, int y) {
|
|||
// Draw background box.
|
||||
if (row != selected) {
|
||||
Fl_Color bg;
|
||||
if (!withGrid && row % 2 == 0) { // different bg for consecutive rows
|
||||
if (!withGrid && row % 2 == 0) // different bg for consecutive rows
|
||||
bg = color();
|
||||
else {
|
||||
bg = fl_color_average(color(), FL_BLACK, .9);
|
||||
if (fl_contrast(bg, FL_BLACK) == FL_WHITE) // widget has very dark text bg
|
||||
bg = fl_color_average(color(), FL_WHITE, .9);
|
||||
}
|
||||
else
|
||||
bg = color();
|
||||
|
||||
fl_rectf(iX, y, tableWidth - hScroll->value(), rowHeight, bg);
|
||||
}
|
||||
else if (Fl::focus() == this) {
|
||||
fl_rectf(iX, y, tableWidth - hScroll->value(), rowHeight, selection_color());
|
||||
|
||||
fl_color(FL_FOREGROUND_COLOR);
|
||||
|
||||
// Draw focus
|
||||
fl_line_style(FL_DOT);
|
||||
fl_rect(iX, y, tableWidth - hScroll->value(), rowHeight);
|
||||
fl_line_style(FL_SOLID);
|
||||
}
|
||||
else
|
||||
fl_rectf(iX, y, tableWidth - hScroll->value(), rowHeight, selection_color());
|
||||
else {
|
||||
if (Fl::focus() == this) {
|
||||
fl_rectf(iX, y, tableWidth - hScroll->value(), rowHeight, selection_color());
|
||||
fl_color(FL_FOREGROUND_COLOR);
|
||||
|
||||
// Draw focus
|
||||
fl_line_style(FL_DOT);
|
||||
fl_rect(iX, y, tableWidth - hScroll->value(), rowHeight);
|
||||
fl_line_style(FL_SOLID);
|
||||
}
|
||||
else
|
||||
fl_rectf(iX, y, tableWidth - hScroll->value(), rowHeight, selection_color());
|
||||
|
||||
fl_color(fl_contrast(FL_FOREGROUND_COLOR, selection_color()));
|
||||
}
|
||||
|
||||
fl_color(FL_FOREGROUND_COLOR);
|
||||
|
||||
// Get color from highlighter.
|
||||
Fl_Color color;
|
||||
|
|
Ładowanie…
Reference in New Issue