diff --git a/scwx-qt/source/scwx/qt/map/radar_site_layer.cpp b/scwx-qt/source/scwx/qt/map/radar_site_layer.cpp index 06d5168f..c7348615 100644 --- a/scwx-qt/source/scwx/qt/map/radar_site_layer.cpp +++ b/scwx-qt/source/scwx/qt/map/radar_site_layer.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include #include @@ -130,7 +131,10 @@ void RadarSiteLayer::Impl::RenderRadarSite( } // Store hover text for mouse picking pass - if (ImGui::IsItemHovered()) + if (settings::TextSettings::Instance() + .radar_site_hover_text_enabled() + .GetValue() && + ImGui::IsItemHovered()) { hoverText_ = fmt::format("{} ({})\n{}\n{}, {}", diff --git a/scwx-qt/source/scwx/qt/settings/text_settings.cpp b/scwx-qt/source/scwx/qt/settings/text_settings.cpp index c6c221d4..d8181df9 100644 --- a/scwx-qt/source/scwx/qt/settings/text_settings.cpp +++ b/scwx-qt/source/scwx/qt/settings/text_settings.cpp @@ -50,6 +50,7 @@ public: hoverTextWrap_.SetMinimum(0); hoverTextWrap_.SetMaximum(999); placefileTextDropShadowEnabled_.SetDefault(true); + radarSiteHoverTextEnabled_.SetDefault(true); tooltipMethod_.SetDefault(defaultTooltipMethodValue); tooltipMethod_.SetValidator( @@ -97,6 +98,8 @@ public: SettingsVariable placefileTextDropShadowEnabled_ { "placefile_text_drop_shadow_enabled"}; + SettingsVariable radarSiteHoverTextEnabled_ { + "radar_site_hover_text_enabled"}; }; TextSettings::TextSettings() : @@ -104,6 +107,7 @@ TextSettings::TextSettings() : { RegisterVariables({&p->hoverTextWrap_, &p->placefileTextDropShadowEnabled_, + &p->radarSiteHoverTextEnabled_, &p->tooltipMethod_}); SetDefaults(); } @@ -173,6 +177,11 @@ SettingsVariable& TextSettings::placefile_text_drop_shadow_enabled() const return p->placefileTextDropShadowEnabled_; } +SettingsVariable& TextSettings::radar_site_hover_text_enabled() const +{ + return p->radarSiteHoverTextEnabled_; +} + SettingsVariable& TextSettings::tooltip_method() const { return p->tooltipMethod_; @@ -190,6 +199,8 @@ bool operator==(const TextSettings& lhs, const TextSettings& rhs) lhs.p->hoverTextWrap_ == rhs.p->hoverTextWrap_ && lhs.p->placefileTextDropShadowEnabled_ == rhs.p->placefileTextDropShadowEnabled_ && + lhs.p->radarSiteHoverTextEnabled_ == + rhs.p->radarSiteHoverTextEnabled_ && lhs.p->tooltipMethod_ == rhs.p->tooltipMethod_); } diff --git a/scwx-qt/source/scwx/qt/settings/text_settings.hpp b/scwx-qt/source/scwx/qt/settings/text_settings.hpp index ac300abf..2be5ab13 100644 --- a/scwx-qt/source/scwx/qt/settings/text_settings.hpp +++ b/scwx-qt/source/scwx/qt/settings/text_settings.hpp @@ -35,6 +35,7 @@ public: SettingsVariable& hover_text_wrap() const; SettingsVariable& placefile_text_drop_shadow_enabled() const; + SettingsVariable& radar_site_hover_text_enabled() const; SettingsVariable& tooltip_method() const; static TextSettings& Instance(); diff --git a/scwx-qt/source/scwx/qt/ui/settings_dialog.cpp b/scwx-qt/source/scwx/qt/ui/settings_dialog.cpp index 09357b60..8d8c89ec 100644 --- a/scwx-qt/source/scwx/qt/ui/settings_dialog.cpp +++ b/scwx-qt/source/scwx/qt/ui/settings_dialog.cpp @@ -139,7 +139,8 @@ public: &alertAudioCounty_, &hoverTextWrap_, &tooltipMethod_, - &placefileTextDropShadowEnabled_}} + &placefileTextDropShadowEnabled_, + &radarSiteHoverTextEnabled_}} { // Configure default alert phenomena colors auto& paletteSettings = settings::PaletteSettings::Instance(); @@ -252,6 +253,7 @@ public: settings::SettingsInterface hoverTextWrap_ {}; settings::SettingsInterface tooltipMethod_ {}; settings::SettingsInterface placefileTextDropShadowEnabled_ {}; + settings::SettingsInterface radarSiteHoverTextEnabled_ {}; std::vector settings_; }; @@ -1118,6 +1120,11 @@ void SettingsDialogImpl::SetupTextTab() textSettings.placefile_text_drop_shadow_enabled()); placefileTextDropShadowEnabled_.SetEditWidget( self_->ui->placefileTextDropShadowCheckBox); + + radarSiteHoverTextEnabled_.SetSettingsVariable( + textSettings.radar_site_hover_text_enabled()); + radarSiteHoverTextEnabled_.SetEditWidget( + self_->ui->radarSiteHoverTextCheckBox); } QImage SettingsDialogImpl::GenerateColorTableImage( diff --git a/scwx-qt/source/scwx/qt/ui/settings_dialog.ui b/scwx-qt/source/scwx/qt/ui/settings_dialog.ui index 7dfea913..faf8437e 100644 --- a/scwx-qt/source/scwx/qt/ui/settings_dialog.ui +++ b/scwx-qt/source/scwx/qt/ui/settings_dialog.ui @@ -373,8 +373,8 @@ 0 0 - 508 - 383 + 514 + 382 @@ -873,27 +873,6 @@ 0 - - - - 999 - - - - - - - - - - ... - - - - :/res/icons/font-awesome-6/rotate-left-solid.svg:/res/icons/font-awesome-6/rotate-left-solid.svg - - - @@ -901,10 +880,10 @@ - - + + - Hover text character wrap (0 to disable) + Radar Site Hover Text Enabled @@ -919,7 +898,35 @@ - + + + + 999 + + + + + + + ... + + + + :/res/icons/font-awesome-6/rotate-left-solid.svg:/res/icons/font-awesome-6/rotate-left-solid.svg + + + + + + + Hover text character wrap (0 to disable) + + + + + + + Placefile Text Drop Shadow diff --git a/test/data b/test/data index e3e743a5..90331f76 160000 --- a/test/data +++ b/test/data @@ -1 +1 @@ -Subproject commit e3e743a5cc9c065d05f00151380fea892fb2156c +Subproject commit 90331f7654586302b223d88329846929514bc883