From 0abfed54decf6e2dc5185f1697b2ea436f200017 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Tue, 30 May 2017 10:33:52 +0200 Subject: [PATCH] example tests: Switch to new API This makes the templates used by the example tests use the new API added in the previous commit. Signed-off-by: Uli Schlachter --- tests/examples/wibox/container/defaults/template.lua | 4 +--- tests/examples/wibox/layout/template.lua | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/tests/examples/wibox/container/defaults/template.lua b/tests/examples/wibox/container/defaults/template.lua index 6e7a45516..5f6fffdbf 100644 --- a/tests/examples/wibox/container/defaults/template.lua +++ b/tests/examples/wibox/container/defaults/template.lua @@ -3,7 +3,6 @@ require("_common_template")(...) local beautiful = require( "beautiful" ) local wibox = require( "wibox" ) -local surface = require( "gears.surface" ) local shape = require( "gears.shape" ) -- Let the test request a size and file format @@ -72,7 +71,6 @@ end local f_w, f_h = container:fit({dpi=96}, 9999, 9999) -- Save to the output file -local img = surface.widget_to_svg(container, image_path..".svg", f_w, f_h) -img:finish() +wibox.widget.draw_to_svg_file(container, image_path..".svg", f_w, f_h) -- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/tests/examples/wibox/layout/template.lua b/tests/examples/wibox/layout/template.lua index f399049cb..1fbdc322f 100644 --- a/tests/examples/wibox/layout/template.lua +++ b/tests/examples/wibox/layout/template.lua @@ -2,7 +2,6 @@ local file_path, image_path = ... require("_common_template")(...) local wibox = require( "wibox" ) -local surface = require( "gears.surface" ) local color = require( "gears.color" ) local beautiful = require( "beautiful" ) local unpack = unpack or table.unpack -- luacheck: globals unpack (compatibility with Lua 5.1) @@ -99,7 +98,6 @@ for _ = 1, 10 do end -- Save to the output file -local img = surface["widget_to_svg"](widget, image_path..".svg", w or 200, h or 30) -img:finish() +wibox.widget.draw_to_svg_file(widget, image_path..".svg", w or 200, h or 30) -- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80