From 7da3c65079f0d15fe4014c757518a1320950b1f1 Mon Sep 17 00:00:00 2001 From: lethosor Date: Fri, 30 Oct 2015 19:16:29 -0400 Subject: [PATCH] Fix display of arrows in lua filtered list widgets Fixes #718 --- library/lua/gui/materials.lua | 1 + library/lua/gui/widgets.lua | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/library/lua/gui/materials.lua b/library/lua/gui/materials.lua index f29f530a5..3128f4292 100644 --- a/library/lua/gui/materials.lua +++ b/library/lua/gui/materials.lua @@ -179,6 +179,7 @@ function MaterialDialog:onSelectObj(item) end function MaterialDialog:addMaterial(choices, mat, typ, idx, pfix, parent) + if not mat then return end -- Check the filter if self.mat_filter and not self.mat_filter(mat, parent, typ, idx) then return diff --git a/library/lua/gui/widgets.lua b/library/lua/gui/widgets.lua index cb9e1c9be..6e789d35d 100644 --- a/library/lua/gui/widgets.lua +++ b/library/lua/gui/widgets.lua @@ -540,6 +540,7 @@ function List:onRenderBody(dc) local current = (i == self.selected) local cur_pen = self.cursor_pen local cur_dpen = self.text_pen + local active_pen = current and cur_pen or cur_dpen if not self.active then cur_pen = self.inactive_pen or self.cursor_pen @@ -549,7 +550,7 @@ function List:onRenderBody(dc) local icon = getval(obj.icon) if iw and icon then - dc:seek(0, y) + dc:seek(0, y):pen(active_pen) paint_icon(icon, obj) end @@ -565,7 +566,7 @@ function List:onRenderBody(dc) end if icon and not iw then - dc:seek(ip-1,y) + dc:seek(ip-1,y):pen(active_pen) paint_icon(icon, obj) end end