reapack

Package manager for REAPER
Log | Files | Refs | Submodules | README | LICENSE

commit 6728524708d732092b362c44cdba54e29aa24bb4
parent c863e6e1755c017c84f114a590391fcbaf39210e
Author: cfillion <cfillion@users.noreply.github.com>
Date:   Wed, 21 Sep 2016 19:48:07 -0700

about: continue to raise to foreground when switching delegate

Diffstat:
Msrc/about.cpp | 6+++---
Msrc/about.hpp | 2+-
Msrc/browser.cpp | 4++--
3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/about.cpp b/src/about.cpp @@ -89,7 +89,7 @@ void About::onCommand(const int id, int) } } -void About::setDelegate(const DelegatePtr &delegate) +void About::setDelegate(const DelegatePtr &delegate, const bool focus) { #ifdef _WIN32 // preventing fast blinking on windows @@ -138,8 +138,8 @@ void About::setDelegate(const DelegatePtr &delegate) InvalidateRect(handle(), nullptr, true); #endif - if(!isVisible()) - show(); + if(focus) + setFocus(); // this also calls show(); } void About::setTitle(const string &what) diff --git a/src/about.hpp b/src/about.hpp @@ -43,7 +43,7 @@ public: typedef std::shared_ptr<AboutDelegate> DelegatePtr; About(); - void setDelegate(const DelegatePtr &); + void setDelegate(const DelegatePtr &, bool focus = true); template<typename T> bool testDelegate() { return dynamic_cast<T *>(m_delegate.get()) != nullptr; } diff --git a/src/browser.cpp b/src/browser.cpp @@ -517,9 +517,9 @@ void Browser::updateAbout() return; if(about->testDelegate<AboutIndexDelegate>()) - about->setDelegate(make_shared<AboutIndexDelegate>(entry->index, m_reapack)); + about->setDelegate(make_shared<AboutIndexDelegate>(entry->index, m_reapack), false); else if(about->testDelegate<AboutPackageDelegate>() && entry->package) - about->setDelegate(make_shared<AboutPackageDelegate>(entry->package, m_reapack)); + about->setDelegate(make_shared<AboutPackageDelegate>(entry->package, m_reapack), false); } void Browser::refresh(const bool stale)