2021-07-14 22:32:48 +02:00
|
|
|
--- Set a widget at a specific index, replacing the current one.
|
2019-11-29 07:22:50 +01:00
|
|
|
--
|
2016-05-09 07:35:19 +02:00
|
|
|
-- @tparam number index A widget or a widget index
|
2021-07-14 22:32:48 +02:00
|
|
|
-- @tparam widget widget2 The widget to replace the previous one with
|
|
|
|
-- @treturn boolean Returns `true` if the widget was replaced successfully,
|
|
|
|
-- `false` otherwise.
|
2019-06-06 22:32:53 +02:00
|
|
|
-- @method set
|
2019-11-29 07:22:50 +01:00
|
|
|
-- @emits widget::replaced
|
|
|
|
-- @emitstparam widget::replaced widget self The layout.
|
2021-07-14 22:32:48 +02:00
|
|
|
-- @emitstparam widget::replaced widget widget The inserted widget.
|
2019-11-29 07:22:50 +01:00
|
|
|
-- @emitstparam widget::replaced widget previous The previous widget.
|
|
|
|
-- @emitstparam widget::replaced number index The replaced index.
|
|
|
|
-- @interface layout
|
2016-05-09 07:35:19 +02:00
|
|
|
|
2016-08-08 08:39:43 +02:00
|
|
|
--- Replace the first instance of `widget` in the layout with `widget2`.
|
2019-11-29 07:22:50 +01:00
|
|
|
--
|
|
|
|
-- @tparam widget widget The widget to replace
|
|
|
|
-- @tparam widget widget2 The widget to replace `widget` with
|
2021-07-14 22:32:48 +02:00
|
|
|
-- @tparam[opt=false] boolean recursive Recurse into all compatible layouts to
|
|
|
|
-- find the widget.
|
|
|
|
-- @treturn boolean Returns `true` if the widget was replaced successfully,
|
|
|
|
-- `false` otherwise.
|
2019-06-06 22:32:53 +02:00
|
|
|
-- @method replace_widget
|
2019-11-29 07:22:50 +01:00
|
|
|
-- @emits widget::replaced
|
|
|
|
-- @emitstparam widget::replaced widget self The layout.
|
|
|
|
-- @emitstparam widget::replaced widget widget index The inserted widget.
|
|
|
|
-- @emitstparam widget::replaced widget previous The previous widget.
|
|
|
|
-- @emitstparam widget::replaced number index The replaced index.
|
|
|
|
-- @interface layout
|
2016-05-09 07:35:19 +02:00
|
|
|
|
2016-08-08 08:39:43 +02:00
|
|
|
--- Swap 2 widgets in a layout.
|
2019-11-29 07:22:50 +01:00
|
|
|
--
|
2016-05-09 07:35:19 +02:00
|
|
|
-- @tparam number index1 The first widget index
|
|
|
|
-- @tparam number index2 The second widget index
|
2021-07-14 22:32:48 +02:00
|
|
|
-- @treturn boolean Returns `true` if the widget was replaced successfully,
|
|
|
|
-- `false` otherwise.
|
2019-06-06 22:32:53 +02:00
|
|
|
-- @method swap
|
2019-11-29 07:22:50 +01:00
|
|
|
-- @emits widget::swapped
|
|
|
|
-- @emitstparam widget::swapped widget self The layout.
|
2021-07-14 22:32:48 +02:00
|
|
|
-- @emitstparam widget::swapped widget widget1 The first widget.
|
|
|
|
-- @emitstparam widget::swapped widget widget2 The second widget.
|
2019-11-29 07:22:50 +01:00
|
|
|
-- @emitstparam widget::swapped number index1 The first index.
|
|
|
|
-- @emitstparam widget::swapped number index1 The second index.
|
|
|
|
-- @interface layout
|
2016-05-09 07:35:19 +02:00
|
|
|
|
2016-08-08 08:39:43 +02:00
|
|
|
--- Swap 2 widgets in a layout.
|
2021-07-14 22:32:48 +02:00
|
|
|
--
|
|
|
|
-- If `widget1` is present multiple time, only the first instance is swapped.
|
|
|
|
--
|
|
|
|
-- Calls `set` internally, so the signal `widget::replaced` is emitted for both
|
|
|
|
-- widgets as well.
|
|
|
|
--
|
2019-11-29 07:22:50 +01:00
|
|
|
-- @tparam widget widget1 The first widget
|
|
|
|
-- @tparam widget widget2 The second widget
|
2021-07-14 22:32:48 +02:00
|
|
|
-- @tparam[opt=false] boolean recursive Recurse into all compatible layouts to
|
|
|
|
-- find the widget.
|
|
|
|
-- @treturn boolean Returns `true` if the widget was replaced successfully,
|
|
|
|
-- `false` otherwise.
|
2019-06-06 22:32:53 +02:00
|
|
|
-- @method swap_widgets
|
2019-11-29 07:22:50 +01:00
|
|
|
-- @emits widget::swapped
|
|
|
|
-- @emitstparam widget::swapped widget self The layout.
|
2021-07-14 22:32:48 +02:00
|
|
|
-- @emitstparam widget::swapped widget widget1 The first widget.
|
|
|
|
-- @emitstparam widget::swapped widget widget2 The second widget.
|
2019-11-29 07:22:50 +01:00
|
|
|
-- @emitstparam widget::swapped number index1 The first index.
|
|
|
|
-- @emitstparam widget::swapped number index1 The second index.
|
|
|
|
-- @interface layout
|
2021-07-14 22:32:48 +02:00
|
|
|
-- @see set
|
2016-05-09 07:35:19 +02:00
|
|
|
|
2021-04-01 15:17:03 +02:00
|
|
|
--- Reset the layout. This removes all widgets from the layout.
|
2019-06-06 22:32:53 +02:00
|
|
|
-- @method reset
|
2022-07-05 10:37:14 +02:00
|
|
|
-- @noreturn
|
2019-11-29 07:22:50 +01:00
|
|
|
-- @emits widget::reset
|
|
|
|
-- @emitstparam widget::reset widget self The layout.
|
|
|
|
-- @interface layout
|
2021-07-14 22:32:48 +02:00
|
|
|
|
|
|
|
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|