From 9f6fed4e7b496b2fbd18e2df0af73cddc66bf297 Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Mon, 7 Aug 2017 16:12:12 -0400 Subject: [PATCH] tests: Test the separator widget --- .../wibox/widget/defaults/separator.lua | 13 +++++++ .../wibox/widget/separator/border_color.lua | 18 ++++++++++ .../wibox/widget/separator/orientation.lua | 36 +++++++++++++++++++ .../examples/wibox/widget/separator/shape.lua | 23 ++++++++++++ 4 files changed, 90 insertions(+) create mode 100644 tests/examples/wibox/widget/defaults/separator.lua create mode 100644 tests/examples/wibox/widget/separator/border_color.lua create mode 100644 tests/examples/wibox/widget/separator/orientation.lua create mode 100644 tests/examples/wibox/widget/separator/shape.lua diff --git a/tests/examples/wibox/widget/defaults/separator.lua b/tests/examples/wibox/widget/defaults/separator.lua new file mode 100644 index 00000000..6580e059 --- /dev/null +++ b/tests/examples/wibox/widget/defaults/separator.lua @@ -0,0 +1,13 @@ +local parent = ... --DOC_HIDE +local wibox = require( "wibox" ) --DOC_HIDE + +parent:add( --DOC_HIDE + +wibox.widget { + forced_height = 20, --DOC_HIDE + forced_width = 100, --DOC_HIDE + widget = wibox.widget.separator +} + +) --DOC_HIDE +--DOC_HIDE vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/tests/examples/wibox/widget/separator/border_color.lua b/tests/examples/wibox/widget/separator/border_color.lua new file mode 100644 index 00000000..3228a1bf --- /dev/null +++ b/tests/examples/wibox/widget/separator/border_color.lua @@ -0,0 +1,18 @@ +local parent = ... --DOC_HIDE +local wibox = require("wibox") --DOC_HIDE +local gears = {shape = require("gears.shape")}--DOC_HIDE +local beautiful = require("beautiful")--DOC_HIDE + +parent:add( --DOC_HIDE +wibox.widget { + shape = gears.shape.circle, + color = "#00000000", + border_width = 1, + border_color = beautiful.bg_normal, + widget = wibox.widget.separator, + forced_height = 20, --DOC_HIDE + forced_width = 20, --DOC_HIDE +} +) --DOC_HIDE + +--DOC_HIDE vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/tests/examples/wibox/widget/separator/orientation.lua b/tests/examples/wibox/widget/separator/orientation.lua new file mode 100644 index 00000000..eb42f8fd --- /dev/null +++ b/tests/examples/wibox/widget/separator/orientation.lua @@ -0,0 +1,36 @@ +local parent = ... --DOC_HIDE_ALL +local wibox = require("wibox") + +parent:add( +wibox.widget { + { + { + markup = "orientation = horizontal", + widget = wibox.widget.textbox + }, + { + orientation = "horizontal", + widget = wibox.widget.separator, + }, + forced_width = 200, + layout = wibox.layout.fixed.vertical + }, + { + { + markup = "orientation = vertical", + widget = wibox.widget.textbox + }, + { + orientation = "vertical", + widget = wibox.widget.separator, + }, + forced_width = 200, + layout = wibox.layout.fixed.vertical + }, + forced_height = 30, + forced_width = 400, + layout = wibox.layout.fixed.horizontal +} +) + +--DOC_HIDE vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/tests/examples/wibox/widget/separator/shape.lua b/tests/examples/wibox/widget/separator/shape.lua new file mode 100644 index 00000000..823701dd --- /dev/null +++ b/tests/examples/wibox/widget/separator/shape.lua @@ -0,0 +1,23 @@ +local parent = ... --DOC_HIDE +local wibox = require("wibox") --DOC_HIDE +local gears = {shape = require("gears.shape")}--DOC_HIDE + +local wdgs = { --DOC_HIDE + forced_height = 30, --DOC_HIDE + forced_width = 30*4, --DOC_HIDE + spacing = 5, --DOC_HIDE + layout = wibox.layout.flex.horizontal --DOC_HIDE +} --DOC_HIDE + + +for _, s in ipairs { "losange" ,"circle", "isosceles_triangle", "cross" } do + local w = wibox.widget { + shape = gears.shape[s], + widget = wibox.widget.separator, + } + table.insert(wdgs, w) --DOC_HIDE +end + +parent:add( wibox.layout(wdgs)) --DOC_HIDE + +--DOC_HIDE vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80