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