-
-
Notifications
You must be signed in to change notification settings - Fork 433
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
Made user information window resizable #4009
Conversation
It'd be nice if the image would scale with it, currently all this does is allow the text to get more spaced out. This should be possible by setting the size policies. |
Sure, I'll look into that. |
Just a thought, I did not test this... |
I changed it to give the avatar an expanding size policy. However, this doesn't preserve the aspect ratio of the picture, since it's implemented as a QPixmap placed in a QLabel. From what I've found online it seems that to preserve the aspect ratio one must either subclass QLabel or reimplement resizeEvent to adjust the QPixmap's size when the QLabel's size is changed (currently it is handled with setScaledContents allowing the QLabel to adjust the QPixmap size). |
It is preferable to have the image retain its aspect ratio. |
5e5bcee
to
ca8f359
Compare
My apologies for how long it's taken for me to follow up on this. From everything that I could find online, including other Qt users trying to do something similar, using a QLabel with a QPixmap on top of it does not have a simple, layout-based way to preserve the aspect ratio of the pixmap. I reimplemented the widget's resizeEvent to control the aspect ratio of the pixmap (the alternative seems to be to subclass QLabel to add this behavior). Please let me know if this would be an acceptable approach to solve this. |
Works great! Thanks for coming back to this. I have formatted your pr. |
Thanks for your contribution to my project! We greatly appreciate it :) |
* move db udpate (Cockatrice#4015) * Remove gitlab config (Cockatrice#4037) * revert Cockatrice#2345 * remove gitlab yml * fix message when moving cards to bottom of library (Cockatrice#4006) * Change method of opening directories to be the same for all oses, including linux (Cockatrice#4046) * add opening directory in file browser to linux this uses QDesktopServices to open the url "file://[location]" by default this is "file://$HOME/.local/share/Cockatrice/Cockatrice/pics/CUSTOM" any distro that has a file browser should have an accompanying mime type specifying the file handler for the file:// protocol using the inode/directory mime type see https://specifications.freedesktop.org/shared-mime-info-spec/shared-mime-info-spec-latest.html if a user were to have removed their mime database this will not work and it will fail with nothing but a log message, this would be rare and not worth checking in my opinion * make opening directories the same for all oses * sort headers * Made user information window resizable (Cockatrice#4009) * Added horizontal layout and stretch for player icon (Cockatrice#4052) * Fix unresolved symbols when link tests to system libgtest-dev (Cockatrice#4055) * Enable parallel compilation. (Cockatrice#4057) * travis: update macos 10.15 images (Cockatrice#4059) * Fix release tests (Cockatrice#4063) Co-authored-by: tooomm <tooomm@users.noreply.github.com> Co-authored-by: Lee Tran <54418451+LeeTranMN@users.noreply.github.com> Co-authored-by: ebbit1q <ebbit1q@gmail.com> Co-authored-by: awlangham <awlangham@gmail.com>
Related Ticket(s)
Short roundup of the initial problem
Makes the user information window resizable by the user.
What will change with this Pull Request?
Screenshots
Before resizing:
![image](https://user-images.githubusercontent.com/17144156/82503823-fce11400-9ac7-11ea-88c9-7a2a1ee323de.png)
After resizing (example):
![image](https://user-images.githubusercontent.com/17144156/82503802-f2267f00-9ac7-11ea-89ef-246071e35153.png)