Mercurial > mamba
changeset 381:8b9cfc4f0f01
Use right edge of OK button to place cancel buttons
author | Neil Muller <drnlmuller@gmail.com> |
---|---|
date | Sat, 17 Sep 2011 01:02:52 +0200 |
parents | f74723ccd68a |
children | 9db8fbe8ae83 |
files | mamba/widgets/editsprite.py mamba/widgets/entrybox.py |
diffstat | 2 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mamba/widgets/editsprite.py Sat Sep 17 01:22:17 2011 +0200 +++ b/mamba/widgets/editsprite.py Sat Sep 17 01:02:52 2011 +0200 @@ -45,7 +45,8 @@ self.ok_button = TextButton((self.rect.left + 10, height), 'OK') self.ok_button.add_callback('clicked', self.close, True) self.add(self.ok_button) - cancel_button = TextButton((self.rect.left + 100, height), 'Cancel') + cancel_button = TextButton((self.ok_button.rect.right + 10, height), + 'Cancel') cancel_button.add_callback('clicked', self.close, False) self.add(cancel_button) self.rect.width = max(self.rect.width, 400)
--- a/mamba/widgets/entrybox.py Sat Sep 17 01:22:17 2011 +0200 +++ b/mamba/widgets/entrybox.py Sat Sep 17 01:02:52 2011 +0200 @@ -33,7 +33,7 @@ ok_button.add_callback('clicked', self.close, True) self.add(ok_button) cancel_button = ok_button = TextButton( - (self.entry_text.rect.right + 60, self.entry_text.rect.bottom), + (ok_button.rect.right + 10, self.entry_text.rect.bottom), 'Cancel') cancel_button.add_callback('clicked', self.close, False) self.add(cancel_button) @@ -57,6 +57,7 @@ if hasattr(self.parent, 'paused'): self.parent.paused = False self.parent.remove(self) + return True def edit(self, ev, widget): if ev.key == K_ESCAPE: