mirror of
https://github.com/love2d/love.git
synced 2026-08-12 08:30:56 +02:00
Add love.themechanged() event.
Called when the system theme is changed (e.g. switching from light theme to dark and vice versa).
This commit is contained in:
@@ -573,6 +573,9 @@ Message *Event::convert(const SDL_Event &e)
|
||||
case SDL_EVENT_LOCALE_CHANGED:
|
||||
msg = new Message("localechanged");
|
||||
break;
|
||||
case SDL_EVENT_SYSTEM_THEME_CHANGED:
|
||||
msg = new Message("themechanged");
|
||||
break;
|
||||
case SDL_EVENT_SENSOR_UPDATE:
|
||||
sensorInstance = Module::getInstance<sensor::Sensor>(M_SENSOR);
|
||||
if (sensorInstance)
|
||||
|
||||
@@ -150,6 +150,9 @@ function love.createhandlers()
|
||||
sensorupdated = function (sensorType, x, y, z)
|
||||
if love.sensorupdated then return love.sensorupdated(sensorType, x, y, z) end
|
||||
end,
|
||||
themechanged = function ()
|
||||
if love.themechanged then return love.themechanged() end
|
||||
end,
|
||||
}, {
|
||||
__index = function(self, name)
|
||||
error("Unknown event: " .. name)
|
||||
|
||||
Reference in New Issue
Block a user