diff mbox

[Branch,~linaro-image-tools/linaro-image-tools/trunk] Rev 488: Fixed UI bug lp:832327

Message ID 20120131145113.4887.42013.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

James Tunnicliffe Jan. 31, 2012, 2:51 p.m. UTC
Merge authors:
  James Tunnicliffe (dooferlad)
Related merge proposals:
  https://code.launchpad.net/~dooferlad/linaro-image-tools/fetch_image_gui_fix_bug_832327/+merge/85495
  proposed by: James Tunnicliffe (dooferlad)
  review: Approve - Paul Sokolovsky (pfalcon)
------------------------------------------------------------
revno: 488 [merge]
committer: James Tunnicliffe <james.tunnicliffe@linaro.org>
branch nick: linaro-image-tools
timestamp: Tue 2012-01-31 14:43:45 +0000
message:
  Fixed UI bug lp:832327
modified:
  linaro-fetch-image-ui


--
lp:linaro-image-tools
https://code.launchpad.net/~linaro-image-tools/linaro-image-tools/trunk

You are subscribed to branch lp:linaro-image-tools.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-image-tools/linaro-image-tools/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'linaro-fetch-image-ui'
--- linaro-fetch-image-ui	2011-09-06 20:59:09 +0000
+++ linaro-fetch-image-ui	2011-12-13 14:13:26 +0000
@@ -110,7 +110,7 @@ 
                   self.cp)
         self.make_pane_content(self.cp.GetPane())
         self.box2 = wx.BoxSizer(wx.VERTICAL)
-        self.box2.Add(self.cp)
+        self.box2.Add(self.cp, 0)
 
         self.help_text_main = wx.StaticText(self, -1, "")
 
@@ -118,6 +118,7 @@ 
         self.sizer.Add(self.box1, 0, wx.ALIGN_LEFT | wx.ALL, 5)
         self.sizer.Add(self.box2, 0, wx.ALIGN_LEFT | wx.ALL, 5)
         self.sizer.Add(self.help_text_main, 0, wx.ALIGN_LEFT | wx.ALL, 5)
+        self.cp.SetSizer(self.sizer)
         self.SetSizerAndFit(self.sizer)
         self.sizer.Fit(self)
         self.Move((50, 50))
@@ -132,6 +133,7 @@ 
         self.adv_box.Add(header)
         self.grid1 = wx.FlexGridSizer(0, 2, 0, 0)
         self.grid2 = wx.FlexGridSizer(0, 2, 0, 0)
+        self.grid3 = wx.FlexGridSizer(0, 1, 0, 0)
 
         platforms = []
         for key, value in self.settings['choice']['platform'].items():
@@ -167,21 +169,32 @@ 
 
         self.adv_box.Add(self.grid1, 0, alignment, 0)
         self.adv_box.Add(self.grid2, 0, alignment, 0)
+        self.adv_box.Add(self.grid3, 0, alignment, 0)
         self.update_visibility()
         self.adv_box.Add(self.help_text, 0, alignment, 5)
 
         pane.SetSizer(self.adv_box)
         self.adv_box.Fit(pane)
 
+        # The following line is here because when the pane is shown and grid2
+        # is not visible and an option is then selected to make it visible,
+        # the pane does not (and seemingly can not) resize to accommodate
+        # the contents of grid2. This results in some content staying
+        # invisible until the pane is hidden and shown again. This blank bit
+        # of text is just there to bulk up the size of the pane so work around
+        # this. Padding is the size of grid2 / 2 (padding is applied all around
+        # the StaticText).
+
+        self.grid3.Add(wx.StaticText(pane, -1, ""), 0, align_text,
+                       self.grid2.GetSize().height/2)
+        self.adv_box.Fit(pane)
+
     def update_visibility(self):
         if self.settings['release_or_snapshot'] == "snapshot":
             self.adv_box.Hide(self.grid2, True)
         else:
             self.adv_box.Show(self.grid2, True)
 
-        self.Fit()
-        self.Layout()
-
     def update_next_active(self):
         if self.build_available and self.os_selected:
             self.wizard.FindWindowById(wx.ID_FORWARD).Enable()
@@ -460,9 +473,7 @@ 
         else:
             self.settings['release_or_snapshot'] = "snapshot"
 
-        self.update_release_and_build_boxes()
-        self.update_visibility()
-        self.update_next_active()
+        self.event_on_pane_changed(event)
 
     def event_on_pane_changed(self, event):
         self.fill_os_list()