diff --git a/examples/demo/touchtracer/main.py b/examples/demo/touchtracer/main.py index ca10e6b14..c97a7e190 100755 --- a/examples/demo/touchtracer/main.py +++ b/examples/demo/touchtracer/main.py @@ -135,6 +135,7 @@ class Touchtracer(FloatLayout): label.pos = touch.pos label.size = label.texture_size[0] + 20, label.texture_size[1] + 20 + class TouchtracerApp(App): title = 'Touchtracer' icon = 'icon.png' diff --git a/kivy/config.py b/kivy/config.py index f2e064b7c..49fcf2768 100644 --- a/kivy/config.py +++ b/kivy/config.py @@ -755,12 +755,14 @@ if not environ.get('KIVY_DOC_INCLUDE'): elif version == 12: Config.set('graphics', 'window_state', 'visible') - elif version == 13: + + elif version == 13: Config.set('graphics', 'minimum_width', '0') Config.set('graphics', 'minimum_height', '0') - #elif version == 1: - # # add here the command for upgrading from configuration 0 to 1 - # + + # elif version == 1: + # # add here the command for upgrading from configuration 0 to 1 + else: # for future. break diff --git a/kivy/core/window/__init__.py b/kivy/core/window/__init__.py index d6bfdb623..daf7e9266 100755 --- a/kivy/core/window/__init__.py +++ b/kivy/core/window/__init__.py @@ -334,15 +334,21 @@ class WindowBase(EventDispatcher): return False minimum_width = NumericProperty(0) - '''The minimum_width to restrict the window to. + '''The minimum width to restrict the window to. .. versionadded:: 1.9.1 + + :attr:`minimum_width` is a :class:`~kivy.properties.NumericProperty`, + defaults to 0. ''' minimum_height = NumericProperty(0) - '''The minimum_height to restrict the window to. + '''The minimum height to restrict the window to. .. versionadded:: 1.9.1 + + :attr:`minimum_height` is a :class:`~kivy.properties.NumericProperty`, + defaults to 0. ''' size = AliasProperty(_get_size, _set_size, bind=('_size', )) diff --git a/kivy/core/window/window_sdl2.py b/kivy/core/window/window_sdl2.py index a25d7ac10..24fe6b6eb 100644 --- a/kivy/core/window/window_sdl2.py +++ b/kivy/core/window/window_sdl2.py @@ -155,13 +155,12 @@ class WindowSDL(WindowBase): 280: 'pgup', 281: 'pgdown'} self._mouse_buttons_down = set() - self.bind( - minimum_width=self._restrict_window, - minimum_height=self._restrict_window) + + self.bind(minimum_width=self._restrict_window, + minimum_height=self._restrict_window) def _restrict_window(self, *args): self._win.set_minimum_size(self.minimum_width, self.minimum_height) - def create_window(self, *largs): if self._fake_fullscreen: @@ -173,8 +172,8 @@ class WindowSDL(WindowBase): if self.fullscreen == 'fake': self.borderless = self._fake_fullscreen = True Logger.warning("The 'fake' fullscreen option has been " - "deprecated, use Window.borderless or the " - "borderless Config option instead.") + "deprecated, use Window.borderless or the " + "borderless Config option instead.") if not self.initialized: @@ -207,7 +206,7 @@ class WindowSDL(WindowBase): self._win.set_border_state(self.borderless) self._win.set_fullscreen_mode(self.fullscreen) - if self.minimum_width and self.minimum_height: + if self.minimum_width or self.minimum_height: self._win.set_minimum_size(self.minimum_width, self.minimum_height) super(WindowSDL, self).create_window()