From 2baf8580064ed4e25b3f746f143dea87070efbc1 Mon Sep 17 00:00:00 2001 From: Martin Dvorak Date: Sat, 10 Nov 2018 19:12:27 +0100 Subject: [PATCH] Adding HTML zooming also to O header + updating doc. --- app/src/qt/dialogs/configuration_dialog.cpp | 2 +- app/src/qt/outline_header_view.cpp | 17 +++++++++++++++++ app/src/qt/outline_header_view.h | 1 + build/test-lib-units.sh | 8 ++++---- doc | 2 +- 5 files changed, 24 insertions(+), 6 deletions(-) diff --git a/app/src/qt/dialogs/configuration_dialog.cpp b/app/src/qt/dialogs/configuration_dialog.cpp index e334d3b3..9dfa99e3 100644 --- a/app/src/qt/dialogs/configuration_dialog.cpp +++ b/app/src/qt/dialogs/configuration_dialog.cpp @@ -155,7 +155,7 @@ ConfigurationDialog::ViewerTab::ViewerTab(QWidget *parent) htmlCssThemeCombo->addItem(QString{UI_HTML_THEME_CSS_DARK}); htmlCssThemeCombo->addItem(QString{UI_HTML_THEME_CSS_RAW}); - zoomLabel = new QLabel(tr("HTML zoom (100 is 100%)")+":", this); + zoomLabel = new QLabel(tr("HTML zoom (100 is 100%, Ctrl + mouse wheel)")+":", this); zoomSpin = new QSpinBox(this); zoomSpin->setMinimum(25); zoomSpin->setMaximum(500); diff --git a/app/src/qt/outline_header_view.cpp b/app/src/qt/outline_header_view.cpp index 5a149bf4..cdf2881d 100644 --- a/app/src/qt/outline_header_view.cpp +++ b/app/src/qt/outline_header_view.cpp @@ -83,6 +83,23 @@ void OutlineHeaderView::mouseDoubleClickEvent(QMouseEvent* event) emit signalMouseDoubleClickEvent(); } +void OutlineHeaderView::wheelEvent(QWheelEvent* event) +{ + if(QApplication::keyboardModifiers() & Qt::ControlModifier) { + if(!event->angleDelta().isNull()) { + if(event->angleDelta().ry()>0) { + Configuration::getInstance().incUiHtmlZoom(); + } else { + Configuration::getInstance().decUiHtmlZoom(); + } + setZoomFactor(Configuration::getInstance().getUiHtmlZoomFactor()); + return; + } + } + + QWebView::wheelEvent(event); +} + #endif } // m8r namespace diff --git a/app/src/qt/outline_header_view.h b/app/src/qt/outline_header_view.h index 311daeb7..a7ed8a07 100644 --- a/app/src/qt/outline_header_view.h +++ b/app/src/qt/outline_header_view.h @@ -59,6 +59,7 @@ namespace m8r { bool eventFilter(QObject *obj, QEvent *ev) override; #else virtual void mouseDoubleClickEvent(QMouseEvent* event) override; + virtual void wheelEvent(QWheelEvent*) override; #endif signals: diff --git a/build/test-lib-units.sh b/build/test-lib-units.sh index e3a07ddb..b1365e20 100755 --- a/build/test-lib-units.sh +++ b/build/test-lib-units.sh @@ -17,10 +17,10 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -#export OPTION_RUN_ALL_TESTS=yes # comment this line to run OPTION_TEST only +export OPTION_RUN_ALL_TESTS=yes # comment this line to run OPTION_TEST only export OPTION_RECOMPILE=yes # recompile before running test(s) (comment this line to disable) -#export OPTION_RUN_VALGRIND=yes # run test(s) w/ Valgrind (comment this line to disable) -export OPTION_RUN_GDB=yes # run test(s) w/ GDB (comment this line to disable) +export OPTION_RUN_VALGRIND=yes # run test(s) w/ Valgrind (comment this line to disable) +#export OPTION_RUN_GDB=yes # run test(s) w/ GDB (comment this line to disable) # benchmarks #export OPTION_TEST="AiBenchmark.AaMatrix" @@ -29,7 +29,7 @@ export OPTION_RUN_GDB=yes # run test(s) w/ GDB (comment this line to disable) #export OPTION_TEST="MarkdownParserBenchmark.ParserMeta" # tests -export OPTION_TEST="AutolinkingTestCase.*" +#export OPTION_TEST="AutolinkingTestCase.*" #export OPTION_TEST="FtsTestCase.*" #export OPTION_TEST="TrieTestCase.AddAndSearch" #export OPTION_TEST="FileGearTestCase.DeepCopy" diff --git a/doc b/doc index 3f763ffe..1a0f9f09 160000 --- a/doc +++ b/doc @@ -1 +1 @@ -Subproject commit 3f763ffe31034a9322191292de532fe1927280fa +Subproject commit 1a0f9f09d204177b3331628e6c785630591de0e5