mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-03 18:29:09 +00:00
Add API to set the XDG app id
ChangeLog: Added function to set the XDG app id on Wayland/X11. This needs to be added with respective function names in the language sections. Fixes #1332
This commit is contained in:
parent
10edaaa7f1
commit
1888e58735
11 changed files with 102 additions and 1 deletions
|
@ -20,6 +20,11 @@ fn quit_event_loop() -> Result<(), errors::PyEventLoopError> {
|
|||
slint_interpreter::quit_event_loop().map_err(|e| e.into())
|
||||
}
|
||||
|
||||
#[pyfunction]
|
||||
fn set_xdg_app_id(app_id: String) -> Result<(), errors::PyPlatformError> {
|
||||
slint_interpreter::set_xdg_app_id(app_id).map_err(|e| e.into())
|
||||
}
|
||||
|
||||
use pyo3::prelude::*;
|
||||
|
||||
#[pymodule]
|
||||
|
@ -44,6 +49,7 @@ fn slint(_py: Python<'_>, m: &Bound<'_, PyModule>) -> PyResult<()> {
|
|||
m.add_class::<value::PyStruct>()?;
|
||||
m.add_function(wrap_pyfunction!(run_event_loop, m)?)?;
|
||||
m.add_function(wrap_pyfunction!(quit_event_loop, m)?)?;
|
||||
m.add_function(wrap_pyfunction!(set_xdg_app_id, m)?)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
@ -317,3 +317,6 @@ Model = models.Model
|
|||
Timer = native.Timer
|
||||
TimerMode = native.TimerMode
|
||||
Struct = native.PyStruct
|
||||
|
||||
def set_xdg_app_id(app_id: str):
|
||||
native.set_xdg_app_id(app_id)
|
Loading…
Add table
Add a link
Reference in a new issue