diff options
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/lllayoutstack.cpp | 6 | ||||
-rw-r--r-- | indra/llui/lllayoutstack.h | 3 |
2 files changed, 5 insertions, 4 deletions
diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index ab25d1d62b..0ff7557ead 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -368,10 +368,10 @@ S32 LLLayoutStack::getDefaultWidth(S32 cur_width) return cur_width; } -void LLLayoutStack::movePanel(LLPanel* panel_to_move, LLPanel* target_panel) +void LLLayoutStack::movePanel(LLPanel* panel_to_move, LLPanel* target_panel, bool move_to_front) { LayoutPanel* embedded_panel_to_move = findEmbeddedPanel(panel_to_move); - LayoutPanel* embedded_target_panel = findEmbeddedPanel(target_panel); + LayoutPanel* embedded_target_panel = move_to_front ? *mPanels.begin() : findEmbeddedPanel(target_panel); if (!embedded_panel_to_move || !embedded_target_panel || embedded_panel_to_move == embedded_target_panel) { @@ -380,7 +380,7 @@ void LLLayoutStack::movePanel(LLPanel* panel_to_move, LLPanel* target_panel) } e_panel_list_t::iterator it = std::find(mPanels.begin(), mPanels.end(), embedded_panel_to_move); mPanels.erase(it); - it = std::find(mPanels.begin(), mPanels.end(), embedded_target_panel); + it = move_to_front ? mPanels.begin() : std::find(mPanels.begin(), mPanels.end(), embedded_target_panel); mPanels.insert(it, embedded_panel_to_move); } diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h index b5287db1cf..6fcc8e2ac3 100644 --- a/indra/llui/lllayoutstack.h +++ b/indra/llui/lllayoutstack.h @@ -74,8 +74,9 @@ public: S32 getNumPanels() { return mPanels.size(); } /** * Moves panel_to_move before target_panel inside layout stack (both panels should already be there). + * If move_to_front is true target_panel is ignored and panel_to_move is moved to the beginning of mPanels */ - void movePanel(LLPanel* panel_to_move, LLPanel* target_panel); + void movePanel(LLPanel* panel_to_move, LLPanel* target_panel, bool move_to_front = false); void updatePanelAutoResize(const std::string& panel_name, BOOL auto_resize); void setPanelUserResize(const std::string& panel_name, BOOL user_resize); |