aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llui
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llui')
-rw-r--r--linden/indra/llui/llfloater.cpp31
-rw-r--r--linden/indra/llui/llfloater.h5
-rw-r--r--linden/indra/llui/lltexteditor.cpp4
3 files changed, 34 insertions, 6 deletions
diff --git a/linden/indra/llui/llfloater.cpp b/linden/indra/llui/llfloater.cpp
index 047342f..de4f6ce 100644
--- a/linden/indra/llui/llfloater.cpp
+++ b/linden/indra/llui/llfloater.cpp
@@ -544,6 +544,7 @@ void LLFloater::close(bool app_quitting)
544 if (getHost()) 544 if (getHost())
545 { 545 {
546 ((LLMultiFloater*)getHost())->removeFloater(this); 546 ((LLMultiFloater*)getHost())->removeFloater(this);
547 gFloaterView->addChild(this);
547 } 548 }
548 549
549 if (getSoundFlags() != SILENT 550 if (getSoundFlags() != SILENT
@@ -1318,8 +1319,8 @@ void LLFloater::onClickEdit(void *userdata)
1318 self->mEditing = self->mEditing ? FALSE : TRUE; 1319 self->mEditing = self->mEditing ? FALSE : TRUE;
1319} 1320}
1320 1321
1321// static 1322// static
1322void LLFloater::closeFocusedFloater() 1323LLFloater* LLFloater::getClosableFloaterFromFocus()
1323{ 1324{
1324 LLFloater* focused_floater = NULL; 1325 LLFloater* focused_floater = NULL;
1325 1326
@@ -1336,10 +1337,32 @@ void LLFloater::closeFocusedFloater()
1336 if (iter == sFloaterMap.end()) 1337 if (iter == sFloaterMap.end())
1337 { 1338 {
1338 // nothing found, return 1339 // nothing found, return
1339 return; 1340 return NULL;
1341 }
1342
1343 // The focused floater may not be closable,
1344 // Find and close a parental floater that is closeable, if any.
1345 for(LLFloater* floater_to_close = focused_floater;
1346 NULL != floater_to_close;
1347 floater_to_close = gFloaterView->getParentFloater(floater_to_close))
1348 {
1349 if(floater_to_close->isCloseable())
1350 {
1351 return floater_to_close;
1352 }
1340 } 1353 }
1341 1354
1342 focused_floater->close(); 1355 return NULL;
1356}
1357
1358// static
1359void LLFloater::closeFocusedFloater()
1360{
1361 LLFloater* floater_to_close = LLFloater::getClosableFloaterFromFocus();
1362 if(floater_to_close)
1363 {
1364 floater_to_close->close();
1365 }
1343 1366
1344 // if nothing took focus after closing focused floater 1367 // if nothing took focus after closing focused floater
1345 // give it to next floater (to allow closing multiple windows via keyboard in rapid succession) 1368 // give it to next floater (to allow closing multiple windows via keyboard in rapid succession)
diff --git a/linden/indra/llui/llfloater.h b/linden/indra/llui/llfloater.h
index 0be5d44..267707f 100644
--- a/linden/indra/llui/llfloater.h
+++ b/linden/indra/llui/llfloater.h
@@ -206,6 +206,11 @@ public:
206 206
207 LLHandle<LLFloater> getHandle() const { return mHandle; } 207 LLHandle<LLFloater> getHandle() const { return mHandle; }
208 208
209 // Return a closeable floater, if any, given the current focus.
210 static LLFloater* getClosableFloaterFromFocus();
211
212 // Close the floater returned by getClosableFloaterFromFocus() and
213 // handle refocusing.
209 static void closeFocusedFloater(); 214 static void closeFocusedFloater();
210 215
211 static void onClickClose(void *userdata); 216 static void onClickClose(void *userdata);
diff --git a/linden/indra/llui/lltexteditor.cpp b/linden/indra/llui/lltexteditor.cpp
index 4b0acf8..2205005 100644
--- a/linden/indra/llui/lltexteditor.cpp
+++ b/linden/indra/llui/lltexteditor.cpp
@@ -471,9 +471,9 @@ void LLTextEditor::updateLineStartList(S32 startpos)
471 } 471 }
472 472
473 // if scrolled to bottom, stay at bottom 473 // if scrolled to bottom, stay at bottom
474 // unless user is editing text 474 // unless user is selecting text
475 // do this after updating page size 475 // do this after updating page size
476 if (mScrolledToBottom && mTrackBottom && !hasFocus()) 476 if (mScrolledToBottom && mTrackBottom && !hasMouseCapture())
477 { 477 {
478 endOfDoc(); 478 endOfDoc();
479 } 479 }