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

Enabled zoom slider for notes widget #1608

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fnkkio
Copy link
Contributor

@fnkkio fnkkio commented Nov 14, 2019

Implements feature #1436

@@ -50,9 +50,12 @@ class NotesContentsWidget final : public ContentsWidget
QIcon getIcon() const override;
ActionsManager::ActionDefinition::State getActionState(int identifier, const QVariantMap &parameters = {}) const override;
bool eventFilter(QObject *object, QEvent *event) override;
virtual bool canZoom() const override;
Copy link
Member

Choose a reason for hiding this comment

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

There should be no virtual keyword here, and methods returning bool values should go after these returningint values.

@@ -263,6 +266,20 @@ void NotesContentsWidget::triggerAction(int identifier, const QVariantMap &param
}
}

void NotesContentsWidget::setZoom(int zoom)
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure if it is the best way to implement it, perhaps it could be achieved using QPlainTextEdit::zoomIn() and QPlainTextEdit::zoomOut(), but this API is kind of crappy. :-/
Anyway, I think that zooming should be implemented in TextEditWidget (adding getZoom() and setZoom()).
Also, using just point size might be risky, since AFAIR it can return 0, we might consider some method in Utils to apply zoom to fonts.

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