ms-components 0.7.2__tar.gz → 0.7.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ms_components-0.7.2 → ms_components-0.7.3}/PKG-INFO +1 -1
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_stepper.py +70 -49
- ms_components-0.7.3/src/ms_components/ms_table/table_interaction.py +75 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_tutorial/controller.py +8 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components.egg-info/PKG-INFO +1 -1
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components.egg-info/SOURCES.txt +1 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components.egg-info/scm_file_list.json +1 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components.egg-info/scm_version.json +2 -2
- ms_components-0.7.3/tests/test_stepper.py +24 -0
- ms_components-0.7.2/src/ms_components/ms_table/table_interaction.py +0 -43
- {ms_components-0.7.2 → ms_components-0.7.3}/.github/workflows/docs.yml +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/.github/workflows/publish.yml +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/.gitignore +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/LICENSE +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/MANIFEST.in +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/README.md +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/examples/tutorial_demo.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/examples/tutorial_demo.toml +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/licenses/lucide-LICENSE.txt +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/licenses/qt-themes-LICENSE.txt +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/pyproject.toml +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/setup.cfg +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/__init__.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/backdrop.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/base.qss +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/chips.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/icons.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ketcher.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/labels.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/listview.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_dockwidget/__init__.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_dockwidget/resources/__init__.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_dockwidget/resources/icons/__init__.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_dockwidget/resources/icons/folder.svg +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_dockwidget/widget.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_executors.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_monitor/__init__.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_monitor/bridge.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_monitor/config.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_monitor/detail.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_monitor/formatting.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_monitor/icons/cpu.svg +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_monitor/icons/gpu.svg +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_monitor/icons/memory.svg +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_monitor/jobs.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_monitor/models.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_monitor/palette.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_monitor/polling.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_monitor/resources.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_monitor/widget.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_projects/__init__.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_projects/app.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_projects/backend.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_projects/browser.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_projects/scratch.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_projects/widget.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_pymol/__init__.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_pymol/command_line.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_pymol/icons/actions.svg +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_pymol/icons/box.svg +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_pymol/icons/center.svg +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_pymol/icons/display.svg +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_pymol/icons/export.svg +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_pymol/icons/hide.svg +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_pymol/icons/hydrogens-polar.svg +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_pymol/icons/hydrogens.svg +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_pymol/icons/menu.svg +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_pymol/icons/orient.svg +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_pymol/icons/presets.svg +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_pymol/icons/rock.svg +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_pymol/icons/save.svg +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_pymol/icons/selection.svg +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_pymol/icons/settings.svg +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_pymol/icons/style.svg +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_pymol/icons/zoom.svg +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_pymol/plugins.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_pymol/scene.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_pymol/widget.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_settings/__init__.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_settings/panel.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_table/__init__.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_table/action_header.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_table/cell_delegate.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_table/column_panel.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_table/example_usage.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_table/filter_panel.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_table/icons/columns.svg +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_table/icons/export.svg +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_table/icons/filter.svg +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_table/icons/menu.svg +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_table/icons/reload.svg +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_table/icons/search.svg +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_table/icons/settings.svg +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_table/icons/sort-asc.svg +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_table/icons/sort-desc.svg +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_table/icons/sort.svg +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_table/metric_filter_bar.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_table/pagination_control.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_table/query_builder.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_table/session_provider.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_table/smart_table_view.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_table/sort_panel.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_table/table_config.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_table/table_model.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_table/test_external_filters.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_table/test_toolbar.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_tutorial/__init__.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_tutorial/bindings.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_tutorial/models.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_tutorial/overlay.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/opengl.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/pagination.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/palettes.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/step_dialog.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/theme.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/tool_panel.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/wheel.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components.egg-info/dependency_links.txt +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components.egg-info/requires.txt +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components.egg-info/top_level.txt +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/tests/conftest.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/tests/test_app_settings.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/tests/test_chips.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/tests/test_dock_window.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/tests/test_executors_ui.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/tests/test_ketcher.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/tests/test_molsuite_monitor_bridge.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/tests/test_molsuite_monitor_widgets.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/tests/test_monitor_config.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/tests/test_ms_projects_widget.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/tests/test_opengl.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/tests/test_optional_integrations.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/tests/test_progress_column.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/tests/test_project_browser.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/tests/test_pymol_command_line.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/tests/test_pymol_grid.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/tests/test_pymol_scene.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/tests/test_pymol_toolbar.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/tests/test_query_builder_keyset.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/tests/test_shift_hscroll.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/tests/test_split_button_style.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/tests/test_step_dialog.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/tests/test_table_autofill_lifecycle.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/tests/test_table_interaction.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/tests/test_table_toolbar.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/tests/test_table_view_state.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/tests/test_theme_contrast.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/tests/test_theme_menu.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/tests/test_tool_panel.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/tests/test_tutorial.py +0 -0
- {ms_components-0.7.2 → ms_components-0.7.3}/zensical.toml +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ms_components
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.3
|
|
4
4
|
Summary: PySide6 UI components for MolSuite: smart table, project browser, job monitor, PyMOL dock, steppers.
|
|
5
5
|
Author: Mario S. Valdés-Tresanco, Mario E. Valdés-Tresanco
|
|
6
6
|
License-Expression: MIT
|
|
@@ -633,7 +633,7 @@ class QStepper(QWidget):
|
|
|
633
633
|
title, caption, icon, **kwargs)
|
|
634
634
|
step.changed.connect(self._refresh_headers)
|
|
635
635
|
self._steps.append(step)
|
|
636
|
-
self.
|
|
636
|
+
self._append(step)
|
|
637
637
|
if self._current == -1:
|
|
638
638
|
self.set_current_index(0)
|
|
639
639
|
return step
|
|
@@ -746,6 +746,27 @@ class QStepper(QWidget):
|
|
|
746
746
|
if 0 <= self._current < len(self._steps):
|
|
747
747
|
self._sync_content()
|
|
748
748
|
|
|
749
|
+
def _append(self, step: QStep) -> None:
|
|
750
|
+
"""Add the new step's header and page; the steps already there stay where they are.
|
|
751
|
+
Taking them out and putting them back (a rebuild per step) re-parents and re-polishes
|
|
752
|
+
every widget they hold: 270 ms for the four steps of a docking studio."""
|
|
753
|
+
index = len(self._steps) - 1
|
|
754
|
+
if self.orientation == Orientation.HORIZONTAL:
|
|
755
|
+
if index:
|
|
756
|
+
self._header.addWidget(self._make_hconnector(), 1, self._header_align)
|
|
757
|
+
self._header.addWidget(self._header_item(index), 0, self._header_align)
|
|
758
|
+
self._stack.addWidget(step)
|
|
759
|
+
else:
|
|
760
|
+
self._column.insertWidget(index, self._vertical_block(index, step)) # before the stretch
|
|
761
|
+
self._refresh_headers()
|
|
762
|
+
self._refresh_nav()
|
|
763
|
+
|
|
764
|
+
def _header_item(self, index: int) -> "_HeaderItem":
|
|
765
|
+
item = _HeaderItem(self.theme.diameter, self.alternative_labels)
|
|
766
|
+
item.clicked.connect(lambda idx=index: self._on_header_clicked(idx))
|
|
767
|
+
self._header_items.append(item)
|
|
768
|
+
return item
|
|
769
|
+
|
|
749
770
|
def _make_hconnector(self) -> QWidget:
|
|
750
771
|
line = QFrame()
|
|
751
772
|
line.setObjectName("stepperConnector")
|
|
@@ -774,15 +795,11 @@ class QStepper(QWidget):
|
|
|
774
795
|
align = (Qt.AlignmentFlag.AlignTop if self.alternative_labels
|
|
775
796
|
else Qt.AlignmentFlag.AlignVCenter)
|
|
776
797
|
|
|
798
|
+
self._header, self._header_align = h, align
|
|
777
799
|
for i, step in enumerate(self._steps):
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
self.
|
|
781
|
-
h.addWidget(item, 0, align)
|
|
782
|
-
if i < len(self._steps) - 1:
|
|
783
|
-
conn = self._make_hconnector()
|
|
784
|
-
h.addWidget(conn, 1, align if self.alternative_labels
|
|
785
|
-
else Qt.AlignmentFlag.AlignVCenter)
|
|
800
|
+
if i:
|
|
801
|
+
h.addWidget(self._make_hconnector(), 1, align)
|
|
802
|
+
h.addWidget(self._header_item(i), 0, align)
|
|
786
803
|
|
|
787
804
|
self._root.addWidget(header)
|
|
788
805
|
|
|
@@ -803,51 +820,55 @@ class QStepper(QWidget):
|
|
|
803
820
|
v.setContentsMargins(0, 0, 0, 0)
|
|
804
821
|
v.setSpacing(0)
|
|
805
822
|
|
|
823
|
+
self._column = v
|
|
806
824
|
for i, step in enumerate(self._steps):
|
|
807
|
-
|
|
808
|
-
row = QHBoxLayout(block)
|
|
809
|
-
row.setContentsMargins(0, 0, 0, 0)
|
|
810
|
-
row.setSpacing(8)
|
|
811
|
-
|
|
812
|
-
rail = _VRail(self.theme.diameter, self.theme.connector)
|
|
813
|
-
rail.clicked.connect(lambda idx=i: self._on_header_clicked(idx))
|
|
814
|
-
self._rails.append(rail)
|
|
815
|
-
|
|
816
|
-
right = QVBoxLayout()
|
|
817
|
-
right.setContentsMargins(0, 0, 0, 0)
|
|
818
|
-
right.setSpacing(2)
|
|
819
|
-
|
|
820
|
-
title_lbl = QLabel(step.title)
|
|
821
|
-
caption_lbl = QLabel(step.caption)
|
|
822
|
-
title_lbl.setObjectName("stepperTitle")
|
|
823
|
-
caption_lbl.setObjectName("stepperCaption")
|
|
824
|
-
cf = QFont(caption_lbl.font())
|
|
825
|
-
cf.setPointSizeF(max(8.0, cf.pointSizeF() - 1.5))
|
|
826
|
-
caption_lbl.setFont(cf)
|
|
827
|
-
caption_lbl.setVisible(bool(step.caption))
|
|
828
|
-
rail._title_lbl = title_lbl # type: ignore[attr-defined]
|
|
829
|
-
rail._caption_lbl = caption_lbl # type: ignore[attr-defined]
|
|
830
|
-
|
|
831
|
-
if self.inline_label:
|
|
832
|
-
head = QHBoxLayout()
|
|
833
|
-
head.setContentsMargins(0, 0, 0, 0)
|
|
834
|
-
head.setSpacing(8)
|
|
835
|
-
head.addWidget(title_lbl)
|
|
836
|
-
head.addWidget(caption_lbl)
|
|
837
|
-
head.addStretch(1)
|
|
838
|
-
right.addLayout(head)
|
|
839
|
-
else:
|
|
840
|
-
right.addWidget(title_lbl)
|
|
841
|
-
right.addWidget(caption_lbl)
|
|
842
|
-
right.addWidget(step)
|
|
843
|
-
|
|
844
|
-
row.addWidget(rail, 0, Qt.AlignmentFlag.AlignTop)
|
|
845
|
-
row.addLayout(right, 1)
|
|
846
|
-
v.addWidget(block)
|
|
825
|
+
v.addWidget(self._vertical_block(i, step))
|
|
847
826
|
|
|
848
827
|
v.addStretch(1)
|
|
849
828
|
self._root.addWidget(container, 1)
|
|
850
829
|
|
|
830
|
+
def _vertical_block(self, i: int, step: QStep) -> QWidget:
|
|
831
|
+
block = QWidget()
|
|
832
|
+
row = QHBoxLayout(block)
|
|
833
|
+
row.setContentsMargins(0, 0, 0, 0)
|
|
834
|
+
row.setSpacing(8)
|
|
835
|
+
|
|
836
|
+
rail = _VRail(self.theme.diameter, self.theme.connector)
|
|
837
|
+
rail.clicked.connect(lambda idx=i: self._on_header_clicked(idx))
|
|
838
|
+
self._rails.append(rail)
|
|
839
|
+
|
|
840
|
+
right = QVBoxLayout()
|
|
841
|
+
right.setContentsMargins(0, 0, 0, 0)
|
|
842
|
+
right.setSpacing(2)
|
|
843
|
+
|
|
844
|
+
title_lbl = QLabel(step.title)
|
|
845
|
+
caption_lbl = QLabel(step.caption)
|
|
846
|
+
title_lbl.setObjectName("stepperTitle")
|
|
847
|
+
caption_lbl.setObjectName("stepperCaption")
|
|
848
|
+
cf = QFont(caption_lbl.font())
|
|
849
|
+
cf.setPointSizeF(max(8.0, cf.pointSizeF() - 1.5))
|
|
850
|
+
caption_lbl.setFont(cf)
|
|
851
|
+
caption_lbl.setVisible(bool(step.caption))
|
|
852
|
+
rail._title_lbl = title_lbl # type: ignore[attr-defined]
|
|
853
|
+
rail._caption_lbl = caption_lbl # type: ignore[attr-defined]
|
|
854
|
+
|
|
855
|
+
if self.inline_label:
|
|
856
|
+
head = QHBoxLayout()
|
|
857
|
+
head.setContentsMargins(0, 0, 0, 0)
|
|
858
|
+
head.setSpacing(8)
|
|
859
|
+
head.addWidget(title_lbl)
|
|
860
|
+
head.addWidget(caption_lbl)
|
|
861
|
+
head.addStretch(1)
|
|
862
|
+
right.addLayout(head)
|
|
863
|
+
else:
|
|
864
|
+
right.addWidget(title_lbl)
|
|
865
|
+
right.addWidget(caption_lbl)
|
|
866
|
+
right.addWidget(step)
|
|
867
|
+
|
|
868
|
+
row.addWidget(rail, 0, Qt.AlignmentFlag.AlignTop)
|
|
869
|
+
row.addLayout(right, 1)
|
|
870
|
+
return block
|
|
871
|
+
|
|
851
872
|
# =====================================================================
|
|
852
873
|
# State / colour refresh
|
|
853
874
|
# =====================================================================
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"""Table input signals, independent of any viewer or data model."""
|
|
2
|
+
|
|
3
|
+
from PySide6.QtCore import QEvent, QObject, Qt, Signal
|
|
4
|
+
from PySide6.QtWidgets import QAbstractItemView, QWidget
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class _Hub(QObject):
|
|
8
|
+
"""Where every table's `TableInteraction` repeats what it saw, for those that watch a window."""
|
|
9
|
+
|
|
10
|
+
pressed = Signal(object, object, Qt.KeyboardModifiers)
|
|
11
|
+
reselected = Signal(object, object, Qt.KeyboardModifiers)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
_hub: _Hub | None = None
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def _the_hub() -> _Hub:
|
|
18
|
+
global _hub
|
|
19
|
+
if _hub is None:
|
|
20
|
+
_hub = _Hub()
|
|
21
|
+
return _hub
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class TableInteraction(QObject):
|
|
25
|
+
"""Observe one Qt table, or the tables under a window, including tables added later.
|
|
26
|
+
|
|
27
|
+
``pressed(view, index, modifiers)`` precedes native selection changes;
|
|
28
|
+
``reselected`` reports a click on an already selected cell.
|
|
29
|
+
|
|
30
|
+
A window hears the tables that have one of their own (every `SmartTableView` has): a filter
|
|
31
|
+
on the whole application, the way it was done before, put each of its events through Python,
|
|
32
|
+
some 40 ms of every big view opened.
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
pressed = Signal(object, object, Qt.KeyboardModifiers)
|
|
36
|
+
reselected = Signal(object, object, Qt.KeyboardModifiers)
|
|
37
|
+
|
|
38
|
+
def __init__(self, parent: QWidget):
|
|
39
|
+
super().__init__(parent)
|
|
40
|
+
self._pressed = None
|
|
41
|
+
hub = _the_hub()
|
|
42
|
+
if isinstance(parent, QAbstractItemView):
|
|
43
|
+
parent.viewport().installEventFilter(self)
|
|
44
|
+
else:
|
|
45
|
+
hub.pressed.connect(self._heard_pressed)
|
|
46
|
+
hub.reselected.connect(self._heard_reselected)
|
|
47
|
+
|
|
48
|
+
def _under(self, view) -> bool:
|
|
49
|
+
return view is self.parent() or self.parent().isAncestorOf(view)
|
|
50
|
+
|
|
51
|
+
def _heard_pressed(self, view, index, modifiers) -> None:
|
|
52
|
+
if self._under(view):
|
|
53
|
+
self.pressed.emit(view, index, modifiers)
|
|
54
|
+
|
|
55
|
+
def _heard_reselected(self, view, index, modifiers) -> None:
|
|
56
|
+
if self._under(view):
|
|
57
|
+
self.reselected.emit(view, index, modifiers)
|
|
58
|
+
|
|
59
|
+
def eventFilter(self, watched, event):
|
|
60
|
+
view = self.parent()
|
|
61
|
+
if event.type() == QEvent.Type.MouseButtonPress and event.button() == Qt.MouseButton.LeftButton:
|
|
62
|
+
index = view.indexAt(event.position().toPoint())
|
|
63
|
+
if index.isValid():
|
|
64
|
+
modifiers = event.modifiers()
|
|
65
|
+
self._pressed = (index, modifiers, view.selectionModel().isSelected(index))
|
|
66
|
+
self.pressed.emit(view, index, modifiers)
|
|
67
|
+
_the_hub().pressed.emit(view, index, modifiers)
|
|
68
|
+
elif event.type() == QEvent.Type.MouseButtonRelease and self._pressed is not None:
|
|
69
|
+
index, modifiers, was_selected = self._pressed
|
|
70
|
+
self._pressed = None
|
|
71
|
+
if (event.button() == Qt.MouseButton.LeftButton and was_selected
|
|
72
|
+
and view.indexAt(event.position().toPoint()) == index):
|
|
73
|
+
self.reselected.emit(view, index, modifiers)
|
|
74
|
+
_the_hub().reselected.emit(view, index, modifiers)
|
|
75
|
+
return False # never touch a deleted `watched` (teardown re-enters filters; errors chain and balloon)
|
|
@@ -262,7 +262,15 @@ class TutorialController(QObject):
|
|
|
262
262
|
else:
|
|
263
263
|
self.stop()
|
|
264
264
|
|
|
265
|
+
# The only event types the filter acts on; any other one leaves it at the first line.
|
|
266
|
+
_FILTERED = frozenset((QEvent.Type.KeyPress, QEvent.Type.KeyRelease, QEvent.Type.Close,
|
|
267
|
+
QEvent.Type.ShortcutOverride, QEvent.Type.FocusIn))
|
|
268
|
+
|
|
265
269
|
def eventFilter(self, watched: QObject, event: QEvent) -> bool:
|
|
270
|
+
# Installed on the whole app: building a big view sends it ~20k events, 160 ms in all
|
|
271
|
+
# when each one reached watched.window().
|
|
272
|
+
if event.type() not in self._FILTERED:
|
|
273
|
+
return False
|
|
266
274
|
if (self.is_active and self.block_tab and isinstance(watched, QWidget)
|
|
267
275
|
and event.type() in (QEvent.Type.KeyPress, QEvent.Type.KeyRelease)
|
|
268
276
|
and event.key() in (Qt.Key.Key_Tab, Qt.Key.Key_Backtab)):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ms_components
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.3
|
|
4
4
|
Summary: PySide6 UI components for MolSuite: smart table, project browser, job monitor, PyMOL dock, steppers.
|
|
5
5
|
Author: Mario S. Valdés-Tresanco, Mario E. Valdés-Tresanco
|
|
6
6
|
License-Expression: MIT
|
|
@@ -137,6 +137,7 @@ tests/test_query_builder_keyset.py
|
|
|
137
137
|
tests/test_shift_hscroll.py
|
|
138
138
|
tests/test_split_button_style.py
|
|
139
139
|
tests/test_step_dialog.py
|
|
140
|
+
tests/test_stepper.py
|
|
140
141
|
tests/test_table_autofill_lifecycle.py
|
|
141
142
|
tests/test_table_interaction.py
|
|
142
143
|
tests/test_table_toolbar.py
|
|
@@ -141,6 +141,7 @@
|
|
|
141
141
|
"tests/test_shift_hscroll.py",
|
|
142
142
|
"tests/test_split_button_style.py",
|
|
143
143
|
"tests/test_step_dialog.py",
|
|
144
|
+
"tests/test_stepper.py",
|
|
144
145
|
"tests/test_table_autofill_lifecycle.py",
|
|
145
146
|
"tests/test_table_interaction.py",
|
|
146
147
|
"tests/test_table_toolbar.py",
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import pytest
|
|
2
|
+
from PySide6.QtWidgets import QApplication, QLabel
|
|
3
|
+
|
|
4
|
+
from ms_components.ms_stepper import Orientation, QStepper
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@pytest.mark.parametrize("orientation", [Orientation.HORIZONTAL, Orientation.VERTICAL])
|
|
8
|
+
def test_a_new_step_leaves_the_others_where_they_are(orientation):
|
|
9
|
+
QApplication.instance() or QApplication([])
|
|
10
|
+
stepper = QStepper(orientation=orientation, linear=False)
|
|
11
|
+
first = stepper.add_step("One")
|
|
12
|
+
first.add_widget(QLabel("page one"))
|
|
13
|
+
parent = first.parentWidget()
|
|
14
|
+
second, third = stepper.add_step("Two"), stepper.add_step("Three")
|
|
15
|
+
|
|
16
|
+
assert first.parentWidget() is parent # not taken out and put back
|
|
17
|
+
assert stepper.count() == 3 and stepper.current_index == 0
|
|
18
|
+
assert len(stepper._header_items or stepper._rails) == 3
|
|
19
|
+
stepper.go_to(third)
|
|
20
|
+
assert stepper.current_step() is third
|
|
21
|
+
if orientation == Orientation.HORIZONTAL:
|
|
22
|
+
assert stepper._stack.currentWidget() is third and stepper._stack.count() == 3
|
|
23
|
+
else:
|
|
24
|
+
assert third.isVisibleTo(stepper) and not second.isVisibleTo(stepper)
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"""Table input signals, independent of any viewer or data model."""
|
|
2
|
-
|
|
3
|
-
from PySide6.QtCore import QEvent, QObject, Qt, Signal
|
|
4
|
-
from PySide6.QtWidgets import QAbstractItemView, QApplication, QWidget
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class TableInteraction(QObject):
|
|
8
|
-
"""Observe one Qt table or the tables under a window, including tables added later.
|
|
9
|
-
|
|
10
|
-
``pressed(view, index, modifiers)`` precedes native selection changes;
|
|
11
|
-
``reselected`` reports a click on an already selected cell.
|
|
12
|
-
"""
|
|
13
|
-
|
|
14
|
-
pressed = Signal(object, object, Qt.KeyboardModifiers)
|
|
15
|
-
reselected = Signal(object, object, Qt.KeyboardModifiers)
|
|
16
|
-
|
|
17
|
-
def __init__(self, parent: QWidget):
|
|
18
|
-
super().__init__(parent)
|
|
19
|
-
self._pressed = None
|
|
20
|
-
if isinstance(parent, QAbstractItemView):
|
|
21
|
-
parent.viewport().installEventFilter(self)
|
|
22
|
-
else:
|
|
23
|
-
QApplication.instance().installEventFilter(self)
|
|
24
|
-
|
|
25
|
-
def eventFilter(self, watched, event):
|
|
26
|
-
kind = event.type() # read once: window-wide, this runs for every event in the app
|
|
27
|
-
if (kind == QEvent.Type.MouseButtonPress
|
|
28
|
-
and event.button() == Qt.MouseButton.LeftButton
|
|
29
|
-
and isinstance(watched, QWidget)):
|
|
30
|
-
view = watched.parentWidget()
|
|
31
|
-
if (isinstance(view, QAbstractItemView) and watched is view.viewport()
|
|
32
|
-
and (view is self.parent() or self.parent().isAncestorOf(view))):
|
|
33
|
-
index = view.indexAt(event.position().toPoint())
|
|
34
|
-
if index.isValid():
|
|
35
|
-
self._pressed = (view, index, event.modifiers(), view.selectionModel().isSelected(index))
|
|
36
|
-
self.pressed.emit(view, index, event.modifiers())
|
|
37
|
-
elif kind == QEvent.Type.MouseButtonRelease and self._pressed is not None:
|
|
38
|
-
view, index, modifiers, was_selected = self._pressed
|
|
39
|
-
self._pressed = None
|
|
40
|
-
if (event.button() == Qt.MouseButton.LeftButton and watched is view.viewport()
|
|
41
|
-
and was_selected and view.indexAt(event.position().toPoint()) == index):
|
|
42
|
-
self.reselected.emit(view, index, modifiers)
|
|
43
|
-
return False # never touch a deleted `watched` (teardown re-enters filters; errors chain and balloon)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_dockwidget/resources/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_pymol/icons/hydrogens-polar.svg
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_table/pagination_control.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ms_components-0.7.2 → ms_components-0.7.3}/src/ms_components/ms_table/test_external_filters.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|