Mercurial > libervia-backend
comparison frontends/src/primitivus/primitivus @ 687:af0d08a84cc6
primitivus card_game: bug fix and improvement
- changeset 56f8a9c99194 introduced a bug because it connected all the list widgets to the parameter change callback. This is not OK because the Tarot is using a list form that is not a parameter.
- some list processing was raising an error when the data is not initialized
- display the "choose contrat" dialog with valign='top' to allow the user see his hand while taking the decision.
author | souliane <souliane@mailoo.org> |
---|---|
date | Mon, 28 Oct 2013 19:04:49 +0100 |
parents | 59c9a7ff903d |
children | f7878ad3c846 |
comparison
equal
deleted
inserted
replaced
686:ae95b0327412 | 687:af0d08a84cc6 |
---|---|
319 next_popup = self.notBar.getNextPopup() | 319 next_popup = self.notBar.getNextPopup() |
320 if next_popup: | 320 if next_popup: |
321 #we still have popup to show, we display it | 321 #we still have popup to show, we display it |
322 self.showPopUp(next_popup) | 322 self.showPopUp(next_popup) |
323 | 323 |
324 def showPopUp(self, pop_up_widget, perc_width=40, perc_height=40): | 324 def showPopUp(self, pop_up_widget, perc_width=40, perc_height=40, valign='middle'): |
325 "Show a pop-up window if possible, else put it in queue" | 325 "Show a pop-up window if possible, else put it in queue" |
326 if not isinstance(self.loop.widget,urwid.Overlay): | 326 if not isinstance(self.loop.widget, urwid.Overlay): |
327 display_widget = urwid.Overlay(pop_up_widget, self.main_widget, 'center', ('relative', perc_width), 'middle', ('relative', perc_height)) | 327 display_widget = urwid.Overlay(pop_up_widget, self.main_widget, 'center', ('relative', perc_width), valign, ('relative', perc_height)) |
328 self.loop.widget = display_widget | 328 self.loop.widget = display_widget |
329 self.redraw() | 329 self.redraw() |
330 else: | 330 else: |
331 self.notBar.addPopUp(pop_up_widget) | 331 self.notBar.addPopUp(pop_up_widget) |
332 | 332 |