Browse Source

closes #496 - add option to start Gooey in fullscreen mode

1.0.4-release
Chris 4 years ago
parent
commit
ee100c37fe
4 changed files with 31 additions and 0 deletions
  1. 1
      README.md
  2. 2
      gooey/gui/containers/application.py
  3. 1
      gooey/python_bindings/config_generator.py
  4. 27
      gooey/tests/test_application.py

1
README.md

@ -243,6 +243,7 @@ Just about everything in Gooey's overall look and feel can be customized by pass
|program_name | The name displayed in the title bar of the GUI window. If not supplied, the title defaults to the script name pulled from `sys.argv[0]`. |
| program_description | Sets the text displayed in the top panel of the `Settings` screen. Defaults to the description pulled from `ArgumentParser`. |
| default_size | Initial size of the window |
| fullscreen | start Gooey in fullscreen mode |
| required_cols | Controls how many columns are in the Required Arguments section <br> :warning: **Deprecation notice:** See [Group Parameters](#group-configuration) for modern layout controls|
| optional_cols | Controls how many columns are in the Optional Arguments section <br> :warning: **Deprecation notice:** See [Group Parameters](#group-configuration) for modern layout controls|
| dump_build_config | Saves a `json` copy of its build configuration on disk for reuse/editing |

2
gooey/gui/containers/application.py

@ -189,6 +189,8 @@ class GooeyApplication(wx.Frame):
self.SetSizer(sizer)
self.console.Hide()
self.Layout()
if self.buildSpec.get('fullscreen', True):
self.ShowFullScreen(True)
# Program Icon (Windows)
icon = wx.Icon(self.buildSpec['images']['programIcon'], wx.BITMAP_TYPE_PNG)
self.SetIcon(icon)

1
gooey/python_bindings/config_generator.py

@ -55,6 +55,7 @@ def create_from_parser(parser, source_path, **kwargs):
'requires_shell': kwargs.get('requires_shell', True),
'menu': kwargs.get('menu', []),
'clear_before_run': kwargs.get('clear_before_run', False),
'fullscreen': kwargs.get('fullscreen', False),
# Legacy/Backward compatibility interop
'use_legacy_titles': kwargs.get('use_legacy_titles', True),

27
gooey/tests/test_application.py

@ -0,0 +1,27 @@
import unittest
from argparse import ArgumentParser
from tests.harness import instrumentGooey
class TestGooeyApplication(unittest.TestCase):
def testFullscreen(self):
parser = self.basicParser()
for shouldShow in [True, False]:
with self.subTest('Should set full screen: {}'.format(shouldShow)):
with instrumentGooey(parser, fullscreen=shouldShow) as (app, gapp):
self.assertEqual(gapp.IsFullScreen(), shouldShow)
def basicParser(self):
parser = ArgumentParser()
parser.add_argument('--foo')
return parser
if __name__ == '__main__':
unittest.main()
Loading…
Cancel
Save