Skip to content

Wrong background color transparency on Windows #2425

Description

@ikus060

Describe the bug

On all platform the background color seams to get propagated to children. On all platform it seams to be alright except on Windows where children doesn't seams to inherit background. Reading about #767 , it might be an issue with background transparency ?

Steps to reproduce

"""
Opensource software to backup all your data.
"""
import toga
from toga.style import Pack
from toga.style.pack import COLUMN, ROW
import toga.platform

class MinarcaAgent(toga.App):
    
    def startup(self):
        white = toga.colors.WHITE
        dark = toga.colors.color('#0E2933')
        btn = toga.colors.color('#009FB9')

        main_box = toga.Box(style=Pack(direction=COLUMN), children=[
            toga.Box(style=Pack(direction=COLUMN, background_color=dark), children=[
                 toga.Label(text='MINARCA', style=Pack(text_align='left', color=white, padding=20)),
            ]),
            toga.Box(style=Pack(direction=COLUMN, padding=30, background_color=white), children=[
                toga.Label(id='lbl', text='Coucou', style=Pack(text_align='left', padding=20)),
                toga.Box(style=Pack(direction=ROW), children=[
                    toga.Button(text='I Love Python', on_press=self.click ,style=Pack(color=white, background_color=btn, padding=20)),
                ])
            ])
        ])

        self.main_window = toga.MainWindow(title=self.formal_name)
        # Remove useless toolbar
        self.main_window.content = main_box
        self.main_window.show()
    
    def click(self, event=None):
        lbl = self.main_window.widgets['lbl']
        lbl.text = 'Foo'


def main():
    return MinarcaAgent("Minarca Agent", "org.minarca.agent")


Expected behavior

I'm expecting something similar to Linux. Like this one.
image

Screenshots

Here the result on Windows:
image

Environment

  • Operating System:
  • Python version:
  • Software versions:
    • Briefcase:
    • Toga:
    • ...

Logs


Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA crash or error in behavior.windowsThe issue relates to Microsoft Windows support.
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions