Fix de-serialization of some layouts

Forgot that JSON converts dict keys to strings. Sigh.
This commit is contained in:
Kovid Goyal
2025-08-20 08:06:52 +05:30
parent 4c987cd509
commit f925327755
3 changed files with 4 additions and 4 deletions

View File

@@ -316,6 +316,6 @@ class Grid(Layout):
}
def set_layout_state(self, layout_state: dict[str, Any], map_group_id: WindowMapper) -> bool:
self.biased_rows = layout_state['biased_rows']
self.biased_cols = layout_state['biased_cols']
self.biased_rows = {int(k): v for k, v in layout_state['biased_rows'].items()}
self.biased_cols = {int(k): v for k, v in layout_state['biased_cols'].items()}
return True

View File

@@ -354,7 +354,7 @@ class Tall(Layout):
def set_layout_state(self, layout_state: dict[str, Any], map_group_id: WindowMapper) -> bool:
self.main_bias = layout_state['main_bias']
self.biased_map = layout_state['biased_map']
self.biased_map = {int(k): v for k, v in layout_state['biased_map'].items()}
self.layout_opts = TallLayoutOpts(layout_state['opts'])
return True

View File

@@ -141,7 +141,7 @@ class Vertical(Layout):
return {'biased_map': self.biased_map}
def set_layout_state(self, layout_state: dict[str, Any], map_group_id: WindowMapper) -> bool:
self.biased_map = layout_state['biased_map']
self.biased_map = {int(k): v for k, v in layout_state['biased_map'].items()}
return True
class Horizontal(Vertical):