forked from organicmaps/organicmaps
[guides on map] Close gallery on any movement, notify about about new active guide after opening of the PP.
This commit is contained in:
parent
fb7c4fdaf4
commit
7a52d0eec0
3 changed files with 15 additions and 14 deletions
|
@ -2448,6 +2448,9 @@ void Framework::ActivateMapSelection(std::optional<place_page::Info> const & inf
|
|||
m_onPlacePageOpen();
|
||||
else
|
||||
LOG(LWARNING, ("m_onPlacePageOpen has not been set up."));
|
||||
|
||||
if (info->GetSelectedObject() == df::SelectionShape::OBJECT_GUIDE)
|
||||
m_guidesManager.OnGuideSelected();
|
||||
}
|
||||
|
||||
void Framework::DeactivateMapSelection(bool notifyUI)
|
||||
|
@ -2569,7 +2572,10 @@ void Framework::OnTapEvent(place_page::BuildInfo const & buildInfo)
|
|||
}
|
||||
|
||||
if (m_currentPlacePageInfo->IsGuide() && prevIsGuide)
|
||||
{
|
||||
m_guidesManager.OnGuideSelected();
|
||||
return;
|
||||
}
|
||||
|
||||
ActivateMapSelection(m_currentPlacePageInfo);
|
||||
}
|
||||
|
@ -2631,7 +2637,7 @@ void Framework::BuildTrackPlacePage(BookmarkManager::TrackSelectionInfo const &
|
|||
|
||||
void Framework::BuildGuidePlacePage(GuideMark const & guideMark, place_page::Info & info)
|
||||
{
|
||||
m_guidesManager.OnGuideSelected(guideMark);
|
||||
m_guidesManager.SetActiveGuide(guideMark.GetGuideId());
|
||||
info.SetSelectedObject(df::SelectionShape::OBJECT_GUIDE);
|
||||
info.SetIsGuide(true);
|
||||
}
|
||||
|
|
|
@ -56,6 +56,8 @@ void GuidesManager::UpdateViewport(ScreenBase const & screen)
|
|||
if (screen.GlobalRect().GetLocalRect().IsEmptyInterior())
|
||||
return;
|
||||
|
||||
m_closeGallery();
|
||||
|
||||
if (IsRequestParamsInitialized())
|
||||
{
|
||||
auto const scaleStronglyChanged =
|
||||
|
@ -77,8 +79,6 @@ void GuidesManager::UpdateViewport(ScreenBase const & screen)
|
|||
}
|
||||
}
|
||||
|
||||
m_closeGallery();
|
||||
|
||||
m_screen = screen;
|
||||
m_zoom = zoom;
|
||||
|
||||
|
@ -235,7 +235,10 @@ GuidesManager::GuidesGallery GuidesManager::GetGallery() const
|
|||
return gallery;
|
||||
}
|
||||
|
||||
std::string GuidesManager::GetActiveGuide() const { return m_activeGuide; }
|
||||
std::string GuidesManager::GetActiveGuide() const
|
||||
{
|
||||
return m_activeGuide;
|
||||
}
|
||||
|
||||
void GuidesManager::SetActiveGuide(std::string const & guideId)
|
||||
{
|
||||
|
@ -309,16 +312,8 @@ void GuidesManager::OnClusterSelected(GuidesClusterMark const & mark, ScreenBase
|
|||
true /* isAnim */);
|
||||
}
|
||||
|
||||
void GuidesManager::OnGuideSelected(GuideMark const & mark)
|
||||
void GuidesManager::OnGuideSelected()
|
||||
{
|
||||
if (mark.GetGuideId() == m_activeGuide)
|
||||
return;
|
||||
|
||||
auto es = m_bmManager->GetEditSession();
|
||||
es.ClearGroup(UserMark::Type::GUIDE_SELECTION);
|
||||
es.CreateUserMark<GuideSelectionMark>(mark.GetPivot());
|
||||
|
||||
m_activeGuide = mark.GetGuideId();
|
||||
if (m_onGalleryChanged)
|
||||
m_onGalleryChanged(false /* reload */);
|
||||
}
|
||||
|
|
|
@ -107,7 +107,7 @@ public:
|
|||
void SetApiDelegate(std::unique_ptr<guides_on_map::Api::Delegate> apiDelegate);
|
||||
|
||||
void OnClusterSelected(GuidesClusterMark const & mark, ScreenBase const & screen);
|
||||
void OnGuideSelected(GuideMark const & mark);
|
||||
void OnGuideSelected();
|
||||
|
||||
private:
|
||||
void ChangeState(GuidesState newState);
|
||||
|
|
Loading…
Add table
Reference in a new issue