Merge pull request #3509 from Aire-One/fix/3508

[doc] Small improvements on the client's icons documentation
This commit is contained in:
Emmanuel Lepage Vallée 2021-11-21 12:01:39 -08:00 committed by GitHub
commit e7a21947e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 19 additions and 0 deletions

View File

@ -656,6 +656,10 @@ lua_class_t client_class;
* cr:set_source_surface(s, 0, 0) * cr:set_source_surface(s, 0, 0)
* cr:paint() * cr:paint()
* *
* (Note that `awesome.set_preferred_icon_size` defaults to `0` if it wasn't
* set. It means that, by default, the preferred icon provided will be the
* smallest available)
*
* @property icon * @property icon
* @tparam surface icon * @tparam surface icon
* @propemits false false * @propemits false false
@ -4313,11 +4317,26 @@ luaA_client_get_icon_sizes(lua_State *L, client_t *c)
} }
/** Get the client's n-th icon. /** Get the client's n-th icon.
*
* The icon index can be deternined by inspecting the `icon_sizes` property first.
*
* The user has the responsibility to test the value returned by this function
* to ensure an icon have been returned.
*
* It is recommended to use the `awful.widget.clienticon` widget when the
* client icon is used in a widget structure.
*
* Note that this function tests the provided index and raise an "invalid icon
* index" error if the provided index doesn't exist in the client's icons list
* (by raising an error, the function will be stopped and nothing will be
* returned to the caller).
* *
* @tparam interger index The index in the list of icons to get. * @tparam interger index The index in the list of icons to get.
* @treturn surface A lightuserdata for a cairo surface. This reference must be * @treturn surface A lightuserdata for a cairo surface. This reference must be
* destroyed! * destroyed!
* @method get_icon * @method get_icon
* @see icon_sizes
* @see awful.widget.clienticon
*/ */
static int static int
luaA_client_get_some_icon(lua_State *L) luaA_client_get_some_icon(lua_State *L)