[Gambas-user] Menubar background only changes to Form.Background on top level window (gtk3)

Bruce Steers bsteers4 at gmail.com
Wed Jan 24 00:15:23 CET 2024


On Tue, 23 Jan 2024, 18:52 Bruce Steers, <bsteers4 at gmail.com> wrote:

>
>
> <snip>
>
> > Are you creating the forms with the IDE and then changing the colors
>> programmatically? Or are you also creating the forms
>> > programmatically.
>>
>> Okay, I just tried with GTK3; setting the color properties
>> programmatically.
>>
>> The menu-bar background is correctly set according to the form's
>> background for the top-level and child windows. But, as you
>> stated, the buttons do not respect the form's Foreground property.
>>
>
> Snip

>
>
> I have no idea why it does not work on this application but does if i make
> a simple tester that does the same.
>
> and sorry for any confusion about the top level/not top level situation, i
> did say in the second post that i discovered that was not the reason.  for
> some reason now the window that it did work on now does not (i changed the
> code a bit)
>
> My workaround for the problem was to make a top level panel for each form
> and set the colors of that and not the main form so the menubar remained
> the desktop default colors.
>
> But this menubar problem and gtk not setting all control text colors the
> same as qt does does seem like a bug in gb.gtk3 component somewhere.
>
> Respects
> BruceS
>


Personally I think the behaviour for both toolkits should be this...

If the control uses it's own background colour like button, combobox,
menubutton, etc all use Colour.ButtonBackground then the parent Foreground
color should not be applied.

If the control has no background explicitly set or no background by default
so obeys the parent color like Label, tool button, borderless button, etc
then it should.

And menubar (and it's popup menus) either should or should not respect
window colours the same on both toolkits.

Respects
BruceS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20240123/254c1c28/attachment.htm>


More information about the User mailing list