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

Bruce Steers bsteers4 at gmail.com
Tue Jan 23 14:23:52 CET 2024


On Tue, 23 Jan 2024 at 02:52, T Lee Davidson <t.lee.davidson at gmail.com>
wrote:

> On 1/22/24 15:47, Bruce Steers wrote:
> > I have a couple of issues in a GUi build...
> >
> > Issue1
> > I can set Form Background / Foreground colors but then I get the
> following behavior with gtk3...
> > the Menubar background color changes to correct color only on the top
> level window but not other opened windows.
> > While the Foreground color changes on all windows.
> > Leaving a risk of having same color bg and fg on opened windows.
> >
> > QT it all works as expected.
> >
> > --------
> >
> > The other issue is with various gui text rendering.
> > If i set Form.Foreground = Color.White
> > Then things like Labels,MenuButton and others change to white text.
> things like Buttons/TogleButtons do not.
> > I have to add this code to make things render the correct text color...
> >
> >    For Each c As Control In Me.Controls
> >      c.Foreground = Me.Foreground
> >    Next
> >
> > But that's only a workaround and only viable if i have no explicit text
> colors set.
>
> I find your description of the issue confusing.
>
> When you refer to "other opened windows", do you mean other forms (which,
> of course, open in a new window)?
>
> And, I'm not sure how you expect it to work. Because, with Qt:
> 1. I create Form1 which a button event handler in FMain calls with
> Form1.Show
> 2. FMain has foreground and background colors set to other than default
> 3. Form1 has default foreground/background colors.
>
> Fmain shows its colors as it should including the button text. Form1 shows
> its default colors.
>
> That is what I would expect.
>
> Am I missing something?


er, gtk3 ;)
Like I said these are gtk issues.  qt seems to work correctly.

I cannot seem to replicate the MenuBar background not changing color but
take a look at the attached picture.
The image shows a test app with various different controls on it. and i've
set Form.Background to Grey and Foreground to White

In the testers you can see that qt5 is setting ALL child controls
Foreground to white but gtk3 does not.
gtk has set the combobox/labels/checkbox/radio text to white but none of
the buttons.  Making it a pain in the ass to configure correctly.

Also the tester shows on both toolkits that the MenuBar.Background has set
correctly but that's not the case on the program i am working on where some
of the windows refuse to set the menubar background but they do set the
Foreground okay so if i set a dark background and a light foreground i
cannot see the text.

PS. this is relevant to setting the form colors by code and not using the
IDE designer as i found setting the color in the designer usually worked
correctly.

Respects
BruceS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20240123/709febcc/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Untitled.jpg
Type: image/jpeg
Size: 46698 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20240123/709febcc/attachment-0001.jpg>


More information about the User mailing list