PyWebWinUI3 1.0.0b3__tar.gz → 1.0.0b4__tar.gz
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.
- {pywebwinui3-1.0.0b3 → pywebwinui3-1.0.0b4}/PKG-INFO +1 -1
- {pywebwinui3-1.0.0b3 → pywebwinui3-1.0.0b4}/PyWebWinUI3.egg-info/PKG-INFO +1 -1
- pywebwinui3-1.0.0b4/pywebwinui3/__init__.py +3 -0
- {pywebwinui3-1.0.0b3 → pywebwinui3-1.0.0b4}/pywebwinui3/core.py +15 -7
- pywebwinui3-1.0.0b3/pywebwinui3/__init__.py +0 -3
- {pywebwinui3-1.0.0b3 → pywebwinui3-1.0.0b4}/LICENSE +0 -0
- {pywebwinui3-1.0.0b3 → pywebwinui3-1.0.0b4}/MANIFEST.in +0 -0
- {pywebwinui3-1.0.0b3 → pywebwinui3-1.0.0b4}/PyWebWinUI3.egg-info/SOURCES.txt +0 -0
- {pywebwinui3-1.0.0b3 → pywebwinui3-1.0.0b4}/PyWebWinUI3.egg-info/dependency_links.txt +0 -0
- {pywebwinui3-1.0.0b3 → pywebwinui3-1.0.0b4}/PyWebWinUI3.egg-info/requires.txt +0 -0
- {pywebwinui3-1.0.0b3 → pywebwinui3-1.0.0b4}/PyWebWinUI3.egg-info/top_level.txt +0 -0
- {pywebwinui3-1.0.0b3 → pywebwinui3-1.0.0b4}/README.md +0 -0
- {pywebwinui3-1.0.0b3 → pywebwinui3-1.0.0b4}/pywebwinui3/web/PretendardVariable.ttf +0 -0
- {pywebwinui3-1.0.0b3 → pywebwinui3-1.0.0b4}/pywebwinui3/web/SegoeFluentIcons.ttf +0 -0
- {pywebwinui3-1.0.0b3 → pywebwinui3-1.0.0b4}/pywebwinui3/web/assets/index.5f301150.css +0 -0
- {pywebwinui3-1.0.0b3 → pywebwinui3-1.0.0b4}/pywebwinui3/web/assets/index.7925e0dd.js +0 -0
- {pywebwinui3-1.0.0b3 → pywebwinui3-1.0.0b4}/pywebwinui3/web/favicon.ico +0 -0
- {pywebwinui3-1.0.0b3 → pywebwinui3-1.0.0b4}/pywebwinui3/web/index.html +0 -0
- {pywebwinui3-1.0.0b3 → pywebwinui3-1.0.0b4}/setup.cfg +0 -0
- {pywebwinui3-1.0.0b3 → pywebwinui3-1.0.0b4}/setup.py +0 -0
|
@@ -83,23 +83,31 @@ class MainWindow:
|
|
|
83
83
|
]
|
|
84
84
|
)
|
|
85
85
|
|
|
86
|
+
def onValueChange(self, valueName):
|
|
87
|
+
def decorator(func):
|
|
88
|
+
self.events.setdefault("setValue", {}).setdefault(valueName, []).append(func)
|
|
89
|
+
return func
|
|
90
|
+
return decorator
|
|
91
|
+
|
|
92
|
+
def onSetup(self, valueName):
|
|
93
|
+
def decorator(func):
|
|
94
|
+
self.events.setdefault("setup", {}).setdefault(valueName, []).append(func)
|
|
95
|
+
return func
|
|
96
|
+
return decorator
|
|
97
|
+
|
|
86
98
|
def notice(self, level:int, title:str, description:str):
|
|
87
99
|
self.setValue('system.nofication', [*self.values["system.nofication"],[level,title,description]])
|
|
88
100
|
|
|
89
101
|
def setup(self):
|
|
90
102
|
systemMessageListener(self.themeChanged)
|
|
103
|
+
for event in self.events.get("setup",[]):
|
|
104
|
+
threading.Thread(target=event, daemon=True).start()
|
|
91
105
|
|
|
92
106
|
def init(self):
|
|
93
107
|
return {
|
|
94
108
|
**self.values,
|
|
95
109
|
"system.isOnTop": self._window.on_top,
|
|
96
110
|
}
|
|
97
|
-
|
|
98
|
-
def onValueChange(self, valueName):
|
|
99
|
-
def decorator(func):
|
|
100
|
-
self.events.setdefault("setValue", {}).setdefault(valueName, []).append(func)
|
|
101
|
-
return func
|
|
102
|
-
return decorator
|
|
103
111
|
|
|
104
112
|
def setValue(self, key, value, sync=True):
|
|
105
113
|
self.values[key]=value
|
|
@@ -107,7 +115,7 @@ class MainWindow:
|
|
|
107
115
|
threading.Thread(target=lambda: self._window.evaluate_js(f"window.setValue('{key}', {json.dumps(value)}, false)"), daemon=True).start()
|
|
108
116
|
logger.debug(f"Value synced: {key}")
|
|
109
117
|
for event in self.events.get("setValue",{}).get(key,[]):
|
|
110
|
-
event(key,value)
|
|
118
|
+
threading.Thread(target=event, args=(key,value,), daemon=True).start()
|
|
111
119
|
|
|
112
120
|
def themeChanged(self, color):
|
|
113
121
|
if color != self.values['system.color']:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|