From 84a9e54038a3b80a9bea1cddc4690715a635a5a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Lepage=20Vall=C3=A9e?= Date: Sun, 31 Dec 2023 14:38:05 -0800 Subject: [PATCH] Update lib/wibox/container/border.lua Co-authored-by: Aire-One --- lib/wibox/container/border.lua | 35 ++++++++++--------- lib/wibox/widget/imagebox.lua | 16 +++++---- .../container/border/border_merging1.lua | 2 +- 3 files changed, 30 insertions(+), 23 deletions(-) diff --git a/lib/wibox/container/border.lua b/lib/wibox/container/border.lua index b9ee6b5fe7..6a22a4a13f 100644 --- a/lib/wibox/container/border.lua +++ b/lib/wibox/container/border.lua @@ -8,8 +8,8 @@ -- symmetric on both axis. -- -- Note that because of legacy reasons, `wibox.container.background` also has --- good support for borders. If you only need simple shaped strokes, the, --- the `background` container is a much better choice. This module is better +-- good support for borders. If you only need simple shaped strokes, the +-- `background` container is a much better choice. This module is better -- suited for background images and border widgets. -- -- Advanced usage @@ -23,7 +23,7 @@ -- -- This example demonstrates how to use this module to create a client -- border with a top titlebar and borders. It does so by embedding a --- `wibox.container.border` into another `wibox.container.border. The outer +-- `wibox.container.border` into another `wibox.container.border`. The outer -- container acts as the border around the central area while the inner one -- spans the top area and contains the titlebar itself. The outer border -- widgets area can be used to implement border resize. @@ -82,7 +82,7 @@ local function fit_common(widget, ctx, max_w, max_h) end local function uses_slice(self) - return (self._private.border_widgets or self._private.border_image_widgets) == nil + return not (self._private.border_widgets or self._private.border_image_widgets) end local function get_widget(self, ctx, component) @@ -577,7 +577,7 @@ end --- The widget to display inside of the border. -- -- @property widget --- @tparam widget widget +-- @tparam[opt=nil] widget|nil widget module.set_widget = base.set_widget_common @@ -595,6 +595,7 @@ end --- Reset this layout. The widget will be removed and the rotation reset. -- @method reset +-- @noreturn -- @interface container function module:reset() self:set_widget(nil) @@ -605,7 +606,7 @@ end -- When using this property, the `borders` also **needs** to be specified. -- -- @property border_image --- @tparam string|gears.surface border_image +-- @tparam[opt=nil] string|image|nil border_image -- @see borders -- @see border_images @@ -671,7 +672,7 @@ end -- @DOC_wibox_container_border_stylesheet1_EXAMPLE@ -- -- @property border_image_stylesheet --- @tparam string border_image_stylesheet CSS data or file path. +-- @tparam[opt=""] string border_image_stylesheet CSS data or file path. -- @see wibox.widget.imagebox.stylesheet function module:set_border_image_stylesheet(value) @@ -713,15 +714,15 @@ end -- @DOC_wibox_container_border_border_images1_EXAMPLE@ -- -- @property border_images --- @tparam[opt=nil] table|gears.surface|nil border_images --- @tparam[opt=nil] string|gears.surface border_images.top_left --- @tparam[opt=nil] string|gears.surface border_images.top --- @tparam[opt=nil] string|gears.surface border_images.top_right --- @tparam[opt=nil] string|gears.surface border_images.right --- @tparam[opt=nil] string|gears.surface border_images.bottom_right --- @tparam[opt=nil] string|gears.surface border_images.bottom --- @tparam[opt=nil] string|gears.surface border_images.bottom_left --- @tparam[opt=nil] string|gears.surface border_images.left +-- @tparam[opt=nil] table|image|nil border_images +-- @tparam[opt=nil] string|image|nil border_images.top_left +-- @tparam[opt=nil] string|image|nil border_images.top +-- @tparam[opt=nil] string|image|nil border_images.top_right +-- @tparam[opt=nil] string|image|nil border_images.right +-- @tparam[opt=nil] string|image|nil border_images.bottom_right +-- @tparam[opt=nil] string|image|nil border_images.bottom +-- @tparam[opt=nil] string|image|nil border_images.bottom_left +-- @tparam[opt=nil] string|image|nil border_images.left -- @propemits true false -- @see border_image @@ -754,6 +755,7 @@ end -- @tparam[opt=0] number borders.left -- @tparam[opt=0] number borders.right -- @tparam[opt=0] number borders.bottom +-- @negativeallowed false function module:set_borders(value) @@ -920,6 +922,7 @@ end -- @property paddings -- @tparam[opt=0] number|table paddings -- @propemits true false +-- @negativeallowed false -- @see wibox.container.margin function module:set_paddings(value) diff --git a/lib/wibox/widget/imagebox.lua b/lib/wibox/widget/imagebox.lua index bed1887fd2..07b7bed485 100644 --- a/lib/wibox/widget/imagebox.lua +++ b/lib/wibox/widget/imagebox.lua @@ -370,6 +370,8 @@ end -- -- @property source_width -- @tparam number source_width +-- @propertydefault This depends on the source image. +-- @negativeallowed false -- @see image -- @see source_height @@ -381,6 +383,8 @@ end -- -- @property source_height -- @tparam number source_height +-- @propertydefault This depends on the source image. +-- @negativeallowed false -- @see image -- @see source_width @@ -642,9 +646,9 @@ end -- @propertyvalue "auto" Honor the `resize` variable and preserve the aspect ratio. -- @propertyvalue "none" Do not resize at all. -- @propertyvalue "fit" Resize to the widget width. --- @propertyvalue "repeat"` Repeat the image side by side. --- @propertyvalue "reflect"` Like `repeat`, but alternate the reflection. --- @propertyvalue "pad"` Take the last column of pixels and repeat them. +-- @propertyvalue "repeat" Repeat the image side by side. +-- @propertyvalue "reflect" Like `repeat`, but alternate the reflection. +-- @propertyvalue "pad" Take the last column of pixels and repeat them. -- @propemits true false -- @see vertical_fit_policy -- @see resize @@ -666,9 +670,9 @@ end -- @propertyvalue "none" Do not resize at all. -- @propertyvalue "fit" Resize to the widget height. -- @propertyvalue "fit" Resize to the widget width. --- @propertyvalue "repeat"` Repeat the image side by side. --- @propertyvalue "reflect"` Like `repeat`, but alternate the reflection. --- @propertyvalue "pad"` Take the last column of pixels and repeat them. +-- @propertyvalue "repeat" Repeat the image side by side. +-- @propertyvalue "reflect" Like `repeat`, but alternate the reflection. +-- @propertyvalue "pad" Take the last column of pixels and repeat them. -- @propemits true false -- @see horizontal_fit_policy -- @see resize diff --git a/tests/examples/wibox/container/border/border_merging1.lua b/tests/examples/wibox/container/border/border_merging1.lua index e9b9f1c9bc..de40772ebc 100644 --- a/tests/examples/wibox/container/border/border_merging1.lua +++ b/tests/examples/wibox/container/border/border_merging1.lua @@ -47,7 +47,7 @@ for _, side in ipairs { "top", "bottom", "left", "right" } do widget = wibox.widget.textbox }, border_merging = { - -- This is the equaivalent "left = true,". "side" is the loop + -- This is the equaivalent "side = true,". "side" is the loop -- variable. [side] = true },