Canvas: LayoutItem.setVisible can be chained
Wrap LayoutItem::setVisible so it returns self, and hence can be chained, similar to methods implemented in Nasal.
This commit is contained in:
parent
1b07851374
commit
fc842c17f0
1 changed files with 8 additions and 1 deletions
|
@ -361,6 +361,13 @@ static naRef f_customEventGetDetail( sc::CustomEvent& event,
|
|||
);
|
||||
}
|
||||
|
||||
static naRef f_layoutItemSetVisible(sc::LayoutItem& item,
|
||||
const nasal::CallContext& ctx)
|
||||
{
|
||||
item.setVisible(ctx.getArg<bool>(0, true));
|
||||
return ctx.me;
|
||||
}
|
||||
|
||||
static naRef f_boxLayoutAddItem( sc::BoxLayout& box,
|
||||
const nasal::CallContext& ctx )
|
||||
{
|
||||
|
@ -599,7 +606,7 @@ naRef initNasalCanvas(naRef globals, naContext c)
|
|||
.method("minimumHeightForWidth", &sc::LayoutItem::minimumHeightForWidth)
|
||||
.method("setAlignment", &sc::LayoutItem::setAlignment)
|
||||
.method("alignment", &sc::LayoutItem::alignment)
|
||||
.method("setVisible", &sc::LayoutItem::setVisible)
|
||||
.method("setVisible", f_layoutItemSetVisible)
|
||||
.method("isVisible", &sc::LayoutItem::isVisible)
|
||||
.method("isExplicitlyHidden", &sc::LayoutItem::isExplicitlyHidden)
|
||||
.method("show", &sc::LayoutItem::show)
|
||||
|
|
Loading…
Add table
Reference in a new issue