diff --git a/docs/source/upcoming_release_notes/595-maint_cli_defaults.rst b/docs/source/upcoming_release_notes/595-maint_cli_defaults.rst new file mode 100644 index 00000000..ec6a46d3 --- /dev/null +++ b/docs/source/upcoming_release_notes/595-maint_cli_defaults.rst @@ -0,0 +1,25 @@ +595 maint_cli_defaults +###################### + +API Breaks +---------- +- Default typhos suites to "embedded" displays arranged "vertically" instead of + "detailed" displays arranged "horizontally" to more naturally match how typhos is + used at present. + +Features +-------- +- N/A + + +Bugfixes +-------- +- N/A + +Maintenance +----------- +- N/A + +Contributors +------------ +- zllentz diff --git a/typhos/cli.py b/typhos/cli.py index 5f733070..341731bf 100644 --- a/typhos/cli.py +++ b/typhos/cli.py @@ -70,11 +70,11 @@ class TyphosArguments(types.SimpleNamespace): ) parser.add_argument( '--layout', - default='horizontal', + default='vertical', help=( 'Select a alternate layout for suites of many ' - 'devices. Valid options are "horizontal" (default), ' - '"vertical", "grid", "flow", and any unique ' + 'devices. Valid options are "horizontal", ' + '"vertical" (default), "grid", "flow", and any unique ' 'shortenings of those options.' ), ) @@ -89,11 +89,11 @@ class TyphosArguments(types.SimpleNamespace): ) parser.add_argument( '--display-type', - default='detailed', + default='embedded', help=( 'The kind of display to open for each device at ' - 'initial load. Valid options are "embedded", ' - '"detailed" (default), "engineering", and any ' + 'initial load. Valid options are "embedded" (default), ' + '"detailed", "engineering", and any ' 'unique shortenings of those options.' ), ) diff --git a/typhos/tests/test_cli.py b/typhos/tests/test_cli.py index 3d0c2083..d184fe72 100644 --- a/typhos/tests/test_cli.py +++ b/typhos/tests/test_cli.py @@ -1,6 +1,7 @@ import os import pytest +from qtpy.QtWidgets import QLabel import typhos from typhos.cli import typhos_cli @@ -33,19 +34,20 @@ def test_cli_no_entry(qtbot, happi_cfg): def test_cli_stylesheet(qapp, qtbot, happi_cfg): with open('test.qss', 'w+') as handle: - handle.write( - "TyphosDeviceDisplay {qproperty-force_template: 'test.ui'}") + handle.write("QLabel {color: red}") try: style = qapp.styleSheet() window = typhos_cli(['test_motor', '--stylesheet', 'test.qss', '--happi-cfg', happi_cfg]) qtbot.addWidget(window) suite = window.centralWidget() - dev_display = suite.get_subdisplay(suite.devices[0]) - assert dev_display.force_template == 'test.ui' - qtbot.add_widget(dev_display) - qapp.setStyleSheet(style) + qtbot.addWidget(suite) + some_label = suite.findChild(QLabel) + assert isinstance(some_label, QLabel) + color = some_label.palette().color(some_label.foregroundRole()) + assert color.red() == 255 finally: + qapp.setStyleSheet(style) os.remove('test.qss')