Skip to content

Commit 5517469

Browse files
author
philmoz
committed
Don't call object functions when object not visible.
Allow 'filled' property to be a function.
1 parent 12b9d8d commit 5517469

File tree

6 files changed

+271
-159
lines changed

6 files changed

+271
-159
lines changed

radio/src/gui/colorlcd/libui/window.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,11 @@ void Window::show(bool visible)
405405
}
406406
}
407407

408+
bool Window::isVisible()
409+
{
410+
return !_deleted && lvobj && !lv_obj_has_flag(lvobj, LV_OBJ_FLAG_HIDDEN);
411+
}
412+
408413
void Window::enable(bool enabled)
409414
{
410415
if (!_deleted && lvobj) {

radio/src/gui/colorlcd/libui/window.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ class Window
185185

186186
virtual void show(bool visible = true);
187187
void hide() { show(false); }
188+
bool isVisible();
188189
virtual void enable(bool enabled = true);
189190
void disable() { enable(false); }
190191

radio/src/lua/interface.cpp

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -292,26 +292,26 @@ void luaDoGc(lua_State * L, bool full)
292292
else {
293293
lua_gc(L, LUA_GCSTEP, 10);
294294
}
295-
#if defined(DEBUG)
296-
if (L == lsScripts) {
297-
static uint32_t lastgcSctipts = 0;
298-
uint32_t gc = luaGetMemUsed(L);
299-
if (gc > (lastgcSctipts + GC_REPORT_TRESHOLD) || (gc + GC_REPORT_TRESHOLD) < lastgcSctipts) {
300-
lastgcSctipts = gc;
301-
TRACE("GC Use Scripts: %u bytes", gc);
302-
}
303-
}
304-
#if defined(COLORLCD)
305-
if (L == lsWidgets) {
306-
static uint32_t lastgcWidgets = 0;
307-
uint32_t gc = luaGetMemUsed(L);
308-
if (gc > (lastgcWidgets + GC_REPORT_TRESHOLD) || (gc + GC_REPORT_TRESHOLD) < lastgcWidgets) {
309-
lastgcWidgets = gc;
310-
TRACE("GC Use Widgets: %u bytes + Extra %u", gc, luaExtraMemoryUsage);
311-
}
312-
}
313-
#endif
314-
#endif
295+
// #if defined(DEBUG)
296+
// if (L == lsScripts) {
297+
// static uint32_t lastgcSctipts = 0;
298+
// uint32_t gc = luaGetMemUsed(L);
299+
// if (gc > (lastgcSctipts + GC_REPORT_TRESHOLD) || (gc + GC_REPORT_TRESHOLD) < lastgcSctipts) {
300+
// lastgcSctipts = gc;
301+
// TRACE("GC Use Scripts: %u bytes", gc);
302+
// }
303+
// }
304+
// #if defined(COLORLCD)
305+
// if (L == lsWidgets) {
306+
// static uint32_t lastgcWidgets = 0;
307+
// uint32_t gc = luaGetMemUsed(L);
308+
// if (gc > (lastgcWidgets + GC_REPORT_TRESHOLD) || (gc + GC_REPORT_TRESHOLD) < lastgcWidgets) {
309+
// lastgcWidgets = gc;
310+
// TRACE("GC Use Widgets: %u bytes + Extra %u", gc, luaExtraMemoryUsage);
311+
// }
312+
// }
313+
// #endif
314+
// #endif
315315
}
316316
else {
317317
// we disable Lua for the rest of the session

0 commit comments

Comments
 (0)