mirror of
https://github.com/awesomeWM/awesome
synced 2024-11-17 07:47:41 +01:00
gears.shape: Add powerline shape
This commit is contained in:
parent
4a44b0dc81
commit
0bf76dc984
1 changed files with 17 additions and 0 deletions
|
@ -140,6 +140,23 @@ function module.hexagon(cr, width, height)
|
|||
cr:close_path()
|
||||
end
|
||||
|
||||
--- Double arrow popularized by the vim-powerline module
|
||||
-- @param cr A cairo context
|
||||
-- @tparam number width The shape with
|
||||
-- @tparam number height The shape height
|
||||
-- @tparam[opt=height/2] number arrow_depth The width of the arrow part of the shape
|
||||
function module.powerline(cr, width, height, arrow_depth)
|
||||
local arrow_depth = arrow_depth or height/2
|
||||
cr:move_to(0 , 0 )
|
||||
cr:line_to(width - arrow_depth , 0 )
|
||||
cr:line_to(width , height/2 )
|
||||
cr:line_to(width - arrow_depth , height )
|
||||
cr:line_to(0 , height )
|
||||
cr:line_to(arrow_depth , height/2 )
|
||||
|
||||
cr:close_path()
|
||||
end
|
||||
|
||||
--- Ajust the shape using a transformation object
|
||||
--
|
||||
-- Apply various transformations to the shape
|
||||
|
|
Loading…
Reference in a new issue