comparison src/browser/dialog.py @ 451:1a0cec9b0f1e

better PEP-8 compliance
author souliane <souliane@mailoo.org>
date Tue, 20 May 2014 10:54:03 +0200
parents 981ed669d3b3
children
comparison
equal deleted inserted replaced
450:41aae13cab2b 451:1a0cec9b0f1e
307 DialogBox.__init__(self, centered=True, **kwargs) 307 DialogBox.__init__(self, centered=True, **kwargs)
308 self.callback = callback 308 self.callback = callback
309 if not options: 309 if not options:
310 options = [] 310 options = []
311 _body = VerticalPanel() 311 _body = VerticalPanel()
312 _body.setSize('100%','100%') 312 _body.setSize('100%', '100%')
313 _body.setSpacing(4) 313 _body.setSpacing(4)
314 _body.add(main_widget) 314 _body.add(main_widget)
315 _body.setCellWidth(main_widget, '100%') 315 _body.setCellWidth(main_widget, '100%')
316 _body.setCellHeight(main_widget, '100%') 316 _body.setCellHeight(main_widget, '100%')
317 if not 'NO_CLOSE' in options: 317 if not 'NO_CLOSE' in options:
318 _close_button = Button("Close", self.onClose) 318 _close_button = Button("Close", self.onClose)
319 _body.add(_close_button) 319 _body.add(_close_button)
320 _body.setCellHorizontalAlignment(_close_button, HasAlignment.ALIGN_CENTER) 320 _body.setCellHorizontalAlignment(_close_button, HasAlignment.ALIGN_CENTER)
321 self.setHTML(title) 321 self.setHTML(title)
322 self.setWidget(_body) 322 self.setWidget(_body)
323 self.panel.setSize('100%', '100%') #Need this hack to have correct size in Gecko & Webkit 323 self.panel.setSize('100%', '100%') # Need this hack to have correct size in Gecko & Webkit
324 324
325 def close(self): 325 def close(self):
326 """Same effect as clicking the close button""" 326 """Same effect as clicking the close button"""
327 self.onClose(None) 327 self.onClose(None)
328 328