diff --git a/README.rst b/README.rst index 5b81c7d6..26bfdf57 100755 --- a/README.rst +++ b/README.rst @@ -16,12 +16,12 @@ other configuration may work fine. All hardware buttons and lights are optional. Hardware: ^^^^^^^^^ -* 1 Raspberry Pi Model B+ +* 1 Raspberry Pi 2 Model B (or higher) * 1 Camera (Pi Camera v2.1 8 MP 1080p or any camera `compatible with gphoto2 `_) * 2 push buttons -* 2 LED -* 2 resistor of 100 Ohm +* 2 LEDs +* 2 resistors of 100 Ohm Software: ^^^^^^^^^ @@ -139,7 +139,7 @@ Below is the default configuration file: debounce_delay = 0.3 [WINDOW] - # (width, height) of the display monitor + # (width, height) of the display monitor or 'fullscreen' size = (800, 480) # Blinking background when picture is taken diff --git a/pibooth/config.py b/pibooth/config.py index 6a2939bf..854d2814 100644 --- a/pibooth/config.py +++ b/pibooth/config.py @@ -32,7 +32,7 @@ "text_color": ((0, 0, 0), "Footer text RGB color"), }, "WINDOW": { - "size": ((800, 480), "(Width, Height) of the display monitor"), + "size": ((800, 480), "(Width, Height) of the display monitor or 'fullscreen'"), "flash": (True, "Blinking background when picture is taken"), "preview_delay": (3, "How long is the preview in seconds"), "preview_countdown": (True, "Show a countdown timer during the preview"), diff --git a/pibooth/view.py b/pibooth/view.py index d4a3b776..d04ceb6d 100644 --- a/pibooth/view.py +++ b/pibooth/view.py @@ -13,16 +13,21 @@ class PtbWindow(object): """ def __init__(self, title, size, use_buffer): - self.__size = size + if isinstance(size, str) and size.lower() == 'fullscreen': + self.__size = (800, 480) + elif isinstance(size, (tuple, list)): + self.__size = size + else: + raise TypeError("Invalid size '{}' ({})".format(size, type(size))) # Save the desktop mode, shall be done before `setmode` (SDL 1.2.10, and pygame 1.8.0) info = pygame.display.Info() pygame.display.set_caption(title) - self.surface = pygame.display.set_mode(size, pygame.RESIZABLE) - self.display_size = (info.current_w, info.current_h) self.is_fullscreen = False self.use_buffer = use_buffer + self.display_size = (info.current_w, info.current_h) + self.surface = pygame.display.set_mode(self.__size, pygame.RESIZABLE) self._buffered_images = {} self._current_background = None @@ -33,6 +38,9 @@ def __init__(self, title, size, use_buffer): 'right': self._right_pos, 'left': self._left_pos} + if isinstance(size, str) and size.lower() == 'fullscreen': + self.toggle_fullscreen() + def _clear(self): """Clear the window content. """