mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-15 19:52:05 +00:00
lua: Add "focus" property for Dialog widgets (mainly button and entry)
This commit is contained in:
parent
3fddf4dfef
commit
74b2423070
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2018 Igara Studio S.A.
|
||||
// Copyright (C) 2018-2019 Igara Studio S.A.
|
||||
// Copyright (C) 2018 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
@ -174,6 +174,12 @@ int Dialog_add_widget(lua_State* L, Widget* widget)
|
||||
if (type == LUA_TSTRING)
|
||||
label = lua_tostring(L, -1);
|
||||
lua_pop(L, 1);
|
||||
|
||||
// Focus magnet
|
||||
type = lua_getfield(L, 2, "focus");
|
||||
if (type != LUA_TNONE && lua_toboolean(L, -1))
|
||||
widget->setFocusMagnet(true);
|
||||
lua_pop(L, 1);
|
||||
}
|
||||
|
||||
if (label || !dlg->hbox) {
|
||||
|
Loading…
Reference in New Issue
Block a user