Skip to content

Commit

Permalink
Merge pull request #272 from ssciwr/add_scrollbars_and_show_maximised
Browse files Browse the repository at this point in the history
Improve GUI usability on low resolution screens
  • Loading branch information
lkeegan authored May 22, 2024
2 parents fa31e92 + b735474 commit fa4cc9f
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 10 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repos:
- id: check-toml

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.5
rev: v0.4.4
hooks:
- id: ruff
types_or: [python, pyi, jupyter]
Expand All @@ -32,13 +32,13 @@ repos:
- "prettier-plugin-toml"

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.1
rev: 0.28.4
hooks:
- id: check-github-workflows
- id: check-readthedocs

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.9.0
rev: v1.10.0
hooks:
- id: mypy
additional_dependencies: [numpy, PyQt5-stubs, types-requests]
Expand All @@ -51,7 +51,7 @@ repos:
]

- repo: https://github.com/rhysd/actionlint
rev: "v1.6.27"
rev: "v1.7.0"
hooks:
- id: actionlint

Expand Down
2 changes: 1 addition & 1 deletion src/vstt/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def main(filename: str | None) -> None:
app = QtWidgets.QApplication.instance()
assert app is not None
gui = Gui(filename=filename)
gui.show()
gui.showMaximized()
app.exec()


Expand Down
5 changes: 4 additions & 1 deletion src/vstt/display_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ def __init__(

outer_layout = QtWidgets.QVBoxLayout()
group_box = QtWidgets.QGroupBox("Display Options")
outer_layout.addWidget(group_box)
scroll_area = QtWidgets.QScrollArea()
scroll_area.setWidgetResizable(True)
scroll_area.setWidget(group_box)
outer_layout.addWidget(scroll_area)
inner_layout = QtWidgets.QVBoxLayout()
group_box.setLayout(inner_layout)
labels = display_options_labels()
Expand Down
4 changes: 2 additions & 2 deletions src/vstt/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def __init__(self, filename: str | None = None, win: Window | None = None):
self.update_window_title
)
split_metadata_display.addWidget(self.display_options_widget)
split_metadata_display.setSizes([5000, 1000])
split_metadata_display.setSizes([1000, 1000])

split_trial_results = QtWidgets.QSplitter()
self.trials_widget = TrialsWidget(self)
Expand All @@ -50,7 +50,7 @@ def __init__(self, filename: str | None = None, win: Window | None = None):

split_top_bottom.addWidget(split_metadata_display)
split_top_bottom.addWidget(split_trial_results)
split_top_bottom.setSizes([1000, 5000])
split_top_bottom.setSizes([3000, 1000])
grid_layout.addWidget(split_top_bottom)

self.toolbar = _create_menu_and_toolbar(self)
Expand Down
7 changes: 5 additions & 2 deletions src/vstt/meta_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@ def __init__(
self._bool_widgets: dict[str, QtWidgets.QCheckBox] = {}
self._float_widgets: dict[str, QtWidgets.QDoubleSpinBox] = {}

group_box = QtWidgets.QGroupBox("Metadata")
outer_layout = QtWidgets.QVBoxLayout()
outer_layout.addWidget(group_box)
group_box = QtWidgets.QGroupBox("Metadata")
scroll_area = QtWidgets.QScrollArea()
scroll_area.setWidgetResizable(True)
scroll_area.setWidget(group_box)
outer_layout.addWidget(scroll_area)
inner_layout = QtWidgets.QVBoxLayout()
group_box.setLayout(inner_layout)
fields_layout = QtWidgets.QGridLayout()
Expand Down

0 comments on commit fa4cc9f

Please sign in to comment.