diff --git a/docs/89-NEWS.md b/docs/89-NEWS.md
index a7e5af538..78c78cea7 100644
--- a/docs/89-NEWS.md
+++ b/docs/89-NEWS.md
@@ -89,6 +89,9 @@ This document was last updated at commit v4.3-197-g9085ed631.
* Pango 1.44 is now the oldest recommended Pango version. Older versions are
still supported, but will lack the ability to use some textbox properties,
mainly `wibox.widget.textbox.line_spacing_factor`.
+ * The `wibox.layout.grid` layout `expand`, `spacing` and `homogeneous`
+ property getters now return a table instead of a number. The table contains
+ a `horizontal` and a `vertical` key.
# Awesome window manager framework version 4.3 changes
diff --git a/lib/wibox/layout/grid.lua b/lib/wibox/layout/grid.lua
index 7fb9d8046..7241a3430 100644
--- a/lib/wibox/layout/grid.lua
+++ b/lib/wibox/layout/grid.lua
@@ -32,16 +32,16 @@ local math = math
local gtable = require("gears.table")
local gmath = require("gears.math")
local gcolor = require("gears.color")
+local gdebug = require("gears.debug")
local base = require("wibox.widget.base")
local cairo = require("lgi").cairo
local grid = { mt = {} }
local properties = {
- "orientation", "superpose",
- "forced_num_rows", "forced_num_cols",
- "min_cols_size", "min_rows_size",
- }
+ "orientation", "superpose",
+ "forced_row_count", "forced_column_count",
+}
local dir_properties = { "spacing", "homogeneous", "expand" }
@@ -70,7 +70,10 @@ local dir_properties = { "spacing", "homogeneous", "expand" }
-- @property superpose
--- Force the number of rows of the layout.
--- @property forced_num_rows
+--
+-- Deprecated, use `row_count`.
+--
+-- @deprecatedproperty forced_num_rows
-- @tparam[opt=nil] number|nil forced_num_rows
-- @propertytype nil Automatically determine the number of rows.
-- @propertyunit rows
@@ -79,7 +82,10 @@ local dir_properties = { "spacing", "homogeneous", "expand" }
-- @see row_count
--- Force the number of columns of the layout.
--- @property forced_num_cols
+--
+-- Deprecated, use `column_count`.
+--
+-- @deprecatedproperty forced_num_cols
-- @tparam[opt=nil] number|nil forced_num_cols
-- @propertytype nil Automatically determine the number of columns.'
-- @propertyunit columns
@@ -90,23 +96,46 @@ local dir_properties = { "spacing", "homogeneous", "expand" }
--- Set the minimum size for the columns.
--
--@DOC_wibox_layout_grid_min_size_EXAMPLE@
--- @tparam[opt=0] number min_cols_size Minimum size of the columns.
--- @property min_cols_size
+-- @tparam[opt=0] number minimum_column_width Minimum size of the columns.
+-- @property minimum_column_width
-- @propertyunit pixel
-- @negativeallowed false
--- @see min_rows_size
+-- @see minimum_row_height
+
+--- Set the minimum size for the columns.
+--
+-- Deprecated, use `minimum_column_width`.
+--
+--@DOC_wibox_layout_grid_min_size_EXAMPLE@
+-- @tparam[opt=0] number min_cols_size Minimum size of the columns.
+-- @deprecatedproperty min_cols_size
+-- @propertyunit pixel
+-- @negativeallowed false
+-- @see minimum_row_height
--- Set the minimum size for the rows.
+-- @tparam[opt=0] number minimum_row_height Minimum size of the rows.
+-- @property minimum_row_height
+-- @propertyunit pixel
+-- @negativeallowed false
+-- @see min_cols_size
+
+--- Set the minimum size for the rows.
+--
+-- Deprecated, use `minimum_row_height`.
+--
-- @tparam[opt=0] number min_rows_size Minimum size of the rows.
--- @property min_rows_size
+-- @deprecatedproperty min_rows_size
-- @propertyunit pixel
-- @negativeallowed false
-- @see min_cols_size
--- The spacing between columns.
--
+-- Deprecated, use `spacing`.
+--
-- @tparam[opt=0] number horizontal_spacing
--- @property horizontal_spacing
+-- @deprecatedproperty horizontal_spacing
-- @propertyunit pixel
-- @negativeallowed false
-- @see spacing
@@ -114,8 +143,10 @@ local dir_properties = { "spacing", "homogeneous", "expand" }
--- The spacing between rows.
--
+-- Deprecated, use `spacing`.
+--
-- @tparam[opt=0] number vertical_spacing
--- @property vertical_spacing
+-- @deprecatedproperty vertical_spacing
-- @propertyunit pixel
-- @negativeallowed false
-- @see spacing
@@ -133,23 +164,34 @@ local dir_properties = { "spacing", "homogeneous", "expand" }
--
-- @DOC_wibox_layout_grid_border_width3_EXAMPLE@
--
--- @tparam[opt=0] number spacing
-- @property spacing
+-- @tparam[opt=0] number|table spacing
+-- @tparam number spacing.vertical The vertical spacing.
+-- @tparam number spacing.horizontal The horizontal spacing.
+-- @propertytype number The same value for the `"vertical"` and `"horizontal"`
+-- aspects.
+-- @propertytype table Different values for the `"vertical"` and `"horizontal"`
+-- aspects.
+-- @propertyunit pixel
-- @negativeallowed false
-- @see vertical_spacing
-- @see horizontal_spacing
--- Controls if the columns are expanded to use all the available width.
--
+-- Deprecated, use `expand`.
+--
-- @tparam[opt=false] boolean horizontal_expand Expand the grid into the available space
--- @property horizontal_expand
+-- @deprecatedproperty horizontal_expand
-- @see expand
-- @see vertical_expand
--- Controls if the rows are expanded to use all the available height.
--
+-- Deprecated, use `expand`.
+--
-- @tparam[opt=false] boolean vertical_expand Expand the grid into the available space
--- @property vertical_expand
+-- @deprecatedproperty vertical_expand
-- @see expand
-- @see horizontal_expand
@@ -159,28 +201,34 @@ local dir_properties = { "spacing", "homogeneous", "expand" }
-- preferred `orientation`.
--
--@DOC_wibox_layout_grid_expand_EXAMPLE@
--- @tparam[opt=false] boolean expand Expand the grid into the available space
-- @property expand
+-- @tparam[opt=false] boolean|table expand Expand the grid into the available space
+-- @tparam boolean expand.vertical The vertical expand.
+-- @tparam boolean expand.horizontal The horizontal expand.
+-- @propertytype number The same value for the `"vertical"` and `"horizontal"`
+-- aspects.
+-- @propertytype table Different values for the `"vertical"` and `"horizontal"`
+-- aspects.
-- @see horizontal_expand
-- @see vertical_expand
--- Controls if the columns all have the same width or if the width of each
-- column depends on the content.
--
--- see `homogeneous`
+-- Deprecated, use `homogeneous`
--
-- @tparam[opt=true] boolean horizontal_homogeneous All the columns have the same width.
--- @property horizontal_homogeneous
+-- @deprecatedproperty horizontal_homogeneous
-- @see vertical_homogeneous
-- @see homogeneous
--- Controls if the rows all have the same height or if the height of each row
-- depends on the content.
--
--- see `homogeneous`
+-- Deprecated, use `homogeneous`
--
-- @tparam[opt=true] boolean vertical_homogeneous All the rows have the same height.
--- @property vertical_homogeneous
+-- @deprecatedproperty vertical_homogeneous
-- @see homogeneous
-- @see horizontal_homogeneous
@@ -191,29 +239,37 @@ local dir_properties = { "spacing", "homogeneous", "expand" }
-- by the preferred `orientation`.
--
--@DOC_wibox_layout_grid_expand_EXAMPLE@
--- @tparam[opt=true] boolean homogeneous All the columns/rows have the same size.
-- @property homogeneous
+-- @tparam[opt=true] boolean|table homogeneous All the columns/rows have the same size.
+-- @tparam boolean homogeneous.vertical The vertical homogeneous value.
+-- @tparam boolean homogeneous.horizontal The horizontal homogeneous value.
+-- @propertytype number The same value for the `"vertical"` and `"horizontal"`
+-- aspects.
+-- @propertytype table Different values for the `"vertical"` and `"horizontal"`
+-- aspects.
-- @see vertical_homogeneous
-- @see horizontal_homogeneous
--- The number of rows.
--
--- If `forced_num_rows` is set, then its value is returned, otherwise it will
--- return the maximum actual number of widgets in a row.
+-- Unless manually set, the value will be automatically determined base on the
+-- `orientation`.
--
-- @property row_count
-- @tparam integer row_count
--- @readonly
+-- @negativeallowed false
+-- @propertydefault autogenerated
-- @see forced_num_rows
--- The number of columns.
--
--- If `forced_num_cols` is set, then its value is returned, otherwise it will
--- return the maximum actual number of widgets in a column.
+-- Unless manually set, the value will be automatically determined base on the
+-- `orientation`.
--
-- @property column_count
--- @readonly
-- @tparam integer column_count
+-- @negativeallowed false
+-- @propertydefault autogenerated
-- @see forced_num_cols
--- Child widget position. Return of `get_widget_position`.
@@ -286,8 +342,10 @@ local function find_widget(widgets_table, widget)
end
--- Get the number of rows and columns occupied by the widgets in the grid.
--- @method get_dimension
+-- @deprecatedmethod get_dimension
-- @treturn number,number The number of rows and columns
+-- @see row_count
+-- @see column_count
function grid:get_dimension()
return self._private.num_rows, self._private.num_cols
end
@@ -377,9 +435,11 @@ end
--- Add a widget to the grid layout at specific coordinate.
--
+-- You can now use `:add {row_index = 1, col_index = 1}` instead of this method.
+--
--@DOC_wibox_layout_grid_add_EXAMPLE@
--
--- @method add_widget_at
+-- @deprecatedmethod add_widget_at
-- @tparam wibox.widget child Widget that should be added
-- @tparam number row Row number for the top left corner of the widget
-- @tparam number col Column number for the top left corner of the widget
@@ -810,30 +870,98 @@ function grid:set_min_rows_size(val)
end
end
--- Force the number of columns of the layout.
function grid:set_forced_num_cols(val)
+ gdebug.deprecate(
+ "The `.column_count = "..tostring(val).."`.",
+ {deprecated_in=5}
+ )
+ self:set_column_count(val)
+end
+
+function grid:set_forced_num_rows(val)
+ gdebug.deprecate(
+ "The `row_count = "..tostring(val).."`.",
+ {deprecated_in=5}
+ )
+ self:set_row_count(val)
+end
+
+-- Force the number of columns of the layout.
+function grid:set_column_count(val)
if self._private.forced_num_cols ~= val then
self._private.forced_num_cols = val
update_dimension(self)
+ self:emit_signal("property::column_count", val)
self:emit_signal("widget::layout_changed")
end
end
-- Force the number of rows of the layout.
-function grid:set_forced_num_rows(val)
+function grid:set_row_count(val)
if self._private.forced_num_rows ~= val then
self._private.forced_num_rows = val
update_dimension(self)
+ self:emit_signal("property::row_count", val)
self:emit_signal("widget::layout_changed")
end
end
function grid:get_row_count()
- return self._private.num_rows
+ return self._private.forced_num_rows or self._private.num_rows
end
function grid:get_column_count()
- return self._private.num_cols
+ return self._private.forced_num_cols or self._private.num_cols
+end
+
+function grid:set_minimum_column_width(val)
+ if self._private.min_cols_size ~= val then
+ self._private.min_cols_size = val
+ update_dimension(self)
+ self:emit_signal("property::minimum_column_width", val)
+ self:emit_signal("widget::layout_changed")
+ end
+end
+
+function grid:set_minimum_row_height(val)
+ if self._private.min_rows_size ~= val then
+ self._private.min_rows_size = val
+ update_dimension(self)
+ self:emit_signal("property::minimum_column_width", val)
+ self:emit_signal("widget::layout_changed")
+ end
+end
+
+function grid:set_min_cols_size(val)
+ gdebug.deprecate(
+ "The `.minimum_column_width = "..tostring(val).."`.",
+ {deprecated_in=5}
+ )
+ self:set_minimum_column_width(val)
+end
+
+function grid:set_min_rows_size(val)
+ gdebug.deprecate(
+ "The `.minimum_column_width = "..tostring(val).."`.",
+ {deprecated_in=5}
+ )
+ self:set_minimum_row_height(val)
+end
+
+function grid:get_minimum_column_width()
+ return self._private.min_cols_size
+end
+
+function grid:get_minimum_row_height()
+ return self._private.min_rows_size
+end
+
+function grid:get_min_cols_size()
+ return self._private.min_cols_size
+end
+
+function grid:get_min_rows_size()
+ return self._private.min_rows_size
end
function grid:set_border_width(val)
@@ -906,6 +1034,7 @@ for _, prop in ipairs(properties) do
grid["set_"..prop] = function(self, value)
if self._private[prop] ~= value then
self._private[prop] = value
+ self:emit_signal("property::"..prop, value)
self:emit_signal("widget::layout_changed")
end
end
@@ -927,26 +1056,46 @@ for _, prop in ipairs(dir_properties) do
for _,dir in ipairs{"horizontal", "vertical"} do
local dir_prop = dir .. "_" .. prop
grid["set_"..dir_prop] = function(self, value)
+ gdebug.deprecate(
+ "The `".. dir_prop .."` property is deprecated. Use `".. prop .."`",
+ {deprecated_in=5}
+ )
if self._private[dir_prop] ~= value then
self._private[dir_prop] = value
self:emit_signal("widget::layout_changed")
end
end
grid["get_"..dir_prop] = function(self)
+ gdebug.deprecate(
+ "The `".. dir_prop .."` property is deprecated. Use `".. prop .."`",
+ {deprecated_in=5}
+ )
return self._private[dir_prop]
end
end
- -- Non-directional options
grid["set_"..prop] = function(self, value)
- if self._private["horizontal_"..prop] ~= value or self._private["vertical_"..prop] ~= value then
- self._private["horizontal_"..prop] = value
- self._private["vertical_"..prop] = value
+ if type(value) ~= "table" then
+ if self._private["horizontal_"..prop] ~= value
+ or self._private["vertical_"..prop] ~= value then
+ self._private["horizontal_"..prop] = value
+ self._private["vertical_"..prop] = value
+ self:emit_signal("property::"..prop, value)
+ self:emit_signal("widget::layout_changed")
+ end
+ else
+ self._private["horizontal_"..prop] = value.horizontal
+ self._private["vertical_"..prop] = value.vertical
+
+ self:emit_signal("property::"..prop, value)
self:emit_signal("widget::layout_changed")
end
end
grid["get_"..prop] = function(self)
- return self._private[self._private.orientation .. "_" .. prop]
+ return {
+ vertical = self._private["vertical_" .. prop],
+ horizontal = self._private["horizontal_" .. prop],
+ }
end
end
diff --git a/tests/examples/awful/popup/alttab.lua b/tests/examples/awful/popup/alttab.lua
index d56c17418..e6d3b82ab 100644
--- a/tests/examples/awful/popup/alttab.lua
+++ b/tests/examples/awful/popup/alttab.lua
@@ -27,7 +27,7 @@ local tasklist_buttons = nil --DOC_HIDE
},
layout = {
spacing = 5,
- forced_num_rows = 2,
+ row_count = 2,
layout = wibox.layout.grid.horizontal
},
diff --git a/tests/examples/awful/popup/wiboxtypes.lua b/tests/examples/awful/popup/wiboxtypes.lua
index 4c0777b5f..22bbc5262 100644
--- a/tests/examples/awful/popup/wiboxtypes.lua
+++ b/tests/examples/awful/popup/wiboxtypes.lua
@@ -107,9 +107,9 @@ awful.popup {
filter = awful.widget.layoutlist.source.for_screen,
screen = 1,
base_layout = wibox.widget {
- spacing = 5,
- forced_num_cols = 5,
- layout = wibox.layout.grid.vertical,
+ spacing = 5,
+ column_count = 5,
+ layout = wibox.layout.grid.vertical,
},
widget_template = {
{
diff --git a/tests/examples/awful/screenshot/popup.lua b/tests/examples/awful/screenshot/popup.lua
index 3896c4085..c075d0ff0 100644
--- a/tests/examples/awful/screenshot/popup.lua
+++ b/tests/examples/awful/screenshot/popup.lua
@@ -98,9 +98,9 @@ gen_client("C2")
align = "center"
},
layout = {
- spacing = 5,
- forced_num_rows = 1,
- layout = wibox.layout.grid.horizontal
+ spacing = 5,
+ row_count = 1,
+ layout = wibox.layout.grid.horizontal
},
widget_template = {
{
diff --git a/tests/examples/awful/widget/layoutlist/bar.lua b/tests/examples/awful/widget/layoutlist/bar.lua
index a3bb6ffcd..0b37190d0 100644
--- a/tests/examples/awful/widget/layoutlist/bar.lua
+++ b/tests/examples/awful/widget/layoutlist/bar.lua
@@ -24,9 +24,9 @@ local beautiful = require("beautiful") --DOC_HIDE
source = awful.widget.layoutlist.source.default_layouts,
screen = 1,
base_layout = wibox.widget {
- spacing = 5,
- forced_num_cols = 3,
- layout = wibox.layout.grid.vertical,
+ spacing = 5,
+ column_count = 3,
+ layout = wibox.layout.grid.vertical,
},
widget_template = {
{
diff --git a/tests/examples/awful/widget/layoutlist/popup.lua b/tests/examples/awful/widget/layoutlist/popup.lua
index 8eddca029..695248e5f 100644
--- a/tests/examples/awful/widget/layoutlist/popup.lua
+++ b/tests/examples/awful/widget/layoutlist/popup.lua
@@ -12,9 +12,9 @@ local modkey = "mod4" --DOC_HIDE
local ll = awful.widget.layoutlist {
source = awful.widget.layoutlist.source.default_layouts, --DOC_HIDE
base_layout = wibox.widget {
- spacing = 5,
- forced_num_cols = 5,
- layout = wibox.layout.grid.vertical,
+ spacing = 5,
+ column_count = 5,
+ layout = wibox.layout.grid.vertical,
},
widget_template = {
{
diff --git a/tests/examples/sequences/client/tasklist_layout1.lua b/tests/examples/sequences/client/tasklist_layout1.lua
index 5619de919..9cf7f1f54 100644
--- a/tests/examples/sequences/client/tasklist_layout1.lua
+++ b/tests/examples/sequences/client/tasklist_layout1.lua
@@ -42,11 +42,11 @@ local s = screen[1]
--DOC_NEWLINE
if count > 5 and not self.is_grid then
self.base_layout = wibox.widget {
- forced_num_rows = 2,
- homogeneous = true,
- expand = true,
- spacing = 2,
- layout = wibox.layout.grid.horizontal
+ row_count = 2,
+ homogeneous = true,
+ expand = true,
+ spacing = 2,
+ layout = wibox.layout.grid.horizontal
}
--DOC_NEWLINE
self.is_grid = true
diff --git a/tests/examples/wibox/layout/defaults/grid.lua b/tests/examples/wibox/layout/defaults/grid.lua
index 1e3813434..9d4f6429a 100644
--- a/tests/examples/wibox/layout/defaults/grid.lua
+++ b/tests/examples/wibox/layout/defaults/grid.lua
@@ -8,10 +8,10 @@ wibox.widget {
generic_widget( "second" ),
generic_widget( "third" ),
generic_widget( "fourth" ),
- forced_num_cols = 2,
- forced_num_rows = 2,
- homogeneous = true,
- expand = true,
- layout = wibox.layout.grid
+ column_count = 2,
+ row_count = 2,
+ homogeneous = true,
+ expand = true,
+ layout = wibox.layout.grid
}
, nil, 60 --DOC_HIDE
diff --git a/tests/examples/wibox/layout/grid/add.lua b/tests/examples/wibox/layout/grid/add.lua
index 216eeae6b..ccafe4167 100644
--- a/tests/examples/wibox/layout/grid/add.lua
+++ b/tests/examples/wibox/layout/grid/add.lua
@@ -6,9 +6,9 @@ local beautiful = require("beautiful") --DOC_HIDE
print("l:add_widget_at(new, 1, 4, 1, 1)") --DOC_HIDE
local w = generic_before_after(wibox.layout.grid, {
- forced_num_cols = 3,
- forced_num_rows = 2,
- homogeneous = true,
+ column_count = 3,
+ row_count = 2,
+ homogeneous = true,
}, 6, "add_widget_at", {--DOC_HIDE
generic_widget("__new__",beautiful.bg_highlight) --DOC_HIDE
, 1, 4, 1, 1 --DOC_HIDE
diff --git a/tests/examples/wibox/layout/grid/add_column_border1.lua b/tests/examples/wibox/layout/grid/add_column_border1.lua
index 4f25d47dc..ab07088db 100644
--- a/tests/examples/wibox/layout/grid/add_column_border1.lua
+++ b/tests/examples/wibox/layout/grid/add_column_border1.lua
@@ -65,13 +65,13 @@ end
widget = generic_widget
},
--DOC_HIDE_END
- homogeneous = true,
- spacing = 0,
- border_width = 4,
- border_color = beautiful.border_color,
- min_cols_size = 10,
- min_rows_size = 10,
- layout = wibox.layout.grid,
+ homogeneous = true,
+ spacing = 0,
+ border_width = 4,
+ border_color = beautiful.border_color,
+ minimum_column_width = 10,
+ minimum_row_height = 10,
+ layout = wibox.layout.grid,
}
--DOC_NEWLINE
diff --git a/tests/examples/wibox/layout/grid/add_row_border1.lua b/tests/examples/wibox/layout/grid/add_row_border1.lua
index 17ea6d8fe..c00a9e6ec 100644
--- a/tests/examples/wibox/layout/grid/add_row_border1.lua
+++ b/tests/examples/wibox/layout/grid/add_row_border1.lua
@@ -65,13 +65,13 @@ end
widget = generic_widget
},
--DOC_HIDE_END
- homogeneous = true,
- spacing = 0,
- border_width = 4,
- border_color = beautiful.border_color,
- min_cols_size = 10,
- min_rows_size = 10,
- layout = wibox.layout.grid,
+ homogeneous = true,
+ spacing = 0,
+ border_width = 4,
+ border_color = beautiful.border_color,
+ minimum_column_width = 10,
+ minimum_row_height = 10,
+ layout = wibox.layout.grid,
}
--DOC_NEWLINE
diff --git a/tests/examples/wibox/layout/grid/border_width1.lua b/tests/examples/wibox/layout/grid/border_width1.lua
index 85d75958c..4466454be 100644
--- a/tests/examples/wibox/layout/grid/border_width1.lua
+++ b/tests/examples/wibox/layout/grid/border_width1.lua
@@ -33,11 +33,11 @@ end
generic_widget( "fourth" ),
generic_widget( "fifth" ),
generic_widget( "sixth" ),
- forced_num_cols = 2,
- forced_num_rows = 2,
- homogeneous = homogeneous,
- spacing = 10,
- border_width = {
+ column_count = 2,
+ row_count = 2,
+ homogeneous = homogeneous,
+ spacing = 10,
+ border_width = {
inner = width,
outer = 1.5 * width,
},
diff --git a/tests/examples/wibox/layout/grid/border_width2.lua b/tests/examples/wibox/layout/grid/border_width2.lua
index 01a63b93b..672ab2484 100644
--- a/tests/examples/wibox/layout/grid/border_width2.lua
+++ b/tests/examples/wibox/layout/grid/border_width2.lua
@@ -65,13 +65,13 @@ end
widget = generic_widget
},
--DOC_HIDE_END
- homogeneous = true,
- spacing = 0,
- border_width = 4,
- border_color = beautiful.border_color,
- min_cols_size = 10,
- min_rows_size = 10,
- layout = wibox.layout.grid,
+ homogeneous = true,
+ spacing = 0,
+ border_width = 4,
+ border_color = beautiful.border_color,
+ minimum_column_width = 10,
+ minimum_row_height = 10,
+ layout = wibox.layout.grid,
}
--DOC_NEWLINE
diff --git a/tests/examples/wibox/layout/grid/border_width3.lua b/tests/examples/wibox/layout/grid/border_width3.lua
index e542c424a..d7bf41a92 100644
--- a/tests/examples/wibox/layout/grid/border_width3.lua
+++ b/tests/examples/wibox/layout/grid/border_width3.lua
@@ -18,13 +18,13 @@ end
generic_widget( "second" ),
generic_widget( "third" ),
generic_widget( "fourth" ),
- forced_num_cols = 2,
- forced_num_rows = 2,
- homogeneous = true,
- spacing = width,
- border_width = 1,
- border_color = "red",
- layout = wibox.layout.grid,
+ column_count = 2,
+ row_count = 2,
+ homogeneous = true,
+ spacing = width,
+ border_width = 1,
+ border_color = "red",
+ layout = wibox.layout.grid,
}
--DOC_HIDE_START
diff --git a/tests/examples/wibox/layout/grid/border_width4.lua b/tests/examples/wibox/layout/grid/border_width4.lua
index eda7d93f6..d65be982f 100644
--- a/tests/examples/wibox/layout/grid/border_width4.lua
+++ b/tests/examples/wibox/layout/grid/border_width4.lua
@@ -19,15 +19,15 @@ end
generic_widget( "second" ),
generic_widget( "third" ),
generic_widget( "fourth" ),
- forced_num_cols = 2,
- forced_num_rows = 2,
- homogeneous = true,
- spacing = 10,
- border_width = {
+ column_count = 2,
+ row_count = 2,
+ homogeneous = true,
+ spacing = 10,
+ border_width = {
inner = width,
outer = 10 - width,
},
- border_color = {
+ border_color = {
inner = gears.color {
type = "linear",
from = { 0 , 0 },
@@ -47,7 +47,7 @@ end
}
},
},
- layout = wibox.layout.grid,
+ layout = wibox.layout.grid,
}
--DOC_HIDE_START
diff --git a/tests/examples/wibox/layout/grid/declarative1.lua b/tests/examples/wibox/layout/grid/declarative1.lua
index 2fe011177..ef6306f8f 100644
--- a/tests/examples/wibox/layout/grid/declarative1.lua
+++ b/tests/examples/wibox/layout/grid/declarative1.lua
@@ -52,13 +52,13 @@ local beautiful = require("beautiful")
col_span = 2,
widget = generic_widget
},
- homogeneous = true,
- spacing = 5,
- border_width = 1,
- border_color = beautiful.border_color,
- min_cols_size = 10,
- min_rows_size = 10,
- layout = wibox.layout.grid,
+ homogeneous = true,
+ spacing = 5,
+ border_width = 1,
+ border_color = beautiful.border_color,
+ minimum_column_width = 10,
+ minimum_row_height = 10,
+ layout = wibox.layout.grid,
}
return l, l:fit({dpi=96}, 400, 200) --DOC_HIDE
diff --git a/tests/examples/wibox/layout/grid/declarative2.lua b/tests/examples/wibox/layout/grid/declarative2.lua
index 4e9a11dea..d652db7c9 100644
--- a/tests/examples/wibox/layout/grid/declarative2.lua
+++ b/tests/examples/wibox/layout/grid/declarative2.lua
@@ -8,11 +8,11 @@ local wibox = require("wibox") --DOC_HIDE
generic_widget("third"),
generic_widget("fourth"),
generic_widget("fifth"),
- forced_num_cols = 2,
- spacing = 5,
- min_cols_size = 10,
- min_rows_size = 10,
- layout = wibox.layout.grid,
+ column_count = 2,
+ spacing = 5,
+ minimum_column_width = 10,
+ minimum_row_height = 10,
+ layout = wibox.layout.grid,
}
return l, l:fit({dpi=96}, 300, 200) --DOC_HIDE
diff --git a/tests/examples/wibox/layout/grid/expand.lua b/tests/examples/wibox/layout/grid/expand.lua
index c83e8995f..d18f7cd0d 100644
--- a/tests/examples/wibox/layout/grid/expand.lua
+++ b/tests/examples/wibox/layout/grid/expand.lua
@@ -16,15 +16,15 @@ local w = wibox.widget {
generic_widget( "-------- long 1 --------" ),
generic_widget( "short 2" ),
generic_widget( "-------- long 2 --------" ),
- forced_num_cols = 2,
- forced_num_rows = 2,
- expand = false,
- homogeneous = false,
- layout = wibox.layout.grid,
+ column_count = 2,
+ row_count = 2,
+ expand = false,
+ homogeneous = false,
+ layout = wibox.layout.grid,
},
margins = 1,
- color = beautiful.border_color,
- layout = wibox.container.margin,
+ color = beautiful.border_color,
+ layout = wibox.container.margin,
},
layout = wibox.layout.fixed.vertical
},
@@ -39,15 +39,15 @@ local w = wibox.widget {
generic_widget( "-------- long 1 --------" ),
generic_widget( "short 2" ),
generic_widget( "-------- long 2 --------" ),
- forced_num_cols = 2,
- forced_num_rows = 2,
- expand = true,
- homogeneous = false,
- layout = wibox.layout.grid,
+ column_count = 2,
+ row_count = 2,
+ expand = true,
+ homogeneous = false,
+ layout = wibox.layout.grid,
},
margins = 1,
- color = beautiful.border_color,
- layout = wibox.container.margin,
+ color = beautiful.border_color,
+ layout = wibox.container.margin,
},
layout = wibox.layout.fixed.vertical
},
@@ -65,11 +65,11 @@ local w = wibox.widget {
generic_widget( "-------- long 1 --------" ),
generic_widget( "short 2" ),
generic_widget( "-------- long 2 --------" ),
- forced_num_cols = 2,
- forced_num_rows = 2,
- expand = false,
- homogeneous = true,
- layout = wibox.layout.grid,
+ column_count = 2,
+ row_count = 2,
+ expand = false,
+ homogeneous = true,
+ layout = wibox.layout.grid,
},
margins = 1,
color = beautiful.border_color,
@@ -88,11 +88,11 @@ local w = wibox.widget {
generic_widget( "-------- long 1 --------" ),
generic_widget( "short 2" ),
generic_widget( "-------- long 2 --------" ),
- forced_num_cols = 2,
- forced_num_rows = 2,
- expand = true,
- homogeneous = true,
- layout = wibox.layout.grid,
+ column_count = 2,
+ row_count = 2,
+ expand = true,
+ homogeneous = true,
+ layout = wibox.layout.grid,
},
margins = 1,
color = beautiful.border_color,
diff --git a/tests/examples/wibox/layout/grid/extend_column.lua b/tests/examples/wibox/layout/grid/extend_column.lua
index 360e16bd4..e31471d10 100644
--- a/tests/examples/wibox/layout/grid/extend_column.lua
+++ b/tests/examples/wibox/layout/grid/extend_column.lua
@@ -5,8 +5,8 @@ local wibox = require("wibox") --DOC_HIDE
print("l:extend_column(2)") --DOC_HIDE
local w = generic_before_after(wibox.layout.grid, {
- forced_num_cols = 3,
- forced_num_rows = 2,
- homogeneous = true,
+ column_count = 3,
+ row_count = 2,
+ homogeneous = true,
}, 6, "extend_column", {2}) --DOC_HIDE
return w, w:fit({dpi=96}, 9999, 9999) --DOC_HIDE
diff --git a/tests/examples/wibox/layout/grid/imperative.lua b/tests/examples/wibox/layout/grid/imperative.lua
index a6f8a4659..47f550d65 100644
--- a/tests/examples/wibox/layout/grid/imperative.lua
+++ b/tests/examples/wibox/layout/grid/imperative.lua
@@ -11,11 +11,11 @@ local lorem = generic_widget("Lorem ipsum dolor sit amet, consectetur " .. --
"adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.") --DOC_HIDE
local l = wibox.widget {
- homogeneous = true,
- spacing = 5,
- min_cols_size = 10,
- min_rows_size = 10,
- layout = wibox.layout.grid,
+ homogeneous = true,
+ spacing = 5,
+ minimum_column_width = 10,
+ minimum_row_height = 10,
+ layout = wibox.layout.grid,
}
l:add_widget_at(first , 2, 1, 1, 2)
l:add_widget_at(second, 3, 1, 1, 2)
diff --git a/tests/examples/wibox/layout/grid/insert_column.lua b/tests/examples/wibox/layout/grid/insert_column.lua
index e823d7f06..60ff820aa 100644
--- a/tests/examples/wibox/layout/grid/insert_column.lua
+++ b/tests/examples/wibox/layout/grid/insert_column.lua
@@ -5,9 +5,9 @@ local wibox = require("wibox") --DOC_HIDE
print("l:insert_column(2)") --DOC_HIDE
local w = generic_before_after(wibox.layout.grid, {
- forced_num_cols = 3,
- forced_num_rows = 2,
- homogeneous = true,
+ column_count = 3,
+ row_count = 2,
+ homogeneous = true,
}
, 6, "insert_column", {2}) --DOC_HIDE
return w, w:fit({dpi=96}, 9999, 9999) --DOC_HIDE
diff --git a/tests/examples/wibox/layout/grid/min_size.lua b/tests/examples/wibox/layout/grid/min_size.lua
index fbd736181..6adf06759 100644
--- a/tests/examples/wibox/layout/grid/min_size.lua
+++ b/tests/examples/wibox/layout/grid/min_size.lua
@@ -6,41 +6,41 @@ local beautiful = require("beautiful") --DOC_HIDE
local w = wibox.widget {
{
{
- markup = "min_cols_size = 0",
+ markup = "minimum_column_width = 0",
widget = wibox.widget.textbox
},
{
{
generic_widget( "first" ),
generic_widget( "second" ),
- forced_num_cols = 2,
- min_cols_size = 0,
- homogeneous = true,
- layout = wibox.layout.grid,
+ column_count = 2,
+ minimum_column_width = 0,
+ homogeneous = true,
+ layout = wibox.layout.grid,
},
margins = 1,
- color = beautiful.border_color,
- layout = wibox.container.margin,
+ color = beautiful.border_color,
+ layout = wibox.container.margin,
},
layout = wibox.layout.fixed.vertical
},
{
{
- markup = "min_cols_size = 100",
+ markup = "minimum_column_width = 100",
widget = wibox.widget.textbox
},
{
{
generic_widget( "first" ),
generic_widget( "second" ),
- forced_num_cols = 2,
- min_cols_size = 100,
- homogeneous = true,
- layout = wibox.layout.grid,
+ column_count = 2,
+ minimum_column_width = 100,
+ homogeneous = true,
+ layout = wibox.layout.grid,
},
margins = 1,
- color = beautiful.border_color,
- layout = wibox.container.margin,
+ color = beautiful.border_color,
+ layout = wibox.container.margin,
},
layout = wibox.layout.fixed.vertical
},
diff --git a/tests/examples/wibox/layout/grid/orientation.lua b/tests/examples/wibox/layout/grid/orientation.lua
index a0fce8193..a5ae7eb8d 100644
--- a/tests/examples/wibox/layout/grid/orientation.lua
+++ b/tests/examples/wibox/layout/grid/orientation.lua
@@ -4,10 +4,10 @@ local wibox = require("wibox") --DOC_HIDE
local beautiful = require("beautiful") --DOC_HIDE
print([[l = wibox.layout {
- forced_num_cols = 2,
- forced_num_rows = 2,
- homogeneous = true,
- layout = wibox.layout.grid
+ column_count = 2,
+ row_count = 2,
+ homogeneous = true,
+ layout = wibox.layout.grid
}
l:set_orientation("vertical") -- change to "horizontal"
l:add(...)]]) --DOC_HIDE
@@ -27,16 +27,16 @@ wibox.widget {
generic_widget( "fourth" ),
generic_widget( "fifth" ),
generic_widget( "sixth" ),
- forced_num_cols = 2,
- forced_num_rows = 2,
- orientation = "vertical",
- expand = false,
- homogeneous = true,
- layout = wibox.layout.grid,
+ column_count = 2,
+ row_count = 2,
+ orientation = "vertical",
+ expand = false,
+ homogeneous = true,
+ layout = wibox.layout.grid,
},
margins = 1,
- color = beautiful.border_color,
- layout = wibox.container.margin,
+ color = beautiful.border_color,
+ layout = wibox.container.margin,
},
layout = wibox.layout.fixed.vertical
},
@@ -53,16 +53,16 @@ wibox.widget {
generic_widget( "fourth" ),
generic_widget( "fifth" ),
generic_widget( "sixth" ),
- forced_num_cols = 2,
- forced_num_rows = 2,
- orientation = 'horizontal',
- expand = false,
- homogeneous = true,
- layout = wibox.layout.grid,
+ column_count = 2,
+ row_count = 2,
+ orientation = 'horizontal',
+ expand = false,
+ homogeneous = true,
+ layout = wibox.layout.grid,
},
margins = 1,
- color = beautiful.border_color,
- layout = wibox.container.margin,
+ color = beautiful.border_color,
+ layout = wibox.container.margin,
},
layout = wibox.layout.fixed.vertical
},
diff --git a/tests/examples/wibox/layout/grid/orientation.output.txt b/tests/examples/wibox/layout/grid/orientation.output.txt
index cb19909a7..bacaf2ae8 100644
--- a/tests/examples/wibox/layout/grid/orientation.output.txt
+++ b/tests/examples/wibox/layout/grid/orientation.output.txt
@@ -1,8 +1,8 @@
l = wibox.layout {
- forced_num_cols = 2,
- forced_num_rows = 2,
- homogeneous = true,
- layout = wibox.layout.grid
+ column_count = 2,
+ row_count = 2,
+ homogeneous = true,
+ layout = wibox.layout.grid
}
l:set_orientation("vertical") -- change to "horizontal"
l:add(...)
diff --git a/tests/examples/wibox/layout/grid/remove.lua b/tests/examples/wibox/layout/grid/remove.lua
index c2e1fe42e..c9c54208a 100644
--- a/tests/examples/wibox/layout/grid/remove.lua
+++ b/tests/examples/wibox/layout/grid/remove.lua
@@ -5,9 +5,9 @@ local wibox = require("wibox") --DOC_HIDE
print("l:remove_widgets_at(1,1)") --DOC_HIDE
local w = generic_before_after(wibox.layout.grid, {
- forced_num_cols = 3,
- forced_num_rows = 2,
- homogeneous = true,
+ column_count = 3,
+ row_count = 2,
+ homogeneous = true,
}, 6, "remove_widgets_at", {1, 1}) --DOC_HIDE
return w, w:fit({dpi=96}, 9999, 9999) --DOC_HIDE
diff --git a/tests/examples/wibox/layout/grid/remove_column.lua b/tests/examples/wibox/layout/grid/remove_column.lua
index 7359e032b..bde9e45a0 100644
--- a/tests/examples/wibox/layout/grid/remove_column.lua
+++ b/tests/examples/wibox/layout/grid/remove_column.lua
@@ -5,9 +5,9 @@ local wibox = require("wibox") --DOC_HIDE
print("l:remove_column(2)") --DOC_HIDE
local w = generic_before_after(wibox.layout.grid, {
- forced_num_cols = 3,
- forced_num_rows = 2,
- homogeneous = true,
+ column_count = 3,
+ row_count = 2,
+ homogeneous = true,
}, 6, "remove_column", {2} --DOC_HIDE
)
return w, w:fit({dpi=96}, 9999, 9999) --DOC_HIDE
diff --git a/tests/examples/wibox/layout/grid/spacing.lua b/tests/examples/wibox/layout/grid/spacing.lua
index 0da363244..d0ef0bc76 100644
--- a/tests/examples/wibox/layout/grid/spacing.lua
+++ b/tests/examples/wibox/layout/grid/spacing.lua
@@ -19,15 +19,15 @@ local w = wibox.widget {
generic_widget( "second" ),
generic_widget( "third" ),
generic_widget( "fourth" ),
- forced_num_cols = 2,
- forced_num_rows = 2,
- homogeneous = true,
- spacing = 0,
- layout = wibox.layout.grid,
+ column_count = 2,
+ row_count = 2,
+ homogeneous = true,
+ spacing = 0,
+ layout = wibox.layout.grid,
},
margins = 1,
- color = beautiful.border_color,
- layout = wibox.container.margin,
+ color = beautiful.border_color,
+ layout = wibox.container.margin,
},
layout = wibox.layout.fixed.vertical
},
@@ -42,15 +42,15 @@ local w = wibox.widget {
generic_widget( "second" ),
generic_widget( "third" ),
generic_widget( "fourth" ),
- forced_num_cols = 2,
- forced_num_rows = 2,
- homogeneous = true,
- spacing = 10,
- layout = wibox.layout.grid,
+ column_count = 2,
+ row_count = 2,
+ homogeneous = true,
+ spacing = 10,
+ layout = wibox.layout.grid,
},
margins = 1,
- color = beautiful.border_color,
- layout = wibox.container.margin,
+ color = beautiful.border_color,
+ layout = wibox.container.margin,
},
layout = wibox.layout.fixed.vertical
},
diff --git a/tests/examples/wibox/layout/grid/superpose.lua b/tests/examples/wibox/layout/grid/superpose.lua
index 7036882b5..88ae58849 100644
--- a/tests/examples/wibox/layout/grid/superpose.lua
+++ b/tests/examples/wibox/layout/grid/superpose.lua
@@ -8,11 +8,11 @@ local w = wibox.widget {
generic_widget( "second" ),
generic_widget( "third" ),
generic_widget( "fourth" ),
- forced_num_cols = 2,
- forced_num_rows = 2,
- superpose = true,
- homogeneous = true,
- layout = wibox.layout.grid,
+ column_count = 2,
+ row_count = 2,
+ superpose = true,
+ homogeneous = true,
+ layout = wibox.layout.grid,
}
w:add_widget_at(
generic_widget("fifth",beautiful.bg_highlight)
diff --git a/tests/examples/wibox/nwidget/icon/strategy.lua b/tests/examples/wibox/nwidget/icon/strategy.lua
index f7e2563fe..5594e1945 100644
--- a/tests/examples/wibox/nwidget/icon/strategy.lua
+++ b/tests/examples/wibox/nwidget/icon/strategy.lua
@@ -54,9 +54,9 @@ parent:add(
icons[1],
icons[2],
icons[3],
- forced_num_rows = 2,
- forced_num_cols = 3,
- spacing = 5,
- widget = wibox.layout.grid,
+ column_count = 2,
+ row_count = 3,
+ spacing = 5,
+ widget = wibox.layout.grid,
}
)