From beb997f84867232ae707d1aff47d8db29de915df Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Sun, 11 Dec 2016 00:05:50 -0500 Subject: [PATCH] tests: Test the xresource theme logo generation As a side effect, this creates valuable SVG assets --- tests/examples/wibox/logo/logo.lua | 19 +++++++++++++++++++ tests/examples/wibox/logo/logo_and_name.lua | 21 +++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 tests/examples/wibox/logo/logo.lua create mode 100644 tests/examples/wibox/logo/logo_and_name.lua diff --git a/tests/examples/wibox/logo/logo.lua b/tests/examples/wibox/logo/logo.lua new file mode 100644 index 00000000..7d9009fa --- /dev/null +++ b/tests/examples/wibox/logo/logo.lua @@ -0,0 +1,19 @@ +local parent = ... --DOC_HIDE +local wibox = require( "wibox" ) --DOC_HIDE +local beautiful = require( "beautiful" ) --DOC_HIDE +local assets = require( "xresources.assets" ) --DOC_HIDE +local color = require( "gears.color" ) --DOC_HIDE + +local size = 128 --DOC_HIDE + +parent:add( --DOC_HIDE + +wibox.widget { + fit = function() return 128, 128 end, + draw = function(_, _, cr) + assets.gen_logo(cr, 128, 128, nil, "#535d6c") + end, + widget = wibox.widget.base.make_widget +} + +) --DOC_HIDE diff --git a/tests/examples/wibox/logo/logo_and_name.lua b/tests/examples/wibox/logo/logo_and_name.lua new file mode 100644 index 00000000..ef160856 --- /dev/null +++ b/tests/examples/wibox/logo/logo_and_name.lua @@ -0,0 +1,21 @@ +local parent = ... --DOC_HIDE +local wibox = require( "wibox" ) --DOC_HIDE +local beautiful = require( "beautiful" ) --DOC_HIDE +local assets = require( "xresources.assets" ) --DOC_HIDE +local color = require( "gears.color" ) --DOC_HIDE + +local size = 128 --DOC_HIDE + +parent:add( --DOC_HIDE + +wibox.widget { + fit = function() return 148, 128 end, + draw = function(_, _, cr) + assets.gen_logo(cr, 128, 128, nil, "#535d6c") + cr:translate(128 + 128/16, 0) + assets.gen_awesome_name(cr, 0, 158, nil, "#535d6c", alt_fg, true) + end, + widget = wibox.widget.base.make_widget +} + +) --DOC_HIDE