Fix a bug where the open state of the splitter was not being saved on shutdown if the splitter had been closed at startup and was opened by dragging the center line

This commit is contained in:
Kovid Goyal 2010-09-05 18:02:39 -06:00
parent 13e9f56b66
commit b957bc1d12
2 changed files with 6 additions and 1 deletions

View File

@ -258,7 +258,9 @@ class LayoutMixin(object): # {{{
getattr(self, x+'_view').save_state()
for x in ('cb', 'tb', 'bd'):
getattr(self, x+'_splitter').save_state()
s = getattr(self, x+'_splitter')
s.update_desired_state()
s.save_state()
def read_layout_settings(self):
# View states are restored automatically when set_database is called

View File

@ -1032,6 +1032,9 @@ class Splitter(QSplitter):
# Public API {{{
def update_desired_state(self):
self.desired_show = not self.is_side_index_hidden
def save_state(self):
if self.count() > 1:
gprefs[self.save_name+'_state'] = self.get_state()