-
Notifications
You must be signed in to change notification settings - Fork 257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Selected Fl_Menu_Item's are not drawn with selection color background under Windows #969
Comments
Yes, it's intentional that different platforms can have different palettes. It's not necessarily intentional that fl_contrast "flips" a color scheme so badly, that the result is less pleasing/readable. The original idea was to adjust the palettes to the color scheme of the desktop in use. The user can override this with command line options during So all in all, yes, this is intentional and well meant. It may have more of an influence on colors than was originally intended. We have plans to fix all this in 1.5 . |
OK. I would think we should find a way to remove such a big difference in the way selected menu items are drawn on Windows (black text on white background) relatively to other platforms (white text on blue background). |
I'm investigating this in the context of the mentioned thread in fltk.general. As a first thought: if the background color of the selected menu item is "flipped" then this is not intended. The only thing that should be changed by Side note: a long time ago one of my customers used a "Knoppix" Linux system with KDE desktop (IIRC). The default selection color was a really light blue. In this case |
I am very much in favor of this approach. |
Here is the code in function
Replacing this by just Added later: it might be necessary to add some more code to draw properly menu titles. |
@Albrecht-S I'm left with the impression you're willing to take care of this issue. If that's not correct, please, let it known here. |
I propose re-titling this to something like "Fl_Menu_Item selection color contrast bug" or something similar, and removing the |
@ManoloFLTK I won't be able to work on this for at least the next two or three days, and even longer if I do my remaining CMake and Windows keyboard stuff before that (which I intend to do). I would also appreciate if @MatthiasWM could contribute some knowledge about the menu handling code. Maybe he knows a reason why this "color flipping" of the background/menu item has been done. That said, I'd be grateful if someone else could take care of the code you posted above to avoid "color flipping" of selected menu items in the first place. I also wouldn't mind if this issue was renamed to a more appropriate name, as @dannye suggested above. Please feel free to assign yourself and work on a solution. TIA. |
Also, remove this text from the doc of Fl_Menu_::down_box() "If this is FL_NO_BOX then it acts like FL_THIN_UP_BOX and selection_color() acts like FL_WHITE, for back compatibility." that was true only for the Windows platform and that required selection_color to be replaced by white for menu items which is not what FLTK 1.4 expects. The new state of menu item drawings is as follows : - all platforms draw menu items with the same symbolic colors - selected items and menu titles are drawn with the selection color as background color - menu items are drawn by default with no box but can be given one by Fl_Menu_::down_box(Fl_Boxtype) - the text of selected items is drawn with the menu's color unless fl_contrast() finds it does not make enough contrast with the background (selection color) and substitutes it with a more adapted color - the Windows platform uses a visibly different hue for its default selection color from what other platforms use
Describe the bug
The FLTK colormap differs between the Windows platform and other platforms. One consequence is that FL_SELECTION_COLOR (or 15) is considered by function
fl_contrast()
to contrast with FLTK's default background color FL_GRAY (=49) under non Windows, but not under Windows. A one step further consequence is thread"FLTK 1.4 Menu Bar Style" of fltk.general showing that selected menu items are not drawn with the same
color in Windows and other platforms with FLTK 1.4.
To Reproduce
This image shows FL_SELECTION_COLOR on 3 platforms: X11, macOS, Windows from left to right:
Clearly, the Windows color is less dark and less pure blue.
Expected behavior
Is there a reason for Windows to use markedly different colors in its colormap?
FLTK Version
Please complete the following information and delete non-applicable lines:
The text was updated successfully, but these errors were encountered: