Merge branch 'develop' into feature/radar-smoothing

This commit is contained in:
Dan Paulat 2024-12-03 23:30:06 -06:00
commit b93c76ef1b
7 changed files with 44 additions and 10 deletions

View file

@ -1039,11 +1039,14 @@ void MapWidget::UpdateMouseCoordinate(const common::Coordinate& coordinate)
{ {
if (p->context_->mouse_coordinate() != coordinate) if (p->context_->mouse_coordinate() != coordinate)
{ {
auto& generalSettings = settings::GeneralSettings::Instance();
p->context_->set_mouse_coordinate(coordinate); p->context_->set_mouse_coordinate(coordinate);
auto keyboardModifiers = QGuiApplication::keyboardModifiers(); auto keyboardModifiers = QGuiApplication::keyboardModifiers();
if (keyboardModifiers != Qt::KeyboardModifier::NoModifier || if (generalSettings.cursor_icon_always_on().GetValue() ||
keyboardModifiers != Qt::KeyboardModifier::NoModifier ||
keyboardModifiers != p->lastKeyboardModifiers_) keyboardModifiers != p->lastKeyboardModifiers_)
{ {
QMetaObject::invokeMethod( QMetaObject::invokeMethod(

View file

@ -328,9 +328,13 @@ void OverlayLayer::Render(const QMapLibre::CustomLayerRenderParameters& params)
p->activeBoxInner_->SetBorder(1.0f * pixelRatio, {255, 255, 255, 255}); p->activeBoxInner_->SetBorder(1.0f * pixelRatio, {255, 255, 255, 255});
} }
auto& generalSettings = settings::GeneralSettings::Instance();
// Cursor Icon // Cursor Icon
bool cursorIconVisible = QGuiApplication::keyboardModifiers() & bool cursorIconVisible =
Qt::KeyboardModifier::ControlModifier; generalSettings.cursor_icon_always_on().GetValue() ||
(QGuiApplication::keyboardModifiers() &
Qt::KeyboardModifier::ControlModifier);
p->geoIcons_->SetIconVisible(p->cursorIcon_, cursorIconVisible); p->geoIcons_->SetIconVisible(p->cursorIcon_, cursorIconVisible);
if (cursorIconVisible) if (cursorIconVisible)
{ {
@ -434,8 +438,6 @@ void OverlayLayer::Render(const QMapLibre::CustomLayerRenderParameters& params)
ImGui::End(); ImGui::End();
} }
auto& generalSettings = settings::GeneralSettings::Instance();
// Map Center Icon // Map Center Icon
if (params.width != p->lastWidth_ || params.height != p->lastHeight_) if (params.width != p->lastWidth_ || params.height != p->lastHeight_)
{ {

View file

@ -77,6 +77,7 @@ public:
trackLocation_.SetDefault(false); trackLocation_.SetDefault(false);
updateNotificationsEnabled_.SetDefault(true); updateNotificationsEnabled_.SetDefault(true);
warningsProvider_.SetDefault(defaultWarningsProviderValue); warningsProvider_.SetDefault(defaultWarningsProviderValue);
cursorIconAlwaysOn_.SetDefault(false);
fontSizes_.SetElementMinimum(1); fontSizes_.SetElementMinimum(1);
fontSizes_.SetElementMaximum(72); fontSizes_.SetElementMaximum(72);
@ -166,6 +167,7 @@ public:
SettingsVariable<bool> trackLocation_ {"track_location"}; SettingsVariable<bool> trackLocation_ {"track_location"};
SettingsVariable<bool> updateNotificationsEnabled_ {"update_notifications"}; SettingsVariable<bool> updateNotificationsEnabled_ {"update_notifications"};
SettingsVariable<std::string> warningsProvider_ {"warnings_provider"}; SettingsVariable<std::string> warningsProvider_ {"warnings_provider"};
SettingsVariable<bool> cursorIconAlwaysOn_ {"cursor_icon_always_on"};
}; };
GeneralSettings::GeneralSettings() : GeneralSettings::GeneralSettings() :
@ -198,7 +200,8 @@ GeneralSettings::GeneralSettings() :
&p->themeFile_, &p->themeFile_,
&p->trackLocation_, &p->trackLocation_,
&p->updateNotificationsEnabled_, &p->updateNotificationsEnabled_,
&p->warningsProvider_}); &p->warningsProvider_,
&p->cursorIconAlwaysOn_});
SetDefaults(); SetDefaults();
} }
GeneralSettings::~GeneralSettings() = default; GeneralSettings::~GeneralSettings() = default;
@ -348,6 +351,11 @@ SettingsVariable<std::string>& GeneralSettings::warnings_provider() const
return p->warningsProvider_; return p->warningsProvider_;
} }
SettingsVariable<bool>& GeneralSettings::cursor_icon_always_on() const
{
return p->cursorIconAlwaysOn_;
}
bool GeneralSettings::Shutdown() bool GeneralSettings::Shutdown()
{ {
bool dataChanged = false; bool dataChanged = false;
@ -397,7 +405,8 @@ bool operator==(const GeneralSettings& lhs, const GeneralSettings& rhs)
lhs.p->trackLocation_ == rhs.p->trackLocation_ && lhs.p->trackLocation_ == rhs.p->trackLocation_ &&
lhs.p->updateNotificationsEnabled_ == lhs.p->updateNotificationsEnabled_ ==
rhs.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 } // namespace settings

View file

@ -53,6 +53,7 @@ public:
SettingsVariable<bool>& track_location() const; SettingsVariable<bool>& track_location() const;
SettingsVariable<bool>& update_notifications_enabled() const; SettingsVariable<bool>& update_notifications_enabled() const;
SettingsVariable<std::string>& warnings_provider() const; SettingsVariable<std::string>& warnings_provider() const;
SettingsVariable<bool>& cursor_icon_always_on() const;
static GeneralSettings& Instance(); static GeneralSettings& Instance();

View file

@ -137,6 +137,7 @@ public:
&showMapCenter_, &showMapCenter_,
&showMapLogo_, &showMapLogo_,
&updateNotificationsEnabled_, &updateNotificationsEnabled_,
&cursorIconAlwaysOn_,
&debugEnabled_, &debugEnabled_,
&alertAudioSoundFile_, &alertAudioSoundFile_,
&alertAudioLocationMethod_, &alertAudioLocationMethod_,
@ -251,6 +252,7 @@ public:
settings::SettingsInterface<bool> showMapCenter_ {}; settings::SettingsInterface<bool> showMapCenter_ {};
settings::SettingsInterface<bool> showMapLogo_ {}; settings::SettingsInterface<bool> showMapLogo_ {};
settings::SettingsInterface<bool> updateNotificationsEnabled_ {}; settings::SettingsInterface<bool> updateNotificationsEnabled_ {};
settings::SettingsInterface<bool> cursorIconAlwaysOn_ {};
settings::SettingsInterface<bool> debugEnabled_ {}; settings::SettingsInterface<bool> debugEnabled_ {};
std::unordered_map<std::string, settings::SettingsInterface<std::string>> std::unordered_map<std::string, settings::SettingsInterface<std::string>>
@ -762,6 +764,10 @@ void SettingsDialogImpl::SetupGeneralTab()
updateNotificationsEnabled_.SetEditWidget( updateNotificationsEnabled_.SetEditWidget(
self_->ui->enableUpdateNotificationsCheckBox); self_->ui->enableUpdateNotificationsCheckBox);
cursorIconAlwaysOn_.SetSettingsVariable(
generalSettings.cursor_icon_always_on());
cursorIconAlwaysOn_.SetEditWidget(self_->ui->cursorIconAlwaysOnCheckBox);
debugEnabled_.SetSettingsVariable(generalSettings.debug_enabled()); debugEnabled_.SetSettingsVariable(generalSettings.debug_enabled());
debugEnabled_.SetEditWidget(self_->ui->debugEnabledCheckBox); debugEnabled_.SetEditWidget(self_->ui->debugEnabledCheckBox);
} }

View file

@ -135,9 +135,9 @@
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>-133</y> <y>-246</y>
<width>511</width> <width>511</width>
<height>676</height> <height>703</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
@ -590,6 +590,19 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QCheckBox" name="cursorIconAlwaysOnCheckBox">
<property name="acceptDrops">
<bool>false</bool>
</property>
<property name="toolTip">
<string/>
</property>
<property name="text">
<string>Multi-Pane Cursor Marker Always On</string>
</property>
</widget>
</item>
<item> <item>
<widget class="QCheckBox" name="debugEnabledCheckBox"> <widget class="QCheckBox" name="debugEnabledCheckBox">
<property name="text"> <property name="text">

@ -1 +1 @@
Subproject commit a642d730bd8d6c9b291b90e61b3a3a389139f2f6 Subproject commit eaf8f185ce2b3a3248da1a4d6c8e2e9265638f15