doc(w.w.imagebox): Improve various bits

Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
This commit is contained in:
Lucas Schwiderski 2021-07-14 23:17:49 +02:00
parent 4096c19223
commit 8fab5aa703
No known key found for this signature in database
GPG Key ID: AA12679AAA6DF4D8
1 changed files with 48 additions and 42 deletions

View File

@ -1,20 +1,20 @@
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
-- A widget to display image. -- A widget to display an image.
-- --
-- The `wibox.widget.imagebox` is part of the Awesome WM's wiboxes system -- The `wibox.widget.imagebox` is part of the Awesome WM's widget system
-- (see @{03-declarative-layout.md}). -- (see @{03-declarative-layout.md}).
-- --
-- This widget displays an image. The image can be a file, -- This widget displays an image. The image can be a file,
-- a cairo image surface, or an rsvg handle object (see the -- a cairo image surface, or an rsvg handle object (see the
-- [image property](#image)). -- [image property](#image)).
-- --
-- Use a `wibox.widget.imagebox` -- Examples using a `wibox.widget.imagebox`:
-- --- -- ---
-- --
-- @DOC_wibox_widget_defaults_imagebox_EXAMPLE@ -- @DOC_wibox_widget_defaults_imagebox_EXAMPLE@
-- --
-- Alternatively, you can declare the `imagebox` widget using the -- Alternatively, you can declare the `imagebox` widget using the
-- declarative pattern (Both codes are strictly equivalent): -- declarative pattern (both variants are strictly equivalent):
-- --
-- @DOC_wibox_widget_declarative-pattern_imagebox_EXAMPLE@ -- @DOC_wibox_widget_declarative-pattern_imagebox_EXAMPLE@
-- --
@ -219,15 +219,14 @@ end
-- --
-- It can can be any of the following: -- It can can be any of the following:
-- --
-- * A `string` : Interpreted as the path to an image file, -- * A `string`: Interpreted as a path to an image file
-- * A cairo image surface : Directly used as is, -- * A cairo image surface: Directly used as-is
-- * An rsvg handle object : Directly used as is, -- * A librsvg handle object: Directly used as-is
-- * `nil`: Unset the image. -- * `nil`: Unset the image.
-- --
-- @property image -- @property image
-- @tparam image image The image to render. -- @tparam image image The image to render.
-- @propemits false false -- @propemits false false
-- @see set_image
--- Set the `imagebox` image. --- Set the `imagebox` image.
-- --
@ -281,8 +280,9 @@ function imagebox:set_image(image)
end end
--- Set a clip shape for this imagebox. --- Set a clip shape for this imagebox.
-- A clip shape define an area where the content is displayed and one where it --
-- is trimmed. -- A clip shape defines an area and dimension to which the content should be
-- trimmed.
-- --
-- @DOC_wibox_widget_imagebox_clip_shape_EXAMPLE@ -- @DOC_wibox_widget_imagebox_clip_shape_EXAMPLE@
-- --
@ -290,13 +290,13 @@ end
-- @tparam function|gears.shape clip_shape A `gears.shape` compatible shape function. -- @tparam function|gears.shape clip_shape A `gears.shape` compatible shape function.
-- @propemits true false -- @propemits true false
-- @see gears.shape -- @see gears.shape
-- @see set_clip_shape
--- Set a clip shape for this imagebox. --- Set a clip shape for this imagebox.
-- A clip shape define an area where the content is displayed and one where it
-- is trimmed.
-- --
-- Any other parameters will be passed to the clip shape function. -- A clip shape defines an area and dimensions to which the content should be
-- trimmed.
--
-- Additional parameters will be passed to the clip shape function.
-- --
-- @tparam function|gears.shape clip_shape A `gears_shape` compatible shape function. -- @tparam function|gears.shape clip_shape A `gears_shape` compatible shape function.
-- @method set_clip_shape -- @method set_clip_shape
@ -330,35 +330,38 @@ end
--- Set the horizontal fit policy. --- Set the horizontal fit policy.
-- --
-- Values are: -- Valid values are:
-- --
-- * **auto**: Honor the `resize` varible and preserve the aspect ratio (default). -- * `"auto"`: Honor the `resize` variable and preserve the aspect ratio.
-- * **none**: Do not resize at all. -- This is the default behaviour.
-- * **fit**: Resize to the widget width. -- * `"none"`: Do not resize at all.
-- * `"fit"`: Resize to the widget width.
-- --
-- Here is the result for a 22x32 image: -- Here is the result for a 22x32 image:
-- --
-- @DOC_wibox_widget_imagebox_horizontal_fit_policy_EXAMPLE@ -- @DOC_wibox_widget_imagebox_horizontal_fit_policy_EXAMPLE@
-- --
-- @property horizontal_fit_policy -- @property horizontal_fit_policy
-- @tparam[opt=auto] string horizontal_fit_policy -- @tparam[opt="auto"] string horizontal_fit_policy
-- @propemits true false -- @propemits true false
-- @see vertical_fit_policy -- @see vertical_fit_policy
-- @see resize -- @see resize
--- Set the vertical fit policy. --- Set the vertical fit policy.
-- Values are:
-- --
-- * **auto**: Honor the `resize` varible and preserve the aspect ratio (default). -- Valid values are:
-- * **none**: Do not resize at all. --
-- * **fit**: Resize to the widget height. -- * `"auto"`: Honor the `resize` varible and preserve the aspect ratio.
-- This is the default behaviour.
-- * `"none"`: Do not resize at all.
-- * `"fit"`: Resize to the widget height.
-- --
-- Here is the result for a 32x22 image: -- Here is the result for a 32x22 image:
-- --
-- @DOC_wibox_widget_imagebox_vertical_fit_policy_EXAMPLE@ -- @DOC_wibox_widget_imagebox_vertical_fit_policy_EXAMPLE@
-- --
-- @property vertical_fit_policy -- @property vertical_fit_policy
-- @tparam[opt=auto] string horizontal_fit_policy -- @tparam[opt="auto"] string horizontal_fit_policy
-- @propemits true false -- @propemits true false
-- @see horizontal_fit_policy -- @see horizontal_fit_policy
-- @see resize -- @see resize
@ -368,14 +371,14 @@ end
-- --
-- Possible values are: -- Possible values are:
-- --
-- * *top* -- * `"top"`
-- * *center* (default) -- * `"center"` (default)
-- * *bottom* -- * `"bottom"`
-- --
-- @DOC_wibox_widget_imagebox_valign_EXAMPLE@ -- @DOC_wibox_widget_imagebox_valign_EXAMPLE@
-- --
-- @property valign -- @property valign
-- @tparam string avlign -- @tparam[opt="center"] string valign
-- @propemits true false -- @propemits true false
-- @see wibox.container.place -- @see wibox.container.place
-- @see halign -- @see halign
@ -384,14 +387,14 @@ end
-- --
-- Possible values are: -- Possible values are:
-- --
-- * *left* -- * `"left"`
-- * *center* (default) -- * `"center"` (default)
-- * *right* -- * `"right"`
-- --
-- @DOC_wibox_widget_imagebox_halign_EXAMPLE@ -- @DOC_wibox_widget_imagebox_halign_EXAMPLE@
-- --
-- @property halign -- @property halign
-- @tparam string halign -- @tparam[opt="center"] string halign
-- @propemits true false -- @propemits true false
-- @see wibox.container.place -- @see wibox.container.place
-- @see valign -- @see valign
@ -399,8 +402,9 @@ end
--- The maximum scaling factor. --- The maximum scaling factor.
-- --
-- If an image is scaled too much, it gets very blurry. This -- If an image is scaled too much, it gets very blurry. This
-- property allows to limit the scaling. Use the `valign` and -- property allows to limit the scaling.
-- `halign` to control how the image will be aligned. -- Use the properties `valign` and `halign` to control how the image will be
-- aligned.
-- --
-- In the example below, the original size is 22x22 -- In the example below, the original size is 22x22
-- --
@ -432,13 +436,15 @@ end
-- <tr><td>bilinear</td><td>Linear interpolation in two dimensions</td></tr> -- <tr><td>bilinear</td><td>Linear interpolation in two dimensions</td></tr>
--</table> --</table>
-- --
-- The image used in the example below has a resolution of 32x22 and is intentionally -- The image used in the example below has a resolution of 32x22 and is
-- blocky to highlight the difference. It is zoomed by a factor of 3. -- intentionally blocky to highlight the difference.
-- It is zoomed by a factor of 3.
-- --
-- @DOC_wibox_widget_imagebox_scaling_quality_EXAMPLE@ -- @DOC_wibox_widget_imagebox_scaling_quality_EXAMPLE@
-- --
-- @property scaling_quality -- @property scaling_quality
-- @tparam string scaling_quality Either `fast`, `good`, `best`, `nearest` or `bilinear`. -- @tparam string scaling_quality Either `"fast"`, `"good"`, `"best"`,
-- `"nearest"` or `"bilinear"`.
-- @propemits true false -- @propemits true false
-- @see resize -- @see resize
-- @see horizontal_fit_policy -- @see horizontal_fit_policy