Repository navigation
Let inspector parameters be put back #104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -65,6 +65,7 @@ | |
| ) | ||
| from matteloop.ui.crop_presentation import CropPresentation | ||
| from matteloop.ui.inspector_disclosure import configure_disclosure, read_bool | ||
| from matteloop.ui.inspector_reset import build_reset_button | ||
| from matteloop.ui.parameter_presentation import ( | ||
| ParameterPresentation, | ||
| decimal_from_widget_value, | ||
|
|
@@ -170,6 +171,7 @@ def _build_parameter_controls(self) -> None: | |
| self._build_sampling_parameter_controls() | ||
| self._build_cleanup_parameter_controls() | ||
| self._build_output_parameter_controls() | ||
| self.reset_parameters_button = build_reset_button(self.command_requested.emit) | ||
| self._connect_parameter_controls() | ||
|
|
||
| def _build_segmentation_parameter_controls(self) -> None: | ||
|
|
@@ -506,6 +508,7 @@ def apply_parameters( | |
| self.clear_output_directory_button, | ||
| self.output_filename_edit, | ||
| self.max_size_spinbox, | ||
| self.reset_parameters_button, | ||
| ): | ||
| widget.setEnabled(available) | ||
| self.fps_warning.setVisible(available and presentation.fps > 60) | ||
|
|
@@ -764,6 +767,7 @@ def _cleanup_controls(self) -> QWidget: | |
| layout.addRow(self._form_label("Alpha threshold"), self.alpha_threshold_spinbox) | ||
| layout.addRow(self._form_label("Padding"), self.padding_spinbox) | ||
| layout.addRow(self._form_label("Horizontal stretch"), self.stretch_spinbox) | ||
| layout.addRow(self._form_label(""), self.reset_parameters_button) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Quality: Reset button visual placement and tab order disagreeThe reset button is added to Was this helpful? React with 👍 / 👎 |
||
| return controls | ||
|
|
||
| def _output_controls(self) -> QWidget: | ||
|
|
@@ -825,37 +829,33 @@ def parameter_tab_widgets(self) -> tuple[QWidget, ...]: | |
| self.clear_output_directory_button, | ||
| self.output_filename_edit, | ||
| self.max_size_spinbox, | ||
| self.reset_parameters_button, | ||
| ) | ||
|
|
||
| def tab_widgets(self) -> tuple[QWidget, ...]: | ||
| """Return the full inspector tab route in consequence order.""" | ||
| return ( | ||
| self.disclosures["segmentation"][0], | ||
| self.model_picker, | ||
| self.edge_picker, | ||
| self.model_picker, self.edge_picker, | ||
| self.manage_models, | ||
| self.disclosures["time_sampling"][0], | ||
| self.fps_spinbox, | ||
| self.start_spinbox, | ||
| self.end_spinbox, | ||
| self.fps_spinbox, self.start_spinbox, self.end_spinbox, | ||
| self.duration_spinbox, | ||
| self.disclosures["crop_cleanup"][0], | ||
| *self.crop_tab_widgets(), | ||
| self.trim_checkbox, | ||
| self.alpha_threshold_spinbox, | ||
| self.padding_spinbox, | ||
| self.trim_checkbox, self.alpha_threshold_spinbox, self.padding_spinbox, | ||
| self.stretch_spinbox, | ||
| self.disclosures["transform"][0], | ||
| *self.transform_group.tab_widgets(), | ||
| self.disclosures["output"][0], | ||
| self.output_directory_button, | ||
| self.clear_output_directory_button, | ||
| self.output_directory_button, self.clear_output_directory_button, | ||
| self.output_filename_edit, | ||
| self.max_size_spinbox, | ||
| self.disclosures["workspace"][0], | ||
| self.edited_cut_recovery, | ||
| self.rebuild_button, | ||
| self.manage_workspaces, | ||
| self.reset_parameters_button, | ||
| ) | ||
|
|
||
| def crop_tab_widgets(self) -> tuple[QWidget, ...]: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| """Inspector action for restoring creative parameter defaults.""" | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| from collections.abc import Callable | ||
|
|
||
| from PySide6.QtCore import QCoreApplication | ||
| from PySide6.QtWidgets import QPushButton | ||
|
|
||
| from matteloop.core.parameters import ParametersReset | ||
|
|
||
|
|
||
| def build_reset_button(emit: Callable[[object], None]) -> QPushButton: | ||
| """Build the reset action with an honest description of its scope.""" | ||
| button = QPushButton( | ||
| QCoreApplication.translate("Inspector", "Reset to defaults") | ||
| ) | ||
| button.setObjectName("reset_parameters") | ||
| button.setAccessibleName( | ||
| QCoreApplication.translate("Inspector", "Reset inspector parameters") | ||
| ) | ||
| scope = QCoreApplication.translate( | ||
| "Inspector", | ||
| "Compute acceleration, output directory, and output filename are not " | ||
| "affected.", | ||
| ) | ||
|
Comment on lines
+22
to
+26
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Quality: Reset scope text omits preserved crop/transformThe action's description states only "Compute acceleration, output directory, and output filename are not affected.", yet Was this helpful? React with 👍 / 👎 |
||
| button.setToolTip(scope) | ||
| button.setAccessibleDescription(scope) | ||
| button.clicked.connect(lambda: emit(ParametersReset())) | ||
| return button | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Quality: Reset uses CROP_CLEANUP stale reason despite model/edge change
_reduce_parameters_resetalways invalidates withPreviewInvalidationReason.CROP_CLEANUP, even when the reset changedmodel_idoredge_mode(which their own reducers classify as SEGMENTATION) orfps(SAMPLING). The category is purely presentational (it only drives the "preview again" status wording via presenter.py), so this is cosmetic rather than a caching bug, but the message shown after a reset that swapped the model will describe a crop/cleanup change. Consider choosing the most significant reason based on what actually changed.Was this helpful? React with 👍 / 👎