Mercurial > mamba
view mamba/widgets/overlay.py @ 601:915de6c7d342 default tip
Add support for making the editor fullscreen too.
author | Simon Cross <hodgestar@gmail.com> |
---|---|
date | Sat, 14 Jan 2023 19:34:26 +0100 |
parents | 9393dc6f5707 |
children |
line wrap: on
line source
from mamba.widgets.base import Button class OverlayOnFocusButton(Button): """A non-visiable clickable area, that causes an overlay to be displayed when focussed""" def __init__(self, rect, image): self.image = image super(OverlayOnFocusButton, self).__init__(rect) self.focussable = True def draw(self, surface): if self.focussed: surface.blit(self.image, surface.get_rect()) class OverlayButton(Button): """A non-visiable clickable area, that causes an overlay to be displayed. Doesn't really understand this focus thing.""" def __init__(self, rect, image): self.image = image super(OverlayButton, self).__init__(rect) self.focussable = True def draw(self, surface): if not self.disabled: surface.blit(self.image, surface.get_rect())