mirror of https://github.com/kivy/kivy.git
kivy/config: add resizable token in graphics section, default to 1. If 0, the window will have a static size.
This commit is contained in:
parent
ca7714281b
commit
b316ce3c5a
|
@ -37,6 +37,10 @@ Available configuration tokens
|
|||
* windows icons are not copied to user directory anymore. You can still set
|
||||
a new window icon by using ``window_icon`` config setting.
|
||||
|
||||
.. versionchanged:: 1.1.2
|
||||
|
||||
* `resizable` has been added to graphics section
|
||||
|
||||
:kivy:
|
||||
|
||||
`log_level`: (debug, info, warning, error, critical)
|
||||
|
@ -114,7 +118,9 @@ Available configuration tokens
|
|||
pygame icon.
|
||||
`rotation`: (0, 90, 180, 270)
|
||||
Rotation of the :class:`~kivy.core.window.Window`
|
||||
|
||||
`resizable`: (0, 1)
|
||||
If 0, the window will have a fixed size. If 1, the window will be
|
||||
resizable.
|
||||
|
||||
:input:
|
||||
|
||||
|
@ -171,7 +177,7 @@ from kivy.logger import Logger
|
|||
from kivy.utils import OrderedDict
|
||||
|
||||
# Version number of current configuration format
|
||||
KIVY_CONFIG_VERSION = 5
|
||||
KIVY_CONFIG_VERSION = 6
|
||||
|
||||
#: Kivy configuration object
|
||||
Config = None
|
||||
|
@ -369,6 +375,9 @@ if not 'KIVY_DOC_INCLUDE' in environ:
|
|||
Config.setdefault('kivy', 'keyboard_mode', '')
|
||||
Config.setdefault('kivy', 'keyboard_layout', 'qwerty')
|
||||
|
||||
elif version == 5:
|
||||
Config.setdefault('graphics', 'resizable', '1')
|
||||
|
||||
#elif version == 1:
|
||||
# # add here the command for upgrading from configuration 0 to 1
|
||||
#
|
||||
|
|
|
@ -49,9 +49,9 @@ class WindowPygame(WindowBase):
|
|||
# right now, activate resizable window only on linux.
|
||||
# on window / macosx, the opengl context is lost, and we need to
|
||||
# reconstruct everything. Check #168 for a state of the work.
|
||||
if platform() in ('linux', 'macosx', 'win'):
|
||||
if platform() in ('linux', 'macosx', 'win') and \
|
||||
Config.getint('graphics', 'resizable'):
|
||||
self.flags |= pygame.RESIZABLE
|
||||
self.flags |= pygame.RESIZABLE
|
||||
|
||||
try:
|
||||
pygame.display.init()
|
||||
|
|
Loading…
Reference in New Issue