summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2022-08-11 23:03:14 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2022-08-12 00:39:42 +0300
commit1de8306c830611d22e9d684ad1372e6f506f21af (patch)
tree17c35e66847f8a0c77f23da9d7ede51df0252776
parentfd8b052b3212ab3b16fca716c8d190822e4d6ac8 (diff)
SL-17965 Closing some floaters shifts focus to menu bar
Focus root now only covers menu, status and nav bar to not steal focus from floaters This partially reverts commit 1d6bfb727a8015e82cd4060a0c73cf3fc719e818.
-rw-r--r--indra/newview/llpanelpresetscamerapulldown.cpp5
-rw-r--r--indra/newview/llpanelpresetspulldown.cpp3
-rw-r--r--indra/newview/llpanelpulldown.cpp2
-rw-r--r--indra/newview/llviewerwindow.cpp15
-rw-r--r--indra/newview/skins/default/xui/en/main_view.xml33
5 files changed, 32 insertions, 26 deletions
diff --git a/indra/newview/llpanelpresetscamerapulldown.cpp b/indra/newview/llpanelpresetscamerapulldown.cpp
index 183123e534..4c9c30160c 100644
--- a/indra/newview/llpanelpresetscamerapulldown.cpp
+++ b/indra/newview/llpanelpresetscamerapulldown.cpp
@@ -127,7 +127,10 @@ void LLPanelPresetsCameraPulldown::onRowClick(const LLSD& user_data)
LL_DEBUGS() << "selected '" << name << "'" << LL_ENDL;
LLFloaterCamera::switchToPreset(name);
- setVisible(FALSE);
+ // Scroll grabbed focus, drop it to prevent selection of parent menu
+ setFocus(FALSE);
+
+ setVisible(FALSE);
}
else
{
diff --git a/indra/newview/llpanelpresetspulldown.cpp b/indra/newview/llpanelpresetspulldown.cpp
index d52ad8056f..23e4fa8887 100644
--- a/indra/newview/llpanelpresetspulldown.cpp
+++ b/indra/newview/llpanelpresetspulldown.cpp
@@ -122,6 +122,9 @@ void LLPanelPresetsPulldown::onRowClick(const LLSD& user_data)
LL_DEBUGS() << "selected '" << name << "'" << LL_ENDL;
LLPresetsManager::getInstance()->loadPreset(PRESETS_GRAPHIC, name);
+ // Scroll grabbed focus, drop it to prevent selection of parent menu
+ setFocus(FALSE);
+
setVisible(FALSE);
}
else
diff --git a/indra/newview/llpanelpulldown.cpp b/indra/newview/llpanelpulldown.cpp
index 4de6ee8182..075278f44c 100644
--- a/indra/newview/llpanelpulldown.cpp
+++ b/indra/newview/llpanelpulldown.cpp
@@ -51,6 +51,7 @@ void LLPanelPulldown::onMouseEnter(S32 x, S32 y, MASK mask)
/*virtual*/
void LLPanelPulldown::onTopLost()
{
+ setFocus(FALSE); // drop focus to prevent transfer to parent
setVisible(FALSE);
}
@@ -113,6 +114,7 @@ void LLPanelPulldown::draw()
if (alpha == 0.f)
{
+ setFocus(FALSE); // drop focus to prevent transfer to parent
setVisible(FALSE);
}
}
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index cf243f085f..ebbc9c0681 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -2224,26 +2224,31 @@ void LLViewerWindow::initWorldUI()
// Force gFloaterTools to initialize
LLFloaterReg::getInstance("build");
-
// Status bar
LLPanel* status_bar_container = getRootView()->getChild<LLPanel>("status_bar_container");
gStatusBar = new LLStatusBar(status_bar_container->getLocalRect());
- gStatusBar->setFollowsAll();
+ gStatusBar->setFollows(FOLLOWS_LEFT | FOLLOWS_TOP | FOLLOWS_RIGHT);
gStatusBar->setShape(status_bar_container->getLocalRect());
// sync bg color with menu bar
gStatusBar->setBackgroundColor( gMenuBarView->getBackgroundColor().get() );
// add InBack so that gStatusBar won't be drawn over menu
- status_bar_container->addChildInBack(gStatusBar);
- status_bar_container->setVisible(TRUE);
+ status_bar_container->addChildInBack(gStatusBar, 2/*tab order, after menu*/);
+ status_bar_container->setVisible(TRUE);
// Navigation bar
- LLPanel* nav_bar_container = getRootView()->getChild<LLPanel>("nav_bar_container");
+ LLView* nav_bar_container = getRootView()->getChild<LLView>("nav_bar_container");
LLNavigationBar* navbar = LLNavigationBar::getInstance();
navbar->setShape(nav_bar_container->getLocalRect());
navbar->setBackgroundColor(gMenuBarView->getBackgroundColor().get());
nav_bar_container->addChild(navbar);
nav_bar_container->setVisible(TRUE);
+
+ // Navigation bar is outside visible area, expand status_bar_container to show it
+ S32 new_height = nav_bar_container->getRect().getHeight() + status_bar_container->getRect().getHeight();
+ S32 new_width = status_bar_container->getRect().getWidth();
+ status_bar_container->reshape(new_width, new_height, TRUE);
+
if (!gSavedSettings.getBOOL("ShowNavbarNavigationPanel"))
{
diff --git a/indra/newview/skins/default/xui/en/main_view.xml b/indra/newview/skins/default/xui/en/main_view.xml
index 842184de88..bab37c6258 100644
--- a/indra/newview/skins/default/xui/en/main_view.xml
+++ b/indra/newview/skins/default/xui/en/main_view.xml
@@ -8,16 +8,6 @@
tab_stop="false"
name="main_view"
width="1024">
-
- <!-- At the moment layout_stack is not an LLUICtrl,
- but Tab requires focus_root to function and focus_root
- functionality is implemented in LLUICtrl -->
- <panel follows="all"
- height="768"
- name="menu_tab_wrapper"
- mouse_opaque="false"
- focus_root="true"
- top="0">
<layout_stack border_size="0"
follows="all"
mouse_opaque="false"
@@ -25,31 +15,35 @@
name="menu_stack"
orientation="vertical"
top="0">
+ <!-- Menu, nav bar and status bar need common focus_root-->
<layout_panel mouse_opaque="true"
follows="left|right|top"
name="status_bar_container"
+ focus_root="true"
height="19"
left="0"
top="0"
width="1024"
auto_resize="false"
- default_tab_group="1"
visible="true">
<view mouse_opaque="false"
- follows="all"
+ follows="top|left|right"
name="menu_bar_holder"
+ tab_group="1"
left="0"
top="0"
width="1024"
- tab_group="1"
height="19"/>
+ <view mouse_opaque="false"
+ follows="top|left|right"
+ name="nav_bar_container"
+ tab_group="3"
+ left="0"
+ top="19"
+ width="1024"
+ height="34"
+ visible="false"/>
</layout_panel>
- <layout_panel auto_resize="false"
- height="34"
- mouse_opaque="false"
- name="nav_bar_container"
- width="1024"
- visible="false"/>
<layout_panel auto_resize="true"
follows="all"
height="500"
@@ -109,7 +103,6 @@
tab_stop="false"/>
</layout_panel>
</layout_stack>
- </panel> <!--menu_tab_wrapper-->
<panel top="0"
follows="all"