Hi
Thanks to your rather complete test report, I'm beginning the understand the
problem.
One that I've figured out is that g_object_set is used a lot to tweak colors
and this call requires a string returned by gdk_rgba_to_string().
This requires to convert 'rgb(x,y.z)' strings to GdkRGBA and then to convert
in an hexa string.
E.g, in header-pane.cc render_score(), this gives good results:
GdkRGBA fg_rgba ;
GdkRGBA bg_rgba ;
g_assert(gdk_rgba_parse(&fg_rgba, fg.c_str()));
g_assert(gdk_rgba_parse(&bg_rgba, bg.c_str()));
g_object_set (renderer, "text", buf,
"foreground", gdk_rgba_to_string(&fg_rgba),
"background", gdk_rgba_to_string(&bg_rgba),
nullptr);
g_object_set also accepts foreground-rgba parameters, but I could not make it
work.
I think there are other problems to convert the output of color picker widget
to GdkRGBa values. I'll check this out.
All the best
On Saturday, 20 July 2024 14:07:00 CEST Duncan wrote:
> Duncan posted on Wed, 17 Jul 2024 23:20:48 - (UTC) as excerpted:
> > 4) Body pane color display settings all remain at default, not applying
> > the custom color settings.
>
> So... After staring at the code and trying various dumb "I wonder if..."s
> for hours, I conceded my all too limited coding skills were simply not up
> to anything close to proper fixes. But I can still hack it, and noting
> tango-colors.h that's what I did, so far for body pane only, patching
> tango-colors.h to add colors like JED_BLACK (JED being my initials) and
> body-pane.cc to use those instead of its TANGO_* colors as fallbacks.
>
> That did work, demonstrating what I had suspected, that the body pane
> color-prefs code can't get the color prefs for some reason my skills were
> frustratingly not good enough to figure out and repair, and is thus using
> its fallbacks. I may not be able to repair the problem but I can sure
> hard-code-hack the fallbacks it's using!
>
> The preferences-ui color-prefs code likely has a similar bug, thus always
> showing the fallbacks even when the code using that setting is actually
> reading and using the setting correctly.
>
> At least with the hack I can use pan without my eyes being in pain due to
> the blinding white default body-pane background... with the foreground/
> text colors also hacked to avoid dark-on-dark.
___
Pan-users mailing list
Pan-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/pan-users