Spotted some unevenness in the initial position of new splits. This fixes it to 50:50
This commit is contained in:
parent
b6a75be607
commit
cbb86c48c5
|
@ -44,6 +44,8 @@ class Paned(Container):
|
|||
else:
|
||||
container = HPaned()
|
||||
|
||||
self.get_toplevel().set_pos_by_ratio = True
|
||||
|
||||
if not sibling:
|
||||
sibling = self.maker.make('terminal')
|
||||
sibling.set_cwd(cwd)
|
||||
|
@ -61,6 +63,11 @@ class Paned(Container):
|
|||
|
||||
self.show_all()
|
||||
|
||||
while gtk.events_pending():
|
||||
gtk.main_iteration_do(False)
|
||||
self.get_toplevel().set_pos_by_ratio = False
|
||||
|
||||
|
||||
def add(self, widget, metadata=None):
|
||||
"""Add a widget to the container"""
|
||||
if len(self.children) == 0:
|
||||
|
|
|
@ -420,6 +420,8 @@ class Window(Container, gtk.Window):
|
|||
else:
|
||||
container = maker.make('HPaned')
|
||||
|
||||
self.set_pos_by_ratio = True
|
||||
|
||||
if not sibling:
|
||||
sibling = maker.make('Terminal')
|
||||
sibling.set_cwd(cwd)
|
||||
|
@ -435,6 +437,11 @@ class Window(Container, gtk.Window):
|
|||
container.add(term)
|
||||
container.show_all()
|
||||
|
||||
while gtk.events_pending():
|
||||
gtk.main_iteration_do(False)
|
||||
self.set_pos_by_ratio = False
|
||||
|
||||
|
||||
def zoom(self, widget, font_scale=True):
|
||||
"""Zoom a terminal widget"""
|
||||
children = self.get_children()
|
||||
|
|
Loading…
Reference in New Issue