From 1c5872da0c37a72a75099122de9e19f04a4be295 Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Wed, 23 Jul 2014 18:12:18 -0400 Subject: [PATCH] Fix the grids combobox on the login panel not being scrollable because of constantly reordering grids Still select the current grid, just use its index number to select it, instead of hacking it to the top of the combo box. --- indra/newview/llpanellogin.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index e9a38ba79..74712a649 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -741,21 +741,24 @@ void LLPanelLogin::updateGridCombo() const HippoGridInfo *curGrid = gHippoGridManager->getCurrentGrid(); const HippoGridInfo *defGrid = gHippoGridManager->getGrid(defaultGrid); + S32 idx(-1); HippoGridManager::GridIterator it, end = gHippoGridManager->endGrid(); for (it = gHippoGridManager->beginGrid(); it != end; ++it) { std::string grid = it->second->getGridName(); - if(grid.empty() || it->second == defGrid || it->second == curGrid) + if (grid.empty() || it->second == defGrid) continue; + if (it->second == curGrid) idx = grids->getItemCount(); grids->add(grid); } - if(curGrid || defGrid) + if (curGrid || defGrid) { - if(defGrid) + if (defGrid) + { grids->add(defGrid->getGridName(),ADD_TOP); - if(curGrid && defGrid != curGrid) - grids->add(curGrid->getGridName(),ADD_TOP); - grids->setCurrentByIndex(0); + ++idx; + } + grids->setCurrentByIndex(idx); } else {