Skip to content

Conversation

@hikmet517
Copy link
Contributor

Update line number width when zooming. Calculating number width using font() does not take zoom into account. So, the overload of setMarginWidth with QString as second parameter was used. This way we leave the width calculation to QScintilla which considers the zoom while calculating.

@mgrojo mgrojo merged commit 4dedbba into sqlitebrowser:master Sep 13, 2022
@mgrojo
Copy link
Member

mgrojo commented Sep 13, 2022

Thanks heap, @hikmet517

@justinclift
Copy link
Member

Just noticed this PR seems to drop support for Qt versions prior to 5.11. Hopefully that doesn't cause any issues. eg for anyone compiling this on enterprise and long term support releases of OS's. 😄

@mgrojo
Copy link
Member

mgrojo commented Sep 13, 2022

Just noticed this PR seems to drop support for Qt versions prior to 5.11. Hopefully that doesn't cause any issues. eg for anyone compiling this on enterprise and long term support releases of OS's. smile

Don't worry, the version check was due to the use of QFontMetrics::horizontalAdvance(), which was introduced in 5.11. The new code is simpler on the Qt side now, because @hikmet517 has delegated the logic to QScintilla, and should compile on every Qt5 out there.

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.

3 participants