summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorPaul ProductEngine <pguslisty@productengine.com>2012-02-01 17:15:22 +0200
committerPaul ProductEngine <pguslisty@productengine.com>2012-02-01 17:15:22 +0200
commitb3960899066156bc7d3fd5befb2f7e687a328152 (patch)
treef9a4624c2f257843e5bc3476204d81129a66c6cc /indra/newview
parent1404ba1ffa821c3ecc76cde254c5148fec66a2c0 (diff)
EXP-1822 FIXED (After deleting an item from inventory and confirming "ok" to delete, focus leaves inventory)
-Return focus to the previously focused view
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/lltoastalertpanel.cpp16
-rw-r--r--indra/newview/lltoastalertpanel.h1
2 files changed, 17 insertions, 0 deletions
diff --git a/indra/newview/lltoastalertpanel.cpp b/indra/newview/lltoastalertpanel.cpp
index 12ad071799..ada7570776 100644
--- a/indra/newview/lltoastalertpanel.cpp
+++ b/indra/newview/lltoastalertpanel.cpp
@@ -69,6 +69,15 @@ LLToastAlertPanel::LLToastAlertPanel( LLNotificationPtr notification, bool modal
mLabel(notification->getName()),
mLineEditor(NULL)
{
+ // EXP-1822
+ // save currently focused view, so that return focus to it
+ // on destroying this toast.
+ LLView* current_selection = dynamic_cast<LLView*>(gFocusMgr.getKeyboardFocus());
+ if (current_selection)
+ {
+ mPreviouslyFocusedView = current_selection->getHandle();
+ }
+
const LLFontGL* font = LLFontGL::getFontSansSerif();
const S32 LINE_HEIGHT = font->getLineHeight();
const S32 EDITOR_HEIGHT = 20;
@@ -408,6 +417,13 @@ LLToastAlertPanel::~LLToastAlertPanel()
{
LLTransientFloaterMgr::instance().removeControlView(
LLTransientFloaterMgr::GLOBAL, this);
+
+ // EXP-1822
+ // return focus to the previously focused view
+ if (mPreviouslyFocusedView.get())
+ {
+ gFocusMgr.setKeyboardFocus(mPreviouslyFocusedView.get());
+ }
}
BOOL LLToastAlertPanel::hasTitleBar() const
diff --git a/indra/newview/lltoastalertpanel.h b/indra/newview/lltoastalertpanel.h
index 7b157f19bb..d1be5e018e 100644
--- a/indra/newview/lltoastalertpanel.h
+++ b/indra/newview/lltoastalertpanel.h
@@ -113,6 +113,7 @@ private:
LLFrameTimer mDefaultBtnTimer;
// For Dialogs that take a line as text as input:
LLLineEditor* mLineEditor;
+ LLHandle<LLView> mPreviouslyFocusedView;
};