frang75 / nappgui_src

SDK for building cross-platform desktop apps in ANSI-C
https://www.nappgui.com
MIT License
442 stars 43 forks source link

Selected item colour in listboxes and popups incorrect on Mac #115

Closed SamSandq closed 1 month ago

SamSandq commented 1 month ago

The selected item's colour is not according to Apple standard.

In osglobals.m: i_theme_colors, line 109, you have

oscolor_NSColor_rgba_v([NSColor selectedControlColor], i_SELBG_COLOR);

which shows up, in a listbox, like this:

Screenshot 2024-03-18 at 14 48 11

Instead, the line should read:

oscolor_NSColor_rgba_v([NSColor selectedContentBackgroundColor], i_SELBG_COLOR);

which shows the Mac standard colour:

Screenshot 2024-03-18 at 14 47 14

This makes the highlighted / selected lines in popups and listboxes follow all other applications on the Mac. It also applies to tableviews, where it may not be wanted. I suggest making these user-configurable to cater for all needs.

SamSandq commented 1 month ago

I made a slight mistake above: popups are standard mac controls, and use the correct colour, like combo boxes too. The listbox and tables are NAppGUI implementations, and sometimes do not follow standard usage (at least on the Mac)

frang75 commented 1 month ago

You're right. From macOS Mojave, Apple provide a more convenient selection color . Fixed here https://github.com/frang75/nappgui_src/commit/7485964f68e5647c5a31e267ce3a8d2b059ca031