Merge pull request #4985 from KeyWeeUsr/docs_win_props

Add docs & versions for Window properties
This commit is contained in:
Peter Badida 2017-02-13 17:40:54 +01:00 committed by GitHub
commit ec7f2477ac
1 changed files with 32 additions and 1 deletions

View File

@ -346,12 +346,22 @@ class WindowBase(EventDispatcher):
''' '''
icon = StringProperty() icon = StringProperty()
'''A path to the window icon.
.. versionadded:: 1.1.2
:attr:`icon` is a :class:`~kivy.properties.StringProperty`.
'''
def _get_modifiers(self): def _get_modifiers(self):
return self._modifiers return self._modifiers
modifiers = AliasProperty(_get_modifiers, None) modifiers = AliasProperty(_get_modifiers, None)
'''List of keyboard modifiers currently active. '''List of keyboard modifiers currently active.
.. versionadded:: 1.0.9
:attr:`modifiers` is an :class:`~kivy.properties.AliasProperty`.
''' '''
def _get_size(self): def _get_size(self):
@ -409,6 +419,10 @@ class WindowBase(EventDispatcher):
size = AliasProperty(_get_size, _set_size, bind=('_size', )) size = AliasProperty(_get_size, _set_size, bind=('_size', ))
'''Get the rotated size of the window. If :attr:`rotation` is set, then the '''Get the rotated size of the window. If :attr:`rotation` is set, then the
size will change to reflect the rotation. size will change to reflect the rotation.
.. versionadded:: 1.0.9
:attr:`size` is an :class:`~kivy.properties.AliasProperty`.
''' '''
def _get_clearcolor(self): def _get_clearcolor(self):
@ -439,6 +453,10 @@ class WindowBase(EventDispatcher):
.. versionchanged:: 1.7.2 .. versionchanged:: 1.7.2
The clearcolor default value is now: (0, 0, 0, 1). The clearcolor default value is now: (0, 0, 0, 1).
.. versionadded:: 1.0.9
:attr:`clearcolor` is an :class:`~kivy.properties.AliasProperty` and
defaults to (0, 0, 0, 1).
''' '''
# make some property read-only # make some property read-only
@ -480,7 +498,9 @@ class WindowBase(EventDispatcher):
center = AliasProperty(_get_center, None, bind=('width', 'height')) center = AliasProperty(_get_center, None, bind=('width', 'height'))
'''Center of the rotated window. '''Center of the rotated window.
:attr:`center` is a :class:`~kivy.properties.AliasProperty`. .. versionadded:: 1.0.9
:attr:`center` is an :class:`~kivy.properties.AliasProperty`.
''' '''
def _get_rotation(self): def _get_rotation(self):
@ -502,6 +522,10 @@ class WindowBase(EventDispatcher):
bind=('_rotation', )) bind=('_rotation', ))
'''Get/set the window content rotation. Can be one of 0, 90, 180, 270 '''Get/set the window content rotation. Can be one of 0, 90, 180, 270
degrees. degrees.
.. versionadded:: 1.0.9
:attr:`rotation` is an :class:`~kivy.properties.AliasProperty`.
''' '''
softinput_mode = OptionProperty('', options=( softinput_mode = OptionProperty('', options=(
@ -624,6 +648,10 @@ class WindowBase(EventDispatcher):
_set_system_size, _set_system_size,
bind=('_size', )) bind=('_size', ))
'''Real size of the window ignoring rotation. '''Real size of the window ignoring rotation.
.. versionadded:: 1.0.9
:attr:`system_size` is an :class:`~kivy.properties.AliasProperty`.
''' '''
def _get_effective_size(self): def _get_effective_size(self):
@ -668,6 +696,9 @@ class WindowBase(EventDispatcher):
'''2d position of the mouse within the window. '''2d position of the mouse within the window.
.. versionadded:: 1.2.0 .. versionadded:: 1.2.0
:attr:`mouse_pos` is an :class:`~kivy.properties.ObjectProperty` and
defaults to [0, 0].
''' '''
show_cursor = BooleanProperty(True) show_cursor = BooleanProperty(True)