Skip to content
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

style: fix pixel affine table #341

Merged
merged 2 commits into from
Jul 17, 2024

Conversation

tlambert03
Copy link
Member

closes #340

@tlambert03 tlambert03 enabled auto-merge (squash) July 17, 2024 14:29
@gselzer
Copy link
Contributor

gselzer commented Jul 17, 2024

Wow, speedy again @tlambert03!

I checked out 8a49893, and I unfortunately still see the issue 😕. I actually tried something similar yesterday, and was not successful. I can continue tinkering later if you'd like...

image

Copy link

codecov bot commented Jul 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.59%. Comparing base (5957860) to head (8a49893).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #341   +/-   ##
=======================================
  Coverage   90.59%   90.59%           
=======================================
  Files          74       74           
  Lines        8375     8376    +1     
=======================================
+ Hits         7587     7588    +1     
  Misses        788      788           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tlambert03 tlambert03 merged commit cd4351c into pymmcore-plus:main Jul 17, 2024
18 of 19 checks passed
@tlambert03 tlambert03 deleted the fix-pix-table branch July 17, 2024 14:34
@tlambert03
Copy link
Member Author

ok, then the minimumSizeHint is not working on your display for some reason. on my windows it looks fine, but I don't have windows 11. can you show a screenshot of your display settings? including the scale and layout?

@tlambert03
Copy link
Member Author

tlambert03 commented Jul 17, 2024

can you edit the source code to this, and let me know how it looks?

class AffineTable(QTableWidgeT):
    def __init__(self):
        ...
        self.verticalHeader().setDefaultSectionSize(20)

    def sizeHint(self):
        sz = self.minimumSizeHint()
        sz.setHeight(self.rowHeight(0) * 3 + 2)
        return z

@gselzer
Copy link
Contributor

gselzer commented Jul 17, 2024

diff:

diff --git a/src/pymmcore_widgets/_pixel_configuration_widget.py b/src/pymmcore_widgets/_pixel_configuration_widget.py
index ebfebd4..85b4a83 100644
--- a/src/pymmcore_widgets/_pixel_configuration_widget.py
+++ b/src/pymmcore_widgets/_pixel_configuration_widget.py
@@ -482,9 +482,12 @@ class AffineTable(QTableWidget):
         # add a spinbox in each cell of the table
         self._add_table_spinboxes()
         self.setValue(DEFAULT_AFFINE)
+        self.verticalHeader().setDefaultSectionSize(20)
 
     def sizeHint(self) -> Any:
-        return self.minimumSizeHint()
+        sz = self.minimumSizeHint()
+        sz.setHeight(self.rowHeight(0) * 3 + 2)
+        return sz
 
     def _add_table_spinboxes(self) -> None:
         """Add a spinbox in each cell of the table."""

result of python pymmcore-widgets/examples/pixel_configuration_widget.py:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Affine Transformation Table Cutoff on Windows
2 participants