Closed lukas-jung closed 2 years ago
The background color for PopupWindow
should indeed be the same by default as for Window
.
The compiler transforms a PopupWindow
to a Window
element in the lower_popups
pass in the compiler. And a Window
gets a default binding for the background color from the native style assigned in the apply_default_properties_from_style
pass. However that pass is applied /before/ the lowering, so that pass sees a PopupWindow
element, not a Window
.
I think apply_default_properties_from_style
should be taught about PopupWindow
. However that means adding a background
property to PopupWindow
in builtins.slint
.
I /think/ that could work, and it would allow us to remove the current workaround we have in place wherever we use PopupWindow
right now in the examples/demos where we have a Rectangle
at the bottom that draws a background.
Also: the popup somehow renders over everything. even over system application like the spotlight search.
This relates to #38 . Right now with Qt a popup is known to the windowing system, so it should render above everything. But with the GL backend the popup is rendered like a "widget" inside the window. It would be great to fix this. One issue is that winit
currently doesn't just support this, but I think with the existing extension traits for macOS, Windows, etc. it might be possible to hack this on the usual windowing systems.
Closing in favor of #1143
On macos a PopupWindow without a background rectangle is rendered like this:
I'm not sure whether is should be translucent, but if it should we at least need the native background color as a
color
.Also: the popup somehow renders over everything. even over system application like the spotlight search.
here's the code (the bla buttons show the popup):