r0x0r / pywebview

Build GUI for your Python program with JavaScript, HTML, and CSS
https://pywebview.flowrl.com
BSD 3-Clause "New" or "Revised" License
4.65k stars 540 forks source link

Title Bar's font-color and background-color #730

Closed chrisljm closed 3 years ago

chrisljm commented 3 years ago

Now I can set title and icon on the title bar, but i also want to change 'font-color' and 'background-color', could I do that?

r0x0r commented 3 years ago

No can do. Generally it is a bad practice to style window title bar.

chrisljm commented 3 years ago

Ok, I get it, thanks

timonwimmer-git commented 3 years ago

So how come there are lots of UWP apps with a colored title bar (even some made by Microsoft)?

r0x0r commented 3 years ago

My bad, seems like I have fallen behind Windows's best practices. Indeed, UWP has got this ability, while pywebview is based on Windows Forms. I reckon the best way to approach this would be just to expose WinForm's GUI objects via a window object. This way it would give user flexibility of accessing native gui API for cases like this. Maybe something like this.

w = webview.create_window(...)
w.native.application # this would point to System.Windows.Forms.Application
w.native.window # this would point to System.Windows.Forms.Form
github-actions[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] commented 3 years ago

The message to post on the issue when closing it. If none provided, will not comment when closing an issue.