Skip to content

Commit

Permalink
Update the 'zilla' theme
Browse files Browse the repository at this point in the history
  • Loading branch information
Elv13 committed Jan 6, 2015
1 parent 57c78fc commit 775bfe8
Show file tree
Hide file tree
Showing 32 changed files with 635 additions and 97 deletions.
Binary file modified blind/arrow/Icon/tags/cross.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified blind/arrow/Icon/tags/cross2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed blind/arrow/Icon/titlebar/floating.png
Binary file not shown.
Binary file removed blind/arrow/Icon/titlebar/floating_focus.png
Binary file not shown.
Binary file removed blind/arrow/Icon/titlebar/ontop.png
Binary file not shown.
Binary file removed blind/arrow/Icon/titlebar/ontop_float.png
Binary file not shown.
Binary file removed blind/arrow/Icon/titlebar/ontop_focus.png
Binary file not shown.
Binary file removed blind/arrow/Icon/titlebar/sticky.png
Binary file not shown.
Binary file removed blind/arrow/Icon/titlebar/sticky_float.png
Binary file not shown.
Binary file removed blind/arrow/Icon/titlebar/sticky_focus.png
Binary file not shown.
Binary file removed blind/arrow/Icon/titlebar/sticky_ontop.png
Binary file not shown.
Binary file removed blind/arrow/Icon/titlebar/sticky_ontop_float.png
Binary file not shown.
12 changes: 7 additions & 5 deletions blind/arrow/bits/client_shape.lua
@@ -1,4 +1,4 @@
local radius = ...
local radius,bot,all= ...
local capi = {client=client}
local shape = require("blind.common.shape" )
local beautiful = require("beautiful" )
Expand All @@ -14,6 +14,8 @@ local active = setmetatable({},{__mode="k"})

radius = radius or 5

fct = bot and shape.draw_round_rect or shape.draw_round_rect2

local function create(c)
local geo = c:geometry()
local border = beautiful.border_width
Expand All @@ -29,7 +31,7 @@ local function create(c)

cr:set_operator(cairo.Operator.SOURCE)
cr:set_source_rgba(1,1,1,1)
shape.draw_round_rect2(cr,0,0,width+2*border,height+2*border,2*radius,2*radius,radius,radius)
fct(cr,0,0,width+2*border,height+2*border,2*radius,2*radius,radius,radius)
cr:fill()

c.shape_bounding = img._native
Expand All @@ -44,7 +46,7 @@ local function create(c)
cr:set_operator(cairo.Operator.SOURCE)
cr:set_source_rgba(1,1,1,1)

shape.draw_round_rect2(cr,0,0,width,height,2*radius,2*radius,radius,radius)
fct(cr,0,0,width,height,2*radius,2*radius,radius,radius)
cr:fill()
c.shape_clip = img._native
img:finish()
Expand All @@ -61,15 +63,15 @@ capi.client.connect_signal("property::floating",function(c)
end)

capi.client.connect_signal("property::width",function(c)
if active[c] then
if all or active[c] then
create(c)
else
cshape.update.all(c)
end
end)

capi.client.connect_signal("property::height",function(c)
if active[c] then
if all or active[c] then
create(c)
else
cshape.update.all(c)
Expand Down
95 changes: 95 additions & 0 deletions blind/arrow/bits/titlebar_square.lua
@@ -0,0 +1,95 @@
local theme,path = ...
local surface = require( "gears.surface" )
local blind = require( "blind" )
local shape = require( "blind.common.shape" )
local color = require( "gears.color" )
local cairo = require( "lgi" ).cairo
local pixmap = require( "blind.common.pixmap")

local active = theme.titlebar_icon_active or theme.titlebar_icon_fg or theme.fg_normal
local height = theme.titlebar_height
local base_square = {}

local square = nil

local function get_cols(state)
return color(theme["titlebar_bg_"..state]),color(theme["titlebar_border_color_"..state])
end

local function gen_squares()
for _,v in ipairs {"inactive","active", "hover", "pressed"} do
local bg,border = get_cols(v)
local img = cairo.ImageSurface.create(cairo.Format.ARGB32, height-2, height)
local cr = cairo.Context(img)
if square then
cr:append_path(square)
else
shape.draw_round_rect(cr,2,2,height-7,height-7,3)
square = cr:copy_path()
end
cr:set_source(bg)
cr:fill_preserve()
cr:set_source(border)
cr:set_line_width(2)
cr:stroke()
base_square[v] = img
print(v)
end
end
gen_squares()

local function add_icon(state,type,icon_path)
local img = cairo.ImageSurface.create(cairo.Format.ARGB32, height-2, height)
local cr = cairo.Context(img)
cr:set_source_surface(base_square[state])
cr:paint()
cr:set_source_surface(surface(icon_path or (path .."Icon/titlebar/".. type .."_normal_inactive.png")))
cr:paint()
return pixmap(img) : shadow() : to_img()
end

local close = base_square.active
local ontop = base_square.active
local sticky = base_square.active
local floating = base_square.active
local maximized = base_square.active

theme.titlebar = blind {
close_button = blind {
normal = add_icon("active","close",path .."Icon/titlebar/close_focus_inactive.png"),
focus = add_icon("hover","close",path .."Icon/titlebar/close_focus_inactive.png"),
},

ontop_button = blind {
normal_inactive = add_icon("inactive","ontop"),
focus_inactive = add_icon("inactive","ontop"),
normal_active = add_icon("active","ontop"),
focus_active = add_icon("active","ontop"),
},

sticky_button = blind {
normal_inactive = add_icon("inactive","sticky"),
focus_inactive = add_icon("inactive","sticky"),
normal_active = add_icon("active","sticky"),
focus_active = add_icon("active","sticky"),
},

floating_button = blind {
normal_inactive = add_icon("inactive","floating"),
focus_inactive = add_icon("inactive","floating"),
normal_active = add_icon("active","floating"),
focus_active = add_icon("active","floating"),
},

maximized_button = blind {
normal_inactive = add_icon("inactive","maximized"),
focus_inactive = add_icon("inactive","maximized"),
normal_active = add_icon("active","maximized"),
focus_active = add_icon("active","maximized"),
},

resize = add_icon("active","maximized",path .."Icon/titlebar/resize.png"),
tag = add_icon("active","maximized",path .."Icon/titlebar/tag.png"),
title_align = "left",
bg_alternate= "#00000000"
}

0 comments on commit 775bfe8

Please sign in to comment.