bubbleUI 0.4.4a1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- bubble/QUI.py +4 -0
- bubble/__init__.py +8 -0
- bubble/cards.py +1503 -0
- bubble/dev_navview.py +4334 -0
- bubble/dev_titlebar.py +2900 -0
- bubble/glasskit/__init__.py +94 -0
- bubble/glasskit/config.py +77 -0
- bubble/glasskit/energy.py +202 -0
- bubble/glasskit/glass.py +1034 -0
- bubble/glasskit/gpu.py +43 -0
- bubble/glasskit/imaging.py +823 -0
- bubble/glasskit/settings.py +82 -0
- bubble/i18n.py +27 -0
- bubble/icon.py +261 -0
- bubble/levels/__init__.py +32 -0
- bubble/levels/component.py +106 -0
- bubble/levels/manager.py +334 -0
- bubble/styles.py +282 -0
- bubble/uiWindow.py +262 -0
- bubble/widgets.py +962 -0
- bubbleui-0.4.4a1.dist-info/METADATA +18 -0
- bubbleui-0.4.4a1.dist-info/RECORD +25 -0
- bubbleui-0.4.4a1.dist-info/WHEEL +5 -0
- bubbleui-0.4.4a1.dist-info/licenses/LICENSE +21 -0
- bubbleui-0.4.4a1.dist-info/top_level.txt +1 -0
bubble/glasskit/gpu.py
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"""Optional GPU-backed painting surface for glass windows.
|
|
2
|
+
|
|
3
|
+
QWidget normally paints through Qt's raster engine on the CPU. ``GpuSurface``
|
|
4
|
+
is a full-window ``QOpenGLWidget`` child that routes a QPainter scene through
|
|
5
|
+
Qt's OpenGL paint engine. It is intentionally only a drawing surface: the
|
|
6
|
+
blur itself is still computed by the imaging helpers.
|
|
7
|
+
|
|
8
|
+
The surface is kept behind normal child widgets, so labels, buttons and panels
|
|
9
|
+
remain crisp and keep their normal QWidget behaviour.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
from __future__ import annotations
|
|
13
|
+
|
|
14
|
+
from typing import Callable
|
|
15
|
+
|
|
16
|
+
from PySide6.QtCore import Qt
|
|
17
|
+
from PySide6.QtGui import QPainter
|
|
18
|
+
from PySide6.QtOpenGLWidgets import QOpenGLWidget
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class GpuSurface(QOpenGLWidget):
|
|
22
|
+
"""A full-window GL surface that delegates painting to a callback."""
|
|
23
|
+
|
|
24
|
+
def __init__(self, parent, render: Callable[[QPainter], None],
|
|
25
|
+
*, transparent_for_mouse: bool = True):
|
|
26
|
+
super().__init__(parent)
|
|
27
|
+
self._render = render
|
|
28
|
+
if transparent_for_mouse:
|
|
29
|
+
self.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
|
|
30
|
+
self.setAttribute(Qt.WidgetAttribute.WA_NoSystemBackground, True)
|
|
31
|
+
self.setAutoFillBackground(False)
|
|
32
|
+
self.setUpdateBehavior(QOpenGLWidget.UpdateBehavior.NoPartialUpdate)
|
|
33
|
+
|
|
34
|
+
def paintGL(self) -> None: # noqa: N802
|
|
35
|
+
painter = QPainter(self)
|
|
36
|
+
painter.setRenderHint(QPainter.RenderHint.Antialiasing)
|
|
37
|
+
painter.setRenderHint(QPainter.RenderHint.SmoothPixmapTransform)
|
|
38
|
+
self._render(painter)
|
|
39
|
+
painter.end()
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
# Backwards-friendly name for code that used the demo-local class.
|
|
43
|
+
GpuBackdrop = GpuSurface
|