1
0
Fork 0

bugfix canvas/gui.nas: rte on undefined member, remove unnecessary settimer call

This commit is contained in:
Henning Stahlke 2020-07-05 10:01:01 +02:00 committed by James Turner
parent 01811ec69a
commit c93cf18842

View file

@ -84,6 +84,7 @@ var Window = {
_widgets: [], _widgets: [],
_frame_width: 4, _frame_width: 4,
_title_bar_height: 25, _title_bar_height: 25,
_title: nil,
}; };
m.setInt("content-size[0]", size[0]); m.setInt("content-size[0]", size[0]);
@ -105,6 +106,7 @@ var Window = {
# Destructor # Destructor
del: func del: func
{ {
if (me["_title"] != nil)
me._title.del(); me._title.del();
me.clearFocus(); me.clearFocus();
@ -335,25 +337,13 @@ var Window = {
# support for CSS like position: absolute; with right and/or bottom margin # support for CSS like position: absolute; with right and/or bottom margin
if( name == "right" ) if( name == "right" )
me._handlePositionAbsolute(child, mode, name, 0); me._handlePositionAbsolute(child, mode, name, 0);
else if( name == "bottom" ) elsif( name == "bottom" )
me._handlePositionAbsolute(child, mode, name, 1); me._handlePositionAbsolute(child, mode, name, 1);
# update decoration on type change if (mode == 0) {
else if( name == "type" ) if (name == "type") me._updateDecoration();
{ elsif (name.starts_with("resize-")) me._handleResize(child, name);
if( mode == 0 ) elsif (name == "size") me._resizeDecoration();
settimer(func me._updateDecoration(), 0, 1);
}
else if( name.starts_with("resize-") )
{
if( mode == 0 )
me._handleResize(child, name);
}
else if( name == "size" )
{
if( mode == 0 )
me._resizeDecoration();
} }
}, },
_handlePositionAbsolute: func(child, mode, name, index) _handlePositionAbsolute: func(child, mode, name, index)