Author: bugman Date: Fri Jun 8 18:21:06 2012 New Revision: 16787 URL: http://svn.gna.org/viewcvs/relax?rev=16787&view=rev Log: More spacing and layout improvements for the GUI user function descriptions. Modified: branches/uf_redesign/gui/uf_objects.py Modified: branches/uf_redesign/gui/uf_objects.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/gui/uf_objects.py?rev=16787&r1=16786&r2=16787&view=diff ============================================================================== --- branches/uf_redesign/gui/uf_objects.py (original) +++ branches/uf_redesign/gui/uf_objects.py Fri Jun 8 18:21:06 2012 @@ -811,7 +811,6 @@ panel_sizer = wx.BoxSizer(wx.VERTICAL) # Initialise the text elements. - tot_x = 0 tot_y = 0 text_elements = [] text_types = [] @@ -825,7 +824,6 @@ # The text size, then spacing after the title. x, y = text.GetSizeTuple() - tot_x += x tot_y += y tot_y += spacing @@ -839,7 +837,6 @@ # The text size. x, y = text.GetSizeTuple() - tot_x += x tot_y += y # The spacing after the element. @@ -902,11 +899,10 @@ # Wrap the paragraphs and lists. if type in ['paragraph', 'list', 'item list']: - text.Wrap(self._main_size - 20) + text.Wrap(self._main_size) # The text size. x, y = text.GetSizeTuple() - tot_x += x tot_y += y # The spacing after each element. @@ -920,18 +916,21 @@ text_elements.append(text) text_types.append(type) + # Some extra space for who knows what?! + tot_y += 20 + # Scrolling needed. - if tot_y > max_y-10: + if tot_y > max_y: + # Rewrap the text to fit scrollbars in. + for i in range(len(text_elements)): + if text_types[i] in ['synopsis', 'paragraph', 'list', 'item list']: + text_elements[i].Wrap(self._main_size - 20) + # Set the panel size. panel.SetInitialSize((self._main_size, max_y)) # No scrolling. else: - # Rewrap the text. - for i in range(len(text_elements)): - if text_types[i] in ['synopsis', 'paragraph', 'list', 'item list']: - text_elements[i].Wrap(self._main_size) - # Set the panel size. panel.SetInitialSize((self._main_size, tot_y))