File tree Expand file tree Collapse file tree 2 files changed +14
-21
lines changed Expand file tree Collapse file tree 2 files changed +14
-21
lines changed Original file line number Diff line number Diff line change @@ -287,16 +287,23 @@ QuickshellScreenInfo* ProxyWindowBase::screen() const {
287287 return QuickshellTracked::instance ()->screenInfo (qscreen);
288288}
289289
290- QColor ProxyWindowBase::color () const {
291- if (this ->window == nullptr ) return this ->mColor ;
292- else return this ->window ->color ();
293- }
290+ QColor ProxyWindowBase::color () const { return this ->mColor ; }
294291
295292void ProxyWindowBase::setColor (QColor color) {
293+ this ->mColor = color;
294+
296295 if (this ->window == nullptr ) {
297- this ->mColor = color;
298- emit this ->colorChanged ();
299- } else this ->window ->setColor (color);
296+ if (color != this ->mColor ) emit this ->colorChanged ();
297+ } else {
298+ auto premultiplied = QColor::fromRgbF (
299+ color.redF () * color.alphaF (),
300+ color.greenF () * color.alphaF (),
301+ color.blueF () * color.alphaF (),
302+ color.alphaF ()
303+ );
304+
305+ this ->window ->setColor (premultiplied);
306+ }
300307}
301308
302309PendingRegion* ProxyWindowBase::mask () const { return this ->mMask ; }
Original file line number Diff line number Diff line change @@ -46,20 +46,6 @@ class WindowInterface: public Reloadable {
4646 // / along with map[To|From]Item (which is not reactive).
4747 Q_PROPERTY (QObject* windowTransform READ windowTransform NOTIFY windowTransformChanged);
4848 // / The background color of the window. Defaults to white.
49- // /
50- // / > [!WARNING] This seems to behave weirdly when using transparent colors on some systems.
51- // / > Using a colored content item over a transparent window is the recommended way to work around this:
52- // / > ```qml
53- // / > ProxyWindow {
54- // / > color: "transparent"
55- // / > Rectangle {
56- // / > anchors.fill: parent
57- // / > color: "#20ffffff"
58- // / >
59- // / > // your content here
60- // / > }
61- // / > }
62- // / > ```
6349 Q_PROPERTY (QColor color READ color WRITE setColor NOTIFY colorChanged);
6450 // / The clickthrough mask. Defaults to null.
6551 // /
You can’t perform that action at this time.
0 commit comments