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

Use Ctrl+Mouse wheel to increase / decrease the editor font size #328

Merged
merged 1 commit into from
Oct 4, 2017

Conversation

xgouchet
Copy link
Contributor

@xgouchet xgouchet commented Oct 1, 2017

Fixes #244

ReText/editor.py Outdated
@@ -401,6 +401,23 @@ def updateTextStatistics(self):
wordCount += 1
self.statistics = (wordCount, alphaNumCount, characterCount)

def wheelEvent(self, e: QWheelEvent):
Copy link
Member

Choose a reason for hiding this comment

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

This requires Python 3.5, but the README says that ReText works with 3.2 or higher. Please update the README or remove this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry bout that, I'm used to typed languages :/

ReText/editor.py Outdated
if (scroll > 0):
size = size+1
elif (scroll < 0):
size = size-1
Copy link
Member

Choose a reason for hiding this comment

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

size += 1 / size -= 1 would be a bit cleaner.

Also no parentheses are needed around scroll > 0 / scroll < 0 in Python (unlike C-like languages).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, habits from other languages :/

Copy link
Member

@mitya57 mitya57 left a comment

Choose a reason for hiding this comment

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

Pyflakes tells me that wheelEvent for ReTextEdit is already defined on line 146. Please update that method instead of creating new one.

Sorry for not noticing it last time…

Upd: I have added pyflakes to Travis so it will be easier to notice such issues next time.

@mitya57 mitya57 merged commit 78e1e78 into retext-project:master Oct 4, 2017
@xgouchet xgouchet deleted the mouse_zoom branch October 4, 2017 13:17
@mitya57
Copy link
Member

mitya57 commented Oct 4, 2017

Merci!

@xgouchet
Copy link
Contributor Author

xgouchet commented Oct 4, 2017

Anytime ;)

@nodiscc nodiscc mentioned this pull request May 26, 2018
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.

None yet

2 participants