Improve textclock property docs (#2926)
* Add format docs to the constructor. * Add timezone docs to the property. * Give the argument to set_refresh a name other than "How". * Fix bug in constructor argument "format" rendering.
This commit is contained in:
parent
76f8c11776
commit
f8a9c59d50
|
@ -44,6 +44,8 @@ function textclock:get_format()
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Set the clock's timezone
|
--- Set the clock's timezone
|
||||||
|
-- e.g. "Z" for UTC, "±hh:mm" or "Europe/Amsterdam". See
|
||||||
|
-- [GTimeZone](https://developer.gnome.org/glib/stable/glib-GTimeZone.html#g-time-zone-new).
|
||||||
-- @property timezone
|
-- @property timezone
|
||||||
-- @tparam string timezone
|
-- @tparam string timezone
|
||||||
|
|
||||||
|
@ -59,7 +61,7 @@ end
|
||||||
|
|
||||||
--- Set the clock's refresh rate
|
--- Set the clock's refresh rate
|
||||||
-- @property refresh
|
-- @property refresh
|
||||||
-- @tparam number How often the clock is updated, in seconds
|
-- @tparam number refresh How often the clock is updated, in seconds
|
||||||
|
|
||||||
function textclock:set_refresh(refresh)
|
function textclock:set_refresh(refresh)
|
||||||
self._private.refresh = refresh or self._private.refresh
|
self._private.refresh = refresh or self._private.refresh
|
||||||
|
@ -84,11 +86,9 @@ end
|
||||||
|
|
||||||
--- Create a textclock widget. It draws the time it is in a textbox.
|
--- Create a textclock widget. It draws the time it is in a textbox.
|
||||||
--
|
--
|
||||||
-- @tparam[opt=" %a %b %d, %H:%M "] string format The time format.
|
-- @tparam[opt=" %a %b %d, %H:%M "] string format The time [format](#format).
|
||||||
-- @tparam[opt=60] number refresh How often to update the time (in seconds).
|
-- @tparam[opt=60] number refresh How often to update the time (in seconds).
|
||||||
-- @tparam[opt=local timezone] string timezone The timezone to use,
|
-- @tparam[opt=local timezone] string timezone The [timezone](#timezone) to use.
|
||||||
-- e.g. "Z" for UTC, "±hh:mm" or "Europe/Amsterdam". See
|
|
||||||
-- https://developer.gnome.org/glib/stable/glib-GTimeZone.html#g-time-zone-new.
|
|
||||||
-- @treturn table A textbox widget.
|
-- @treturn table A textbox widget.
|
||||||
-- @constructorfct wibox.widget.textclock
|
-- @constructorfct wibox.widget.textclock
|
||||||
local function new(format, refresh, tzid)
|
local function new(format, refresh, tzid)
|
||||||
|
|
Loading…
Reference in New Issue