Skip to content

Commit

Permalink
layout: drop positional arg to matrix
Browse files Browse the repository at this point in the history
Signed-off-by: Tycho Andersen <tycho@tycho.pizza>
  • Loading branch information
tych0 authored and elParaguayo committed Apr 28, 2024
1 parent 3a4e0ac commit 19097fb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
11 changes: 3 additions & 8 deletions libqtile/layout/matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@

from libqtile.command.base import expose_command
from libqtile.layout.base import _SimpleLayoutBase
from libqtile.log_utils import logger

if TYPE_CHECKING:
from typing import Any, Self
Expand All @@ -48,6 +47,8 @@ class Matrix(_SimpleLayoutBase):
can also be changed interactively.
"""

columns: int

defaults = [
("border_focus", "#0000ff", "Border colour(s) for the focused window."),
("border_normal", "#000000", "Border colour(s) for un-focused windows."),
Expand All @@ -56,15 +57,9 @@ class Matrix(_SimpleLayoutBase):
("margin", 0, "Margin of the layout (int or list of ints [N E S W])"),
]

def __init__(self, _columns: int | None = None, **config):
def __init__(self, **config):
_SimpleLayoutBase.__init__(self, **config)
self.add_defaults(Matrix.defaults)
if _columns:
logger.warning(
"The use of a positional argument in Matrix is deprecated. "
"Please update your config to use columns=..."
)
self.columns = _columns

@property
def rows(self):
Expand Down
5 changes: 0 additions & 5 deletions test/layouts/test_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,3 @@ def test_unknown_client():
# Without the return statement in "configure" the following
# code would result in an error
assert matrix.configure("fakeclient", None) is None


def test_deprecated_configuration(caplog):
_ = layout.Matrix(2)
assert "The use of a positional argument in Matrix is deprecated." in caplog.text

0 comments on commit 19097fb

Please sign in to comment.