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: get rid of duplicate scale events #5404

Merged
merged 6 commits into from
May 19, 2024

Conversation

Nerixyz
Copy link
Contributor

@Nerixyz Nerixyz commented May 18, 2024

Previously, two scale events were emitted to fix #1266. This PR fixes #1266 by introducing NotebookTab::normalTabWidthForHeight which computes the width for the height after scaling (in NotebookTab::updateSize). This would previously require two invocations (first one to set the height and second one the width). Furthermore, it gets rid of refreshing the notebook too often (~> performing layout for every tab).

As a next step, this PR checks if the scale has changed at all in BaseWidget::setScale. This will probably introduce some bugs, but I think it's better to address these individually instead of spamming scale events (like I did for SplitHeader).

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

src/widgets/helper/NotebookTab.cpp Show resolved Hide resolved
Copy link
Member

@pajlada pajlada left a comment

Choose a reason for hiding this comment

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

Overall looks good, will test & look a bit closer tomorrow

src/widgets/dialogs/SettingsDialog.cpp Outdated Show resolved Hide resolved
@pajlada pajlada enabled auto-merge (squash) May 19, 2024 08:50
@pajlada pajlada merged commit 8689bdb into Chatterino:master May 19, 2024
17 checks passed
@Nerixyz Nerixyz deleted the fix/less-scale branch May 19, 2024 09:12
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.

Tabs are too wide after changing zoom
2 participants