From ba024ad199ee2c383df0094f821244bbf39e1f3e Mon Sep 17 00:00:00 2001 From: Bouke Haarsma Date: Fri, 21 Dec 2012 12:18:16 +0100 Subject: [PATCH] Refactored view utils for storing view size, state and position @min_best_size and @remember_size_pos are replaced by Mixins. Separated Size from Position, allowing for combining Minimalistic with Position storing, without bothering for previous window sites. Also, maximized window state is now being stored as well. [completed: 84, 83] --- mvvm/viewbinding/display.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mvvm/viewbinding/display.py b/mvvm/viewbinding/display.py index 52f319b..a9ba66d 100644 --- a/mvvm/viewbinding/display.py +++ b/mvvm/viewbinding/display.py @@ -15,15 +15,14 @@ def update_view(self): self.field.Show(value == self.show_if_value) self.field.GetParent().GetSizer().Layout() - # resize frame if @min_best_size'd - if hasattr(self.field.TopLevelParent, 'MinBestSize'): + # resize frame if Minimalistic + if hasattr(self.field.TopLevelParent, 'update_minimal_size'): # First, invalidate all parents parent = self.field.Parent while parent: parent.InvalidateBestSize() parent = parent.Parent - self.field.TopLevelParent.SetSize( - self.field.TopLevelParent.MinBestSize()) + self.field.TopLevelParent.update_minimal_size() class EnabledBinding(object):