diff options
author | Justin R. Miller <incanus@codesorcery.net> | 2014-06-01 12:12:54 -0700 |
---|---|---|
committer | Justin R. Miller <incanus@codesorcery.net> | 2014-06-01 12:12:54 -0700 |
commit | 4ae6c8ec2c5e608e460c9b69fb6588c1766294ad (patch) | |
tree | 7083f007cb37aa0cf4056b4846602dedb7f70b49 /common | |
parent | 3c249e7c9e57890105653d2ab4718b62c439188c (diff) | |
download | qtlocation-mapboxgl-4ae6c8ec2c5e608e460c9b69fb6588c1766294ad.tar.gz |
fix style toggle on OS X
Diffstat (limited to 'common')
-rw-r--r-- | common/glfw_view.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/common/glfw_view.cpp b/common/glfw_view.cpp index 5c623d7259..43557ee4dc 100644 --- a/common/glfw_view.cpp +++ b/common/glfw_view.cpp @@ -73,8 +73,17 @@ void GLFWView::key(GLFWwindow *window, int key, int /*scancode*/, int action, in view->map->resetPosition(); break; case GLFW_KEY_R: - if (!mods) - view->map->toggleStyle(); + if (!mods) { + std::set<std::string> newAppliedClasses; + if (view->map->getAppliedClasses().count("night")) { + newAppliedClasses.insert("default"); + } else { + newAppliedClasses.insert("default"); + newAppliedClasses.insert(newAppliedClasses.end(), "night"); + } + view->map->setDefaultTransitionDuration(300); + view->map->setAppliedClasses(newAppliedClasses); + } break; case GLFW_KEY_N: if (!mods) |