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
|
@ -43,6 +43,8 @@ class Paned(Container):
|
||||||
container = VPaned()
|
container = VPaned()
|
||||||
else:
|
else:
|
||||||
container = HPaned()
|
container = HPaned()
|
||||||
|
|
||||||
|
self.get_toplevel().set_pos_by_ratio = True
|
||||||
|
|
||||||
if not sibling:
|
if not sibling:
|
||||||
sibling = self.maker.make('terminal')
|
sibling = self.maker.make('terminal')
|
||||||
|
@ -60,6 +62,11 @@ class Paned(Container):
|
||||||
container.add(terminal)
|
container.add(terminal)
|
||||||
|
|
||||||
self.show_all()
|
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):
|
def add(self, widget, metadata=None):
|
||||||
"""Add a widget to the container"""
|
"""Add a widget to the container"""
|
||||||
|
|
|
@ -419,6 +419,8 @@ class Window(Container, gtk.Window):
|
||||||
container = maker.make('VPaned')
|
container = maker.make('VPaned')
|
||||||
else:
|
else:
|
||||||
container = maker.make('HPaned')
|
container = maker.make('HPaned')
|
||||||
|
|
||||||
|
self.set_pos_by_ratio = True
|
||||||
|
|
||||||
if not sibling:
|
if not sibling:
|
||||||
sibling = maker.make('Terminal')
|
sibling = maker.make('Terminal')
|
||||||
|
@ -434,6 +436,11 @@ class Window(Container, gtk.Window):
|
||||||
for term in order:
|
for term in order:
|
||||||
container.add(term)
|
container.add(term)
|
||||||
container.show_all()
|
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):
|
def zoom(self, widget, font_scale=True):
|
||||||
"""Zoom a terminal widget"""
|
"""Zoom a terminal widget"""
|
||||||
|
|
Loading…
Reference in New Issue