doc: Fix the titlebars widget constructor doc

This commit is contained in:
Emmanuel Lepage Vallee 2021-03-21 23:55:34 -07:00
parent 31fcce436c
commit b4cf88f4c0
3 changed files with 40 additions and 10 deletions

View File

@ -56,6 +56,36 @@ The default `rc.lua` does not add active borders:
![](../images/client_geo.svg)
<table class="widget_list" border="1">
<tr>
<th>Widget</th><th>Description</th>
</tr>
<tr>
<td>`awful.titlebar.widget.iconwidget`</td><td>The client icon (see `client.icon`)</td>
</tr>
<tr>
<td>`awful.titlebar.widget.titlewidget`</td><td>The client title (see `client.name`)</td>
</tr>
<tr>
<td>`awful.titlebar.widget.floatingbutton`</td><td> Toggle the floating (toggled) vs. tiling mode (untoggled). </td>
</tr>
<tr>
<td>`awful.titlebar.widget.maximizedbutton`</td><td>Toggle the maximized mode (toggled). Note that this is the<br/>"full" maximized mode, not vertical or horizontal maximization.<br/>See `client.maximized`.</td>
</tr>
<tr>
<td>`awful.titlebar.widget.stickybutton`</td><td>When toggled, a client will be displayed in all (screen) tags. See `client.sticky`)</td>
</tr>
<tr>
<td>`awful.titlebar.widget.ontopbutton`</td><td>When toggled, the client will be part of the `ontop` layer (see `client.ontop`).</td>
</tr>
<tr>
<td>`awful.titlebar.widget.closebutton`</td><td></td>
</tr>
<tr>
<td>`titlebar.widget.minimizebutton`</td><td></td>
</tr>
</table>
### Notification widgets
Notifications also have their own widgets.

View File

@ -654,7 +654,7 @@ end
-- This way, you can e.g. modify the font that is used.
-- @param c The client for which a titlewidget should be created.
-- @return The title widget.
-- @staticfct awful.titlebar.widget.titlewidget
-- @constructorfct awful.titlebar.widget.titlewidget
function titlebar.widget.titlewidget(c)
local ret = textbox()
local function update()
@ -672,7 +672,7 @@ end
-- available. This way, you can e.g. disallow resizes.
-- @param c The client for which an icon widget should be created.
-- @return The icon widget.
-- @staticfct awful.titlebar.widget.iconwidget
-- @constructorfct awful.titlebar.widget.iconwidget
function titlebar.widget.iconwidget(c)
return clienticon(c)
end
@ -690,7 +690,7 @@ end
-- @param selector A function that selects the image that should be displayed.
-- @param action Function that is called when the button is clicked.
-- @return The widget
-- @staticfct awful.titlebar.widget.button
-- @constructorfct awful.titlebar.widget.button
function titlebar.widget.button(c, name, selector, action)
local ret = imagebox()
@ -778,7 +778,7 @@ end
--- Create a new float button for a client.
-- @param c The client for which the button is wanted.
-- @staticfct awful.titlebar.widget.floatingbutton
-- @constructorfct awful.titlebar.widget.floatingbutton
function titlebar.widget.floatingbutton(c)
local widget = titlebar.widget.button(c, "floating", aclient.object.get_floating, aclient.floating.toggle)
update_on_signal(c, "property::floating", widget)
@ -787,7 +787,7 @@ end
--- Create a new maximize button for a client.
-- @param c The client for which the button is wanted.
-- @staticfct awful.titlebar.widget.maximizedbutton
-- @constructorfct awful.titlebar.widget.maximizedbutton
function titlebar.widget.maximizedbutton(c)
local widget = titlebar.widget.button(c, "maximized", function(cl)
return cl.maximized
@ -800,7 +800,7 @@ end
--- Create a new minimize button for a client.
-- @param c The client for which the button is wanted.
-- @staticfct awful.titlebar.widget.minimizebutton
-- @constructorfct awful.titlebar.widget.minimizebutton
function titlebar.widget.minimizebutton(c)
local widget = titlebar.widget.button(c, "minimize",
function() return "" end,
@ -811,14 +811,14 @@ end
--- Create a new closing button for a client.
-- @param c The client for which the button is wanted.
-- @staticfct awful.titlebar.widget.closebutton
-- @constructorfct awful.titlebar.widget.closebutton
function titlebar.widget.closebutton(c)
return titlebar.widget.button(c, "close", function() return "" end, function(cl) cl:kill() end)
end
--- Create a new ontop button for a client.
-- @param c The client for which the button is wanted.
-- @staticfct awful.titlebar.widget.ontopbutton
-- @constructorfct awful.titlebar.widget.ontopbutton
function titlebar.widget.ontopbutton(c)
local widget = titlebar.widget.button(c, "ontop",
function(cl) return cl.ontop end,
@ -829,7 +829,7 @@ end
--- Create a new sticky button for a client.
-- @param c The client for which the button is wanted.
-- @staticfct awful.titlebar.widget.stickybutton
-- @constructorfct awful.titlebar.widget.stickybutton
function titlebar.widget.stickybutton(c)
local widget = titlebar.widget.button(c, "sticky",
function(cl) return cl.sticky end,

View File

@ -4,7 +4,7 @@ local awful = {tag = require("awful.tag"), layout = require("awful.layout") } --
screen[1]._resize {x = 0, width = 128, height = 96} --DOC_HIDE
function awful.spawn(_, args) --DOC_HIDE
function awful.spawn(_) --DOC_HIDE
local c = client.gen_fake{x = 10, y = 10, height=50, width=50} --DOC_HIDE
c:tags{screen[1].tags[1]} --DOC_HIDE
end --DOC_HIDE