summaryrefslogtreecommitdiff
path: root/platform/qt/app/mapwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'platform/qt/app/mapwindow.cpp')
-rw-r--r--platform/qt/app/mapwindow.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/platform/qt/app/mapwindow.cpp b/platform/qt/app/mapwindow.cpp
index 35f56a0bef..da8a9767ce 100644
--- a/platform/qt/app/mapwindow.cpp
+++ b/platform/qt/app/mapwindow.cpp
@@ -67,6 +67,8 @@ void MapWindow::changeStyle()
void MapWindow::keyPressEvent(QKeyEvent *ev)
{
+ static const QMapbox::TransitionOptions transition { 300, {} };
+
switch (ev->key()) {
case Qt::Key_S:
changeStyle();
@@ -74,6 +76,13 @@ void MapWindow::keyPressEvent(QKeyEvent *ev)
case Qt::Key_Tab:
m_map.cycleDebugOptions();
break;
+ case Qt::Key_R:
+ if (m_map.hasClass("night")) {
+ m_map.removeClass("night", transition);
+ } else {
+ m_map.addClass("night", transition);
+ }
+ break;
default:
break;
}