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

fix: Set a minimum size for the window #1041

Merged
merged 1 commit into from
Jan 7, 2025
Merged

fix: Set a minimum size for the window #1041

merged 1 commit into from
Jan 7, 2025

Conversation

ashuntu
Copy link
Collaborator

@ashuntu ashuntu commented Jan 6, 2025

Sets a minimum window size to the current default size. The window may be resized to be larger but cannot be resized to be smaller. This also centers the window on the screen when it opens instead of being in the top left corner.

This works, but it might be worth considering an update to https://github.com/ubuntu/yaru_window.dart to include a setMinimumSize and setMaximumSize method to YaruWindow instead of having to use window_manager directly.


UDENG-5682

@ashuntu ashuntu self-assigned this Jan 6, 2025
Copy link

codecov bot commented Jan 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.21%. Comparing base (79a2da7) to head (925c035).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1041      +/-   ##
==========================================
+ Coverage   89.14%   89.21%   +0.06%     
==========================================
  Files         112      112              
  Lines        7498     7498              
==========================================
+ Hits         6684     6689       +5     
+ Misses        638      633       -5     
  Partials      176      176              

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

@CarlosNihelton
Copy link
Contributor

This works, but it might be worth considering an update to https://github.com/ubuntu/yaru_window.dart to include a setMinimumSize and setMaximumSize method to YaruWindow instead of having to use window_manager directly.

I don't disagree in principle, but it's just easier to do what you already did. Also, since yaru_window itself depends on window_manager and yaru on yaru_window, either way we're not pulling more dependencies that what we already do. So this implementation should be just fine.

@ashuntu ashuntu marked this pull request as ready for review January 7, 2025 15:14
@ashuntu ashuntu requested a review from a team as a code owner January 7, 2025 15:14
Copy link
Contributor

@CarlosNihelton CarlosNihelton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ashuntu ashuntu merged commit cba6d5a into main Jan 7, 2025
38 checks passed
@ashuntu ashuntu deleted the minimum-size branch January 7, 2025 16:18
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.

2 participants