Merge remote-tracking branch 'basinbaby/set-window-opacity'
Implement the suggestion and close #125. Initial suggestion and implementation from https://github.com/rxi/lite/pull/17
This commit is contained in:
commit
4b3b8f430a
|
@ -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
|
||||
|
|
|
@ -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 }
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue