Fix "gtk+ rendering" (GitHub Issue #443)

This commit is a minimal fix for issue #443.

A more complete fix is in Git 'master', i.e. in FLTK 1.4.0.
This commit is contained in:
Albrecht Schlosser
2023-12-02 19:52:29 +01:00
parent 1b5db5519d
commit 84c9432d2a
2 changed files with 5 additions and 3 deletions
+2
View File
@@ -14,6 +14,8 @@ Details:
Fix compiler warning as pointed out in PR #693 Fix compiler warning as pointed out in PR #693
Fix another compiler warning (#693) Fix another compiler warning (#693)
Remove unused variable, fix "type issue" (#445, part 2) Remove unused variable, fix "type issue" (#445, part 2)
Fix stack buffer overflow found by address sanitizer
Fix "gtk+ rendering" (GitHub Issue #443)
ManoloFLTK: ManoloFLTK:
macOS platform: fix for issue #325 Disabling IM disables Greek and Cyrillic layouts macOS platform: fix for issue #325 Disabling IM disables Greek and Cyrillic layouts
+3 -3
View File
@@ -3,7 +3,7 @@
// //
// Lighted button widget for the Fast Light Tool Kit (FLTK). // Lighted button widget for the Fast Light Tool Kit (FLTK).
// //
// Copyright 1998-2015 by Bill Spitzak and others. // Copyright 1998-2023 by Bill Spitzak and others.
// //
// This library is free software. Distribution and use rights are outlined in // This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this // the file "COPYING" which should have been included with this file. If this
@@ -51,7 +51,7 @@ void Fl_Light_Button::draw() {
draw_box(down_box(), x()+dx, y()+dy, W, W, FL_BACKGROUND2_COLOR); draw_box(down_box(), x()+dx, y()+dy, W, W, FL_BACKGROUND2_COLOR);
if (value()) { if (value()) {
if (Fl::is_scheme("gtk+")) { if (Fl::is_scheme("gtk+")) {
fl_color(FL_SELECTION_COLOR); fl_color(fl_contrast(FL_SELECTION_COLOR, FL_BACKGROUND2_COLOR));
} else { } else {
fl_color(col); fl_color(col);
} }
@@ -77,7 +77,7 @@ void Fl_Light_Button::draw() {
int tdy = dy + (W - tW) / 2; int tdy = dy + (W - tW) / 2;
if (Fl::is_scheme("gtk+")) { if (Fl::is_scheme("gtk+")) {
fl_color(FL_SELECTION_COLOR); fl_color(fl_contrast(FL_SELECTION_COLOR, FL_BACKGROUND2_COLOR));
tW --; tW --;
fl_pie(x() + tdx - 1, y() + tdy - 1, tW + 3, tW + 3, 0.0, 360.0); fl_pie(x() + tdx - 1, y() + tdy - 1, tW + 3, tW + 3, 0.0, 360.0);
fl_color(fl_color_average(FL_WHITE, FL_SELECTION_COLOR, 0.2f)); fl_color(fl_color_average(FL_WHITE, FL_SELECTION_COLOR, 0.2f));