summaryrefslogtreecommitdiff
path: root/macosx
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2015-05-07 10:57:37 +0200
committerKonstantin Käfer <mail@kkaefer.com>2015-05-07 11:01:15 +0200
commit7dbe768ffc91859ace1ea1947698be4db6be9701 (patch)
treeca1e0ec8f1e282e2dfc47773eeaeaa57c3212623 /macosx
parentb7fa1d719677e7782d9a53f8fce92c09b15eba12 (diff)
downloadqtlocation-mapboxgl-7dbe768ffc91859ace1ea1947698be4db6be9701.tar.gz
change the window title to indicate the current style
Diffstat (limited to 'macosx')
-rw-r--r--macosx/main.mm4
1 files changed, 3 insertions, 1 deletions
diff --git a/macosx/main.mm b/macosx/main.mm
index 7922ee7c0e..e5a711753f 100644
--- a/macosx/main.mm
+++ b/macosx/main.mm
@@ -126,7 +126,7 @@ int main() {
map.setBearing(settings.bearing);
map.setDebug(settings.debug);
- view.setChangeStyleCallback([&map] () {
+ view.setChangeStyleCallback([&map, &view] () {
static uint8_t currentStyleIndex;
if (++currentStyleIndex == mbgl::util::defaultStyles.size()) {
@@ -135,6 +135,7 @@ int main() {
const auto& newStyle = mbgl::util::defaultStyles[currentStyleIndex];
map.setStyleURL(newStyle.first);
+ view.setWindowTitle(newStyle.second);
mbgl::Log::Info(mbgl::Event::Setup, std::string("Changed style to: ") + newStyle.first);
});
@@ -147,6 +148,7 @@ int main() {
// Load style
const auto& newStyle = mbgl::util::defaultStyles.front();
map.setStyleURL(newStyle.first);
+ view.setWindowTitle(newStyle.second);
view.run();