Merge pull request #1785 from davep/promote-disabled

Promote disabled to `Widget` level
This commit is contained in:
Will McGugan
2023-02-21 09:56:01 +00:00
committed by GitHub
20 changed files with 555 additions and 156 deletions

View File

@@ -1,7 +1,7 @@
from __future__ import annotations
"""Simple version of 5x5, developed for/with Textual."""
from __future__ import annotations
from pathlib import Path
from typing import TYPE_CHECKING, cast
@@ -192,8 +192,7 @@ class Game(Screen):
Args:
playable (bool): Should the game currently be playable?
"""
for cell in self.query(GameCell):
cell.disabled = not playable
self.query_one(GameGrid).disabled = not playable
def cell(self, row: int, col: int) -> GameCell:
"""Get the cell at a given location.