diff --git a/changelog.md b/changelog.md index 0a397058..8f3fc4a3 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,10 @@ Lite XL is following closely [rxi/lite](https://github.com/rxi/lite) but with so This files document the changes done in Lite XL for each release. +### next release + +Add `system.set_window_opacity` function. + ### 1.16.5 Hotfix for Github's issue https://github.com/franko/lite-xl/issues/122 diff --git a/src/api/system.c b/src/api/system.c index 56880616..bd8521ef 100644 --- a/src/api/system.c +++ b/src/api/system.c @@ -454,6 +454,13 @@ static int f_fuzzy_match(lua_State *L) { return 1; } +static int f_set_window_opacity(lua_State *L) { + double n = luaL_checknumber(L, 1); + int r = SDL_SetWindowOpacity(window, n); + lua_pushboolean(L, r > -1); + return 1; +} + static const luaL_Reg lib[] = { { "poll_event", f_poll_event }, @@ -477,6 +484,7 @@ static const luaL_Reg lib[] = { { "sleep", f_sleep }, { "exec", f_exec }, { "fuzzy_match", f_fuzzy_match }, + { "set_window_opacity", f_set_window_opacity }, { NULL, NULL } };