From ab6381686ed9e0f6b1a7507a5a8beab32f209d65 Mon Sep 17 00:00:00 2001 From: Seth Barberee Date: Fri, 17 Jan 2020 15:56:47 -0600 Subject: [PATCH] add calendar_popup pic to doc --- lib/awful/widget/calendar_popup.lua | 2 +- .../awful/widget/calendar_popup/default.lua | 35 +++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 tests/examples/awful/widget/calendar_popup/default.lua diff --git a/lib/awful/widget/calendar_popup.lua b/lib/awful/widget/calendar_popup.lua index 3c9fa3fb0..97a625aeb 100644 --- a/lib/awful/widget/calendar_popup.lua +++ b/lib/awful/widget/calendar_popup.lua @@ -18,7 +18,7 @@ -- The wibox visibility can be changed calling the `toggle` method. -- The `attach` method adds mouse bindings to an existing widget in order to toggle the display of the wibox. -- ---@DOC_wibox_awidget_defaults_calendar_popup_EXAMPLE@ +--@DOC_awful_widget_calendar_popup_default_EXAMPLE@ -- -- @author getzze -- @copyright 2017 getzze diff --git a/tests/examples/awful/widget/calendar_popup/default.lua b/tests/examples/awful/widget/calendar_popup/default.lua new file mode 100644 index 000000000..76cc31747 --- /dev/null +++ b/tests/examples/awful/widget/calendar_popup/default.lua @@ -0,0 +1,35 @@ +--DOC_NO_USAGE --DOC_GEN_IMAGE +local awful = require("awful") --DOC_HIDE +local wibox = require("wibox") --DOC_HIDE + +screen[1]._resize {width = 480, height = 200} --DOC_HIDE + +local wb = awful.wibar { position = "top", } --DOC_HIDE + +--DOC_HIDE Create the same number of tags as the default config +awful.tag({ "1", "2", "3", "4", "5", "6", "7", "8", "9" }, screen[1], awful.layout.layouts[1]) --DOC_HIDE + +--DOC_HIDE Only bother with widgets that are visible by default +local mykeyboardlayout = awful.widget.keyboardlayout() --DOC_HIDE +local mytextclock = wibox.widget.textclock() --DOC_HIDE +local mytaglist = awful.widget.taglist(screen[1], awful.widget.taglist.filter.all, {}) --DOC_HIDE +local mytasklist = awful.widget.tasklist(screen[1], awful.widget.tasklist.filter.currenttags, {}) --DOC_HIDE + local month_calendar = awful.widget.calendar_popup.month() + month_calendar:attach( mytextclock, "tr" ) + + wb:setup { --DOC_HIDE + layout = wibox.layout.align.horizontal,--DOC_HIDE + { --DOC_HIDE + mytaglist, --DOC_HIDE + layout = wibox.layout.fixed.horizontal,--DOC_HIDE + },--DOC_HIDE + mytasklist, --DOC_HIDE + {--DOC_HIDE + layout = wibox.layout.fixed.horizontal,--DOC_HIDE + mykeyboardlayout,--DOC_HIDE + mytextclock,--DOC_HIDE + },--DOC_HIDE + }--DOC_HIDE + month_calendar:toggle() + +--DOC_HIDE vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80