Main menu width must be updated when the language got changed
This commit is contained in:
parent
c151e0f656
commit
31b7ece449
@ -17,8 +17,6 @@ class MenuDisplay(Display):
|
||||
|
||||
def update_menu(self, menu: Menu) -> None:
|
||||
self.menu = menu
|
||||
self.trueheight = len(self.values)
|
||||
self.truewidth = max([len(str(a)) for a in self.values])
|
||||
|
||||
# Menu values are printed in pad
|
||||
self.pad = self.newpad(self.trueheight, self.truewidth + 2)
|
||||
@ -44,6 +42,14 @@ class MenuDisplay(Display):
|
||||
self.height - 2 + self.y,
|
||||
self.width - 2 + self.x)
|
||||
|
||||
@property
|
||||
def truewidth(self) -> int:
|
||||
return max([len(str(a)) for a in self.values])
|
||||
|
||||
@property
|
||||
def trueheight(self) -> int:
|
||||
return len(self.values)
|
||||
|
||||
@property
|
||||
def preferred_width(self) -> int:
|
||||
return self.truewidth + 6
|
||||
|
@ -37,8 +37,8 @@ class Game:
|
||||
self.settings = Settings()
|
||||
self.settings.load_settings()
|
||||
self.settings.write_settings()
|
||||
self.settings_menu.update_values(self.settings)
|
||||
setlocale(self.settings.LOCALE)
|
||||
self.settings_menu.update_values(self.settings)
|
||||
self.logs = Logs()
|
||||
self.message = None
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user