Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: set initial size of widgets #5794

Merged
merged 3 commits into from
Jan 12, 2025

Conversation

Nerixyz
Copy link
Contributor

@Nerixyz Nerixyz commented Jan 5, 2025

I was trying to reproduce #5411 and found this bug:

  1. Set scale to something other than 1x (ideally something with a significant difference, so you see the bug)
  2. Close Chatterino
  3. Open Chatterino
  4. Go into the settings and change the scale back to 1x (Default)
  5. Correct (now): The tabs should scale correctly
    Incorrect (before): The tabs kinda stay the same (except for the font)

We didn't save the scale of the window when adding child widgets1. So when the scale changed back to 1x, we'd assume it was 1.0 and return early.

I still can't reproduce #5411. So if anyone has a hint, please put it in the issue. Thank You!

Footnotes

  1. This only works if the parent is set and if the parent has or is a window. I added assert(dynamic_cast<BaseWindow *>(this) || dynamic_cast<BaseWidget *>(this->window())) to test this locally. Only the settings pages don't set the parent. This is fine because they will always be at 1x.

@pajlada pajlada enabled auto-merge (squash) January 12, 2025 11:55
@pajlada pajlada merged commit 3cf5666 into Chatterino:master Jan 12, 2025
18 checks passed
@Nerixyz Nerixyz deleted the fix/mismatched-size branch January 12, 2025 13:37
@2547techno 2547techno mentioned this pull request Jan 18, 2025
4 tasks
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants