Fix the inability to drag the splitters

This commit is contained in:
Stephen Boddy 2012-06-25 19:05:43 +02:00
parent 1e68ae9107
commit b6a75be607
2 changed files with 12 additions and 0 deletions

View File

@ -275,6 +275,12 @@ class Paned(Container):
container.add(child) container.add(child)
def new_size(self, widget, allocation): def new_size(self, widget, allocation):
if self.get_toplevel().set_pos_by_ratio:
self.set_position_by_ratio()
else:
self.set_position(self.get_position())
def set_position_by_ratio(self):
self.set_pos(int(self.ratio*self.get_length())) self.set_pos(int(self.ratio*self.get_length()))
def set_position(self, pos): def set_position(self, pos):

View File

@ -37,6 +37,7 @@ class Window(Container, gtk.Window):
losefocus_time = 0 losefocus_time = 0
position = None position = None
ignore_startup_show = None ignore_startup_show = None
set_pos_by_ratio = None
zoom_data = None zoom_data = None
@ -479,6 +480,7 @@ class Window(Container, gtk.Window):
def rotate(self, widget, clockwise): def rotate(self, widget, clockwise):
"""Rotate children in this window""" """Rotate children in this window"""
self.set_pos_by_ratio = True
maker = Factory() maker = Factory()
# collect all paned children in breadth-first order # collect all paned children in breadth-first order
paned = [] paned = []
@ -495,6 +497,10 @@ class Window(Container, gtk.Window):
self.show_all() self.show_all()
widget.grab_focus() widget.grab_focus()
while gtk.events_pending():
gtk.main_iteration_do(False)
self.set_pos_by_ratio = False
def get_visible_terminals(self): def get_visible_terminals(self):
"""Walk down the widget tree to find all of the visible terminals. """Walk down the widget tree to find all of the visible terminals.
Mostly using Container::get_visible_terminals()""" Mostly using Container::get_visible_terminals()"""