Switched to TreeView:color_for_item(abs_path)
This commit is contained in:
parent
bede0ff878
commit
373007a767
|
@ -43,7 +43,6 @@ function TreeView:new()
|
||||||
self.cache = {}
|
self.cache = {}
|
||||||
self.last = {}
|
self.last = {}
|
||||||
self.tooltip = { x = 0, y = 0, begin = 0, alpha = 0 }
|
self.tooltip = { x = 0, y = 0, begin = 0, alpha = 0 }
|
||||||
self.color_overrides = {}
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -296,13 +295,9 @@ function TreeView:draw_tooltip()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function TreeView:set_color_override(abs_filename, color)
|
function TreeView:color_for_item(abs_filename)
|
||||||
self.color_overrides[abs_filename] = color
|
-- other plugins can override this to customize the color of each icon
|
||||||
end
|
return nil
|
||||||
|
|
||||||
|
|
||||||
function TreeView:clear_all_color_overrides()
|
|
||||||
self.color_overrides = {}
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -330,7 +325,7 @@ function TreeView:draw()
|
||||||
end
|
end
|
||||||
|
|
||||||
-- allow for color overrides
|
-- allow for color overrides
|
||||||
local icon_color = self.color_overrides[item.abs_filename] or color
|
local icon_color = self:color_for_item(item.abs_filename) or color
|
||||||
|
|
||||||
-- icons
|
-- icons
|
||||||
x = x + item.depth * style.padding.x + style.padding.x
|
x = x + item.depth * style.padding.x + style.padding.x
|
||||||
|
|
Loading…
Reference in New Issue