Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong background color transparency on Windows #2425

Open
ikus060 opened this issue Feb 25, 2024 · 0 comments · May be fixed by #2484
Open

Wrong background color transparency on Windows #2425

ikus060 opened this issue Feb 25, 2024 · 0 comments · May be fixed by #2484
Labels
bug A crash or error in behavior. windows The issue relates to Microsoft Windows support.

Comments

@ikus060
Copy link

ikus060 commented Feb 25, 2024

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

@ikus060 ikus060 added the bug A crash or error in behavior. label Feb 25, 2024
@freakboy3742 freakboy3742 added the windows The issue relates to Microsoft Windows support. label Feb 25, 2024
@freakboy3742 freakboy3742 linked a pull request Apr 7, 2024 that will close this issue
4 tasks
@mhsmith mhsmith changed the title Wrong background color on Windows Wrong background color inheritance on Windows Nov 9, 2024
@mhsmith mhsmith changed the title Wrong background color inheritance on Windows Wrong background color transparency on Windows Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A crash or error in behavior. windows The issue relates to Microsoft Windows support.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants