GeoView : better resizing with the new gui.

svn: r16272
This commit is contained in:
Serge Noiraud 2010-12-12 18:09:56 +00:00
parent ca698e7a19
commit 40cdf569e6

View File

@ -933,26 +933,21 @@ class GeoView(HtmlView):
if not self.javascript_ready: if not self.javascript_ready:
return return
# VBox -> NoteBook -> HPaned -> HBox # VBox -> NoteBook -> HPaned -> HBox
# We need to get the HBox size. # We need to get the visible size
gws = widget.parent.parent.parent.get_allocation() position = widget.parent.parent.get_position()
width = gws.width - ( 6 * 4 )
# We need to get the gramps size (gtk.window). # We need to get the gramps size (gtk.window).
gws = widget.parent.parent.parent.parent.get_allocation() gws = widget.parent.parent.parent.get_allocation()
gheight = gws.height
tgws = widget.parent.parent.get_allocation() tgws = widget.parent.parent.get_allocation()
# We need to get the HPaned size. # We need to get the HPaned size.
self.header_size = self.box1.get_allocation().height # + 20 self.header_size = self.box1.get_allocation().height # + 20
self.height = tgws.height - self.header_size - ( 7 * 4 ) self.height = tgws.height - self.header_size - ( 6 * 4 )
if config.get('interface.view'): if not config.get('interface.filter'):
self.pane = widget.parent.parent.get_position() self.width = gws.width - ( 2 * 10 )
_LOG.debug("Pane width=%d" % self.pane ) _LOG.debug("No sidebar : map width=%d" % self.width )
# strange resize when self.pane < 135
self.pane = 140 if self.pane < 140 else self.pane
self.width = width - self.pane - ( 2 * 4 )
else: else:
self.width = width - ( 2 * 4 ) self.width = position - ( 2 * 10 )
if config.get('interface.filter'): _LOG.debug("Sidebar : map width=%d" % self.width )
self.width -= self.filter.get_allocation().width self.width = 1024 if self.width < 0 else self.width
if self.javascript_ready: if self.javascript_ready:
_LOG.debug("New size : width=%d and height=%d" % _LOG.debug("New size : width=%d and height=%d" %
(self.width, self.height)) (self.width, self.height))