Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit c5f8fa66 authored by Laurent Montel's avatar Laurent Montel 😁

Fix Bug 387166 - mousewheel should scroll font size in composer

FIXED-IN: 5.7.0
BUG: 387166
parent d34a1fe8
......@@ -630,6 +630,19 @@ bool PlainTextEditor::handleShortcut(QKeyEvent *event)
return false;
}
void PlainTextEditor::wheelEvent(QWheelEvent *event)
{
if (QApplication::keyboardModifiers() & Qt::ControlModifier) {
if (event->delta() > 0) {
zoomIn();
} else if (event->delta() < 0) {
zoomOut();
}
event->accept();
}
}
void PlainTextEditor::keyPressEvent(QKeyEvent *event)
{
if (handleShortcut(event)) {
......
......@@ -99,6 +99,7 @@ protected:
void keyPressEvent(QKeyEvent *event) override;
bool overrideShortcut(QKeyEvent *event);
bool handleShortcut(QKeyEvent *event);
void wheelEvent(QWheelEvent *event) override;
virtual Sonnet::SpellCheckDecorator *createSpellCheckDecorator();
void setHighlighter(Sonnet::Highlighter *_highLighter);
......
......@@ -706,6 +706,18 @@ bool RichTextEditor::event(QEvent *ev)
return QTextEdit::event(ev);
}
void RichTextEditor::wheelEvent(QWheelEvent *event)
{
if (QApplication::keyboardModifiers() & Qt::ControlModifier) {
if (event->delta() > 0) {
zoomIn();
} else if (event->delta() < 0) {
zoomOut();
}
event->accept();
}
}
bool RichTextEditor::handleShortcut(QKeyEvent *event)
{
const int key = event->key() | event->modifiers();
......
......@@ -108,6 +108,7 @@ protected:
void focusInEvent(QFocusEvent *event) override;
bool event(QEvent *ev) override;
void keyPressEvent(QKeyEvent *event) override;
void wheelEvent(QWheelEvent *e) override;
QMenu *mousePopupMenu(QPoint pos);
virtual Sonnet::SpellCheckDecorator *createSpellCheckDecorator();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment