Module: lib-tde.widget.rounded

functions to help with rounding widgets.

This package contains simple function to round your widgets.

wibox.widget {
   text = "hello",
   shape = lib-tde.widget.rounded(),
   widget = wibox.widget.textbox,
}

Class Hierarchy

Info:

  • Copyright: 2020 Tom Meyers
  • Author: Tom Meyers

Static module functions

lib-tde.widget.rounded.rounded ([size]) Round the corners of a wibox, as a cairo surface shape

Object methods

:connect_signal (name, func) Connect to a signal. Inherited from gears.object
:weak_connect_signal (name, func) Connect to a signal weakly. Inherited from gears.object
:disconnect_signal (name, func) Disonnect from a signal. Inherited from gears.object
:emit_signal (name, ...) Emit a signal. Inherited from gears.object


Static module functions

lib-tde.widget.rounded.rounded ([size])
Round the corners of a wibox, as a cairo surface shape

Parameters:

  • size number the size in pixels (best to wrap around a dpi call) (optional)

Usage:

    -- rounds the corners by 10 (based on the user dpi)
     lib-tde.widgets.rounded(dpi(10))

Object methods

:connect_signal (name, func) · Inherited from gears.object

Connect to a signal.

Usage example output:

In slot [obj]   nil nil nil
In slot [obj]   foo bar 42

Parameters:

  • name string The name of the signal.
  • func function The callback to call when the signal is emitted.

Usage:

    local o = gears.object{}
    -- Function can be attached to signals
    local function slot(obj, a, b, c)
        print('In slot', obj, a, b, c)
    end
    o:connect_signal('my_signal', slot)
    -- Emitting can be done without arguments. In that case, the object will be
    -- implicitly added as an argument.
    o:emit_signal 'my_signal'
    -- It is also possible to add as many random arguments are required.
    o:emit_signal('my_signal', 'foo', 'bar', 42)
    -- Finally, to allow the object to be garbage collected (the memory freed), it
    -- is necessary to disconnect the signal or use weak_connect_signal
    o:disconnect_signal('my_signal', slot)
    -- This time, the slot wont be called as it is no longer connected.
    o:emit_signal 'my_signal'
:weak_connect_signal (name, func) · Inherited from gears.object
Connect to a signal weakly.

This allows the callback function to be garbage collected and automatically disconnects the signal when that happens. Warning: Only use this function if you really, really, really know what you are doing.

Parameters:

  • name string The name of the signal.
  • func function The callback to call when the signal is emitted.
:disconnect_signal (name, func) · Inherited from gears.object
Disonnect from a signal.

Parameters:

  • name string The name of the signal.
  • func function The callback that should be disconnected.
:emit_signal (name, ...) · Inherited from gears.object
Emit a signal.

Parameters:

  • name string The name of the signal
  • ... Extra arguments for the callback functions. Each connected function receives the object as first argument and then any extra arguments that are given to emit_signal()
generated by LDoc 1.4.6 Build with 💜 By F0xedb Last updated 2021-05-21 03:30:15