aboutsummaryrefslogtreecommitdiff
path: root/src/LuaRuntimeApi.hpp
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2025-07-25 18:56:49 +0530
committerAkshay Nair <phenax5@gmail.com>2025-07-25 18:56:49 +0530
commit2c7d36b4aa53ffa638a7aa7046767f10e7a152bf (patch)
tree679c34d6566f5a774bcd5f979af755cf3cfeac4f /src/LuaRuntimeApi.hpp
parent51be15cd7c9f39276f27d416356744041e62c22c (diff)
downloadnull-browser-2c7d36b4aa53ffa638a7aa7046767f10e7a152bf.tar.gz
null-browser-2c7d36b4aa53ffa638a7aa7046767f10e7a152bf.zip
Expose decorations enable/disable lua api
Diffstat (limited to '')
-rw-r--r--src/LuaRuntimeApi.hpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/LuaRuntimeApi.hpp b/src/LuaRuntimeApi.hpp
index 5ec72cc..d8e6073 100644
--- a/src/LuaRuntimeApi.hpp
+++ b/src/LuaRuntimeApi.hpp
@@ -5,6 +5,7 @@
#include "LuaRuntime.hpp"
#include "WindowActionRouter.hpp"
#include "events/Event.hpp"
+#include "widgets/Decorations.hpp"
int lua_api_view_set_url(lua_State *state) {
const char *url = lua_tostring(state, 1);
@@ -265,6 +266,16 @@ int lua_api_view_scroll_bottom(lua_State *state) {
return 1;
}
+int lua_api_decorations_set_enabled(lua_State *state) {
+ auto type = (DecorationType)lua_tointeger(state, 1);
+ bool enabled = lua_toboolean(state, 2);
+ qDebug() << type << enabled;
+ auto &runtime = LuaRuntime::instance();
+ emit runtime.decoration_set_enabled(type, enabled);
+ lua_pushnil(state);
+ return 1;
+}
+
// NOLINTNEXTLINE
static luaL_Reg internals_api[] = {
luaL_Reg{"event_add_listener", &lua_event_register},
@@ -289,5 +300,6 @@ static luaL_Reg internals_api[] = {
luaL_Reg{"search_set_text", &lua_api_search_set_text},
luaL_Reg{"search_previous", &lua_api_search_previous},
luaL_Reg{"search_next", &lua_api_search_next},
+ luaL_Reg{"decorations_set_enabled", &lua_api_decorations_set_enabled},
luaL_Reg{nullptr, nullptr},
};