Commit 47febb45edce5483b68db9c0d9e0e9a439300947

Authored by tfmoraes
1 parent 1237634e

FIX: the title, subtitle and image wasn't centered in the preview in dicom import

Showing 1 changed file with 6 additions and 13 deletions   Show diff stats
invesalius/gui/dicom_preview_panel.py
... ... @@ -85,33 +85,27 @@ class Preview(wx.Panel):
85 85 The little previews.
86 86 """
87 87 def __init__(self, parent):
88   - super(Preview, self).__init__(parent, style= wx.BORDER)
  88 + super(Preview, self).__init__(parent, style=wx.SUNKEN_BORDER)
89 89 # Will it be white?
90 90 self.select_on = False
91 91 self._init_ui()
92 92 self._bind_events()
93 93  
94 94 def _init_ui(self):
95   - self.title = wx.StaticText(self, -1, _("Image"),
96   - style=wx.ALIGN_CENTER)
97   - self.subtitle = wx.StaticText(self, -1, _("Image"),
98   - style=wx.ALIGN_CENTER)
  95 + self.title = wx.StaticText(self, -1, _("Image"))
  96 + self.subtitle = wx.StaticText(self, -1, _("Image"))
99 97 self.image_viewer = wx.StaticBitmap(self, -1, size=(70, 70))
100 98  
101 99 #self.panel = wx.Panel(self, -1)
102 100  
103 101 self.SetBackgroundColour(PREVIEW_BACKGROUND)
104 102  
105   - sizer_image = wx.BoxSizer(wx.HORIZONTAL)
106   - sizer_image.Add(self.image_viewer, 0, wx.EXPAND|wx.ALIGN_CENTER_HORIZONTAL)
107   -
108 103 self.sizer = wx.BoxSizer(wx.VERTICAL)
109   - self.sizer.AddSpacer(2)
110 104 self.sizer.Add(self.title, 0,
111   - wx.GROW|wx.EXPAND|wx. ALIGN_CENTER_HORIZONTAL)
  105 + wx.ALIGN_CENTER_HORIZONTAL)
112 106 self.sizer.Add(self.subtitle, 0,
113   - wx.GROW|wx.EXPAND|wx.ALIGN_CENTER_HORIZONTAL)
114   - self.sizer.Add(sizer_image, 5, wx.GROW|wx.EXPAND|wx.ALL, 4)
  107 + wx.ALIGN_CENTER_HORIZONTAL)
  108 + self.sizer.Add(self.image_viewer, 0, wx.ALIGN_CENTER_HORIZONTAL)
115 109 self.sizer.Fit(self)
116 110  
117 111 self.SetSizer(self.sizer)
... ... @@ -198,7 +192,6 @@ class Preview(wx.Panel):
198 192 else:
199 193 c = (255,255,255)
200 194 self.SetBackgroundColour(c)
201   - self.Refresh()
202 195  
203 196 def OnDClick(self, evt):
204 197 evt = PreviewEvent(myEVT_SELECT, self.GetId())
... ...