Skip to content

Commit

Permalink
Adding HTML zooming also to O header + updating doc.
Browse files Browse the repository at this point in the history
  • Loading branch information
dvorka committed Nov 10, 2018
1 parent c8a39ae commit 2baf858
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/src/qt/dialogs/configuration_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
17 changes: 17 additions & 0 deletions app/src/qt/outline_header_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions app/src/qt/outline_header_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions build/test-lib-units.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

#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"
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion doc

0 comments on commit 2baf858

Please sign in to comment.