mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-29 04:20:29 +00:00
fixed mouse event for padded box
This commit is contained in:
parent
c9264de22a
commit
05fedafd37
@ -150,6 +150,13 @@ local function renderGroup(group, global)
|
||||
|
||||
local resetButtonLayout = {
|
||||
template = I.MWUI.templates.box,
|
||||
events = {
|
||||
mouseClick = async:callback(function()
|
||||
for _, setting in pairs(group.settings) do
|
||||
setSettingValue(global, group.key, setting.key, setting.default)
|
||||
end
|
||||
end),
|
||||
},
|
||||
content = ui.content {
|
||||
{
|
||||
template = I.MWUI.templates.padding,
|
||||
@ -159,13 +166,6 @@ local function renderGroup(group, global)
|
||||
props = {
|
||||
text = interfaceL10n('Reset')
|
||||
},
|
||||
events = {
|
||||
mouseClick = async:callback(function()
|
||||
for _, setting in pairs(group.settings) do
|
||||
setSettingValue(global, group.key, setting.key, setting.default)
|
||||
end
|
||||
end),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -73,7 +73,7 @@ return function(registerRenderer)
|
||||
registerRenderer('checkbox', function(value, set, argument)
|
||||
argument = applyDefaults(argument, defaultArgument)
|
||||
local l10n = core.l10n(argument.l10n)
|
||||
return disable(argument.disabled, paddedBox {
|
||||
local box = paddedBox {
|
||||
template = I.MWUI.templates.padding,
|
||||
content = ui.content {
|
||||
{
|
||||
@ -81,12 +81,13 @@ return function(registerRenderer)
|
||||
props = {
|
||||
text = l10n(value and argument.trueLabel or argument.falseLabel)
|
||||
},
|
||||
events = {
|
||||
mouseClick = async:callback(function() set(not value) end),
|
||||
},
|
||||
},
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
box.events = {
|
||||
mouseClick = async:callback(function() set(not value) end)
|
||||
}
|
||||
return disable(argument.disabled, box)
|
||||
end)
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user