diff --git a/scwx-qt/source/scwx/qt/map/map_widget.cpp b/scwx-qt/source/scwx/qt/map/map_widget.cpp index d3c7fefc..9c222ef6 100644 --- a/scwx-qt/source/scwx/qt/map/map_widget.cpp +++ b/scwx-qt/source/scwx/qt/map/map_widget.cpp @@ -1020,11 +1020,14 @@ void MapWidget::UpdateMouseCoordinate(const common::Coordinate& coordinate) { if (p->context_->mouse_coordinate() != coordinate) { + auto& generalSettings = settings::GeneralSettings::Instance(); + p->context_->set_mouse_coordinate(coordinate); auto keyboardModifiers = QGuiApplication::keyboardModifiers(); - if (keyboardModifiers != Qt::KeyboardModifier::NoModifier || + if (generalSettings.cursor_icon_always_on().GetValue() || + keyboardModifiers != Qt::KeyboardModifier::NoModifier || keyboardModifiers != p->lastKeyboardModifiers_) { QMetaObject::invokeMethod( diff --git a/scwx-qt/source/scwx/qt/map/overlay_layer.cpp b/scwx-qt/source/scwx/qt/map/overlay_layer.cpp index 9640a705..b9393ee0 100644 --- a/scwx-qt/source/scwx/qt/map/overlay_layer.cpp +++ b/scwx-qt/source/scwx/qt/map/overlay_layer.cpp @@ -328,9 +328,13 @@ void OverlayLayer::Render(const QMapLibre::CustomLayerRenderParameters& params) p->activeBoxInner_->SetBorder(1.0f * pixelRatio, {255, 255, 255, 255}); } + auto& generalSettings = settings::GeneralSettings::Instance(); + // Cursor Icon - bool cursorIconVisible = QGuiApplication::keyboardModifiers() & - Qt::KeyboardModifier::ControlModifier; + bool cursorIconVisible = + generalSettings.cursor_icon_always_on().GetValue() || + (QGuiApplication::keyboardModifiers() & + Qt::KeyboardModifier::ControlModifier); p->geoIcons_->SetIconVisible(p->cursorIcon_, cursorIconVisible); if (cursorIconVisible) { @@ -434,8 +438,6 @@ void OverlayLayer::Render(const QMapLibre::CustomLayerRenderParameters& params) ImGui::End(); } - auto& generalSettings = settings::GeneralSettings::Instance(); - // Map Center Icon if (params.width != p->lastWidth_ || params.height != p->lastHeight_) { diff --git a/scwx-qt/source/scwx/qt/settings/general_settings.cpp b/scwx-qt/source/scwx/qt/settings/general_settings.cpp index 9eca4348..3c0ee929 100644 --- a/scwx-qt/source/scwx/qt/settings/general_settings.cpp +++ b/scwx-qt/source/scwx/qt/settings/general_settings.cpp @@ -77,6 +77,7 @@ class GeneralSettings::Impl trackLocation_.SetDefault(false); updateNotificationsEnabled_.SetDefault(true); warningsProvider_.SetDefault(defaultWarningsProviderValue); + cursorIconAlwaysOn_.SetDefault(false); fontSizes_.SetElementMinimum(1); fontSizes_.SetElementMaximum(72); @@ -166,6 +167,7 @@ class GeneralSettings::Impl SettingsVariable trackLocation_ {"track_location"}; SettingsVariable updateNotificationsEnabled_ {"update_notifications"}; SettingsVariable warningsProvider_ {"warnings_provider"}; + SettingsVariable cursorIconAlwaysOn_ {"cursor_icon_always_on"}; }; GeneralSettings::GeneralSettings() : @@ -198,7 +200,8 @@ GeneralSettings::GeneralSettings() : &p->themeFile_, &p->trackLocation_, &p->updateNotificationsEnabled_, - &p->warningsProvider_}); + &p->warningsProvider_, + &p->cursorIconAlwaysOn_}); SetDefaults(); } GeneralSettings::~GeneralSettings() = default; @@ -348,6 +351,11 @@ SettingsVariable& GeneralSettings::warnings_provider() const return p->warningsProvider_; } +SettingsVariable& GeneralSettings::cursor_icon_always_on() const +{ + return p->cursorIconAlwaysOn_; +} + bool GeneralSettings::Shutdown() { bool dataChanged = false; @@ -397,7 +405,8 @@ bool operator==(const GeneralSettings& lhs, const GeneralSettings& rhs) lhs.p->trackLocation_ == rhs.p->trackLocation_ && lhs.p->updateNotificationsEnabled_ == rhs.p->updateNotificationsEnabled_ && - lhs.p->warningsProvider_ == rhs.p->warningsProvider_); + lhs.p->warningsProvider_ == rhs.p->warningsProvider_ && + lhs.p->cursorIconAlwaysOn_ == rhs.p->cursorIconAlwaysOn_); } } // namespace settings diff --git a/scwx-qt/source/scwx/qt/settings/general_settings.hpp b/scwx-qt/source/scwx/qt/settings/general_settings.hpp index 3e527238..46004c57 100644 --- a/scwx-qt/source/scwx/qt/settings/general_settings.hpp +++ b/scwx-qt/source/scwx/qt/settings/general_settings.hpp @@ -53,6 +53,7 @@ class GeneralSettings : public SettingsCategory SettingsVariable& track_location() const; SettingsVariable& update_notifications_enabled() const; SettingsVariable& warnings_provider() const; + SettingsVariable& cursor_icon_always_on() const; static GeneralSettings& Instance(); diff --git a/scwx-qt/source/scwx/qt/ui/settings_dialog.cpp b/scwx-qt/source/scwx/qt/ui/settings_dialog.cpp index a9b81706..69c3a387 100644 --- a/scwx-qt/source/scwx/qt/ui/settings_dialog.cpp +++ b/scwx-qt/source/scwx/qt/ui/settings_dialog.cpp @@ -137,6 +137,7 @@ class SettingsDialogImpl &showMapCenter_, &showMapLogo_, &updateNotificationsEnabled_, + &cursorIconAlwaysOn_, &debugEnabled_, &alertAudioSoundFile_, &alertAudioLocationMethod_, @@ -251,6 +252,7 @@ class SettingsDialogImpl settings::SettingsInterface showMapCenter_ {}; settings::SettingsInterface showMapLogo_ {}; settings::SettingsInterface updateNotificationsEnabled_ {}; + settings::SettingsInterface cursorIconAlwaysOn_ {}; settings::SettingsInterface debugEnabled_ {}; std::unordered_map> @@ -762,6 +764,10 @@ void SettingsDialogImpl::SetupGeneralTab() updateNotificationsEnabled_.SetEditWidget( self_->ui->enableUpdateNotificationsCheckBox); + cursorIconAlwaysOn_.SetSettingsVariable( + generalSettings.cursor_icon_always_on()); + cursorIconAlwaysOn_.SetEditWidget(self_->ui->cursorIconAlwaysOnCheckBox); + debugEnabled_.SetSettingsVariable(generalSettings.debug_enabled()); debugEnabled_.SetEditWidget(self_->ui->debugEnabledCheckBox); } diff --git a/scwx-qt/source/scwx/qt/ui/settings_dialog.ui b/scwx-qt/source/scwx/qt/ui/settings_dialog.ui index f66aba6c..12bcbc0e 100644 --- a/scwx-qt/source/scwx/qt/ui/settings_dialog.ui +++ b/scwx-qt/source/scwx/qt/ui/settings_dialog.ui @@ -135,9 +135,9 @@ 0 - -133 + -246 511 - 676 + 703 @@ -590,6 +590,19 @@ + + + + false + + + + + + Multi-Pane Cursor Marker Always On + + + diff --git a/test/data b/test/data index a642d730..eaf8f185 160000 --- a/test/data +++ b/test/data @@ -1 +1 @@ -Subproject commit a642d730bd8d6c9b291b90e61b3a3a389139f2f6 +Subproject commit eaf8f185ce2b3a3248da1a4d6c8e2e9265638f15