diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 01e82a0c9e..279e58277e 100755 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -251,7 +251,7 @@ LLLayoutStack::LLLayoutStack(const LLLayoutStack::Params& p) std::string res = std::string("layout_size_") + getName(); LLStringUtil::replaceChar(res, ' ', '_'); mSizeControlName = res; - LLControlGroup* controlGroup = LLUI::sSettingGroups["config"]; + LLControlGroup* controlGroup = LLUI::sSettingGroups["account"]; if (!controlGroup->controlExists(mSizeControlName)) { LL_WARNS() << "declaring control " << mSizeControlName << LL_ENDL; @@ -263,7 +263,7 @@ LLLayoutStack::LLLayoutStack(const LLLayoutStack::Params& p) } else { - mSavedSizes = LLControlGroup::getInstance("Global")->getLLSD(mSizeControlName); + mSavedSizes = controlGroup->getLLSD(mSizeControlName); } } // @@ -271,10 +271,10 @@ LLLayoutStack::LLLayoutStack(const LLLayoutStack::Params& p) LLLayoutStack::~LLLayoutStack() { - // Record new size for this panel + // Save new sizes for this layout stack's panels if (mSaveSizes) { - LLControlGroup::getInstance("Global")->setLLSD(mSizeControlName, mSavedSizes); + LLUI::sSettingGroups["account"]->setLLSD(mSizeControlName, mSavedSizes); } // @@ -1069,3 +1069,39 @@ void LLLayoutStack::updateResizeBarLimits() } } +// Applier for dimensions +void LLLayoutStack::refreshFromSettings() +{ + if (!mSaveSizes) + { + return; + } + + LLSD dimensions = LLUI::sSettingGroups["account"]->getLLSD(mSizeControlName); + if (dimensions.size() < mPanels.size()) + { + return; + } + + for (size_t i = 0; i < mPanels.size(); ++i) + { + LLLayoutPanel* panelp = mPanels.at(i); + + S32 width = panelp->getRect().getWidth(); + S32 height = panelp->getRect().getHeight(); + + S32 dim = dimensions[i].asInteger(); + + if (mOrientation == LLLayoutStack::HORIZONTAL) + { + width = dim; + } + else + { + height = dim; + } + panelp->reshape(width, height, TRUE); + } + mNeedsLayout = true; +} +// diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h index 316d05834d..0f1929d29c 100755 --- a/indra/llui/lllayoutstack.h +++ b/indra/llui/lllayoutstack.h @@ -94,6 +94,9 @@ public: static void updateClass(); + // Applier for dimensions + void refreshFromSettings(); + protected: LLLayoutStack(const Params&); friend class LLUICtrlFactory; diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 7e8ca01820..7a9401de72 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -19993,18 +19993,6 @@ Change of this parameter will affect the layout of buttons in notification toast Value 0 - layout_size_chat_bar_stack - - Comment - Fractional size for layout panel chat_bar_stack - Type - LLSD - Value - - 400 - 600 - - FSEnableGrowl Comment diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index 4690d6e7f7..2b8f1d1f02 100755 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -909,6 +909,20 @@ + layout_size_chat_bar_stack + + Backup + 1 + Comment + Fractional size for layout panel chat_bar_stack + Type + LLSD + Value + + 400 + 600 + + diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 3b1b7a6e92..2dbc5e648d 100755 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -1283,6 +1283,14 @@ bool idle_startup() // Overwrite default user settings with user settings LLAppViewer::instance()->loadSettingsFromDirectory("Account"); + // Restore bottom toolbar layout now he have the user settings + LLLayoutStack* chat_bar_stack = gToolBarView->findChild("chat_bar_stack"); + if (chat_bar_stack) + { + chat_bar_stack->refreshFromSettings(); + } + // + // Convert 'LogInstantMessages' into 'KeepConversationLogTranscripts' for backward compatibility (CHUI-743). // FIRE-11410 - Don't do this, handle it in settings restore and first run //LLControlVariablePtr logInstantMessagesControl = gSavedPerAccountSettings.getControl("LogInstantMessages");