summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelgroup.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpanelgroup.cpp')
-rw-r--r--indra/newview/llpanelgroup.cpp39
1 files changed, 32 insertions, 7 deletions
diff --git a/indra/newview/llpanelgroup.cpp b/indra/newview/llpanelgroup.cpp
index 2b584910a3..206d8428be 100644
--- a/indra/newview/llpanelgroup.cpp
+++ b/indra/newview/llpanelgroup.cpp
@@ -54,6 +54,7 @@
#include "llsidetray.h"
#include "llaccordionctrltab.h"
+#include "llaccordionctrl.h"
static LLRegisterPanelClassWrapper<LLPanelGroup> t_panel_group("panel_group_info_sidetray");
@@ -100,14 +101,13 @@ void LLPanelGroupTab::handleClickHelp()
}
LLPanelGroup::LLPanelGroup()
-: LLPanel()
- ,LLGroupMgrObserver( LLUUID() )
- ,mAllowEdit(TRUE)
+: LLPanel(),
+ LLGroupMgrObserver( LLUUID() ),
+ mAllowEdit( TRUE )
{
// Set up the factory callbacks.
// Roles sub tabs
LLGroupMgr::getInstance()->addObserver(this);
-
}
@@ -210,9 +210,19 @@ void LLPanelGroup::reposButton(const std::string& name)
button->setRect(btn_rect);
}
-void LLPanelGroup::reshape(S32 width, S32 height, BOOL called_from_parent )
+void LLPanelGroup::reposButtons()
{
- LLPanel::reshape(width, height, called_from_parent );
+ LLButton* button_refresh = findChild<LLButton>("btn_refresh");
+ LLButton* button_cancel = findChild<LLButton>("btn_cancel");
+
+ if(button_refresh && button_cancel && button_refresh->getVisible() && button_cancel->getVisible())
+ {
+ LLRect btn_refresh_rect = button_refresh->getRect();
+ LLRect btn_cancel_rect = button_cancel->getRect();
+ btn_refresh_rect.setLeftTopAndSize( btn_cancel_rect.mLeft + btn_cancel_rect.getWidth() + 2,
+ btn_refresh_rect.getHeight() + 2, btn_refresh_rect.getWidth(), btn_refresh_rect.getHeight());
+ button_refresh->setRect(btn_refresh_rect);
+ }
reposButton("btn_apply");
reposButton("btn_create");
@@ -220,6 +230,13 @@ void LLPanelGroup::reshape(S32 width, S32 height, BOOL called_from_parent )
reposButton("btn_cancel");
}
+void LLPanelGroup::reshape(S32 width, S32 height, BOOL called_from_parent )
+{
+ LLPanel::reshape(width, height, called_from_parent );
+
+ reposButtons();
+}
+
void LLPanelGroup::onBackBtnClick()
{
LLSideTrayPanelContainer* parent = dynamic_cast<LLSideTrayPanelContainer*>(getParent());
@@ -229,6 +246,7 @@ void LLPanelGroup::onBackBtnClick()
}
}
+
void LLPanelGroup::onBtnCreate()
{
LLPanelGroupGeneral* panel_general = findChild<LLPanelGroupGeneral>("group_general_tab_panel");
@@ -375,17 +393,23 @@ void LLPanelGroup::setGroupID(const LLUUID& group_id)
getChild<LLUICtrl>("prepend_founded_by")->setVisible(!is_null_group_id);
+ LLAccordionCtrl* tab_ctrl = findChild<LLAccordionCtrl>("group_accordion");
+ if(tab_ctrl)
+ tab_ctrl->reset();
+
LLAccordionCtrlTab* tab_general = findChild<LLAccordionCtrlTab>("group_general_tab");
LLAccordionCtrlTab* tab_roles = findChild<LLAccordionCtrlTab>("group_roles_tab");
LLAccordionCtrlTab* tab_notices = findChild<LLAccordionCtrlTab>("group_notices_tab");
LLAccordionCtrlTab* tab_land = findChild<LLAccordionCtrlTab>("group_land_tab");
+
if(!tab_general || !tab_roles || !tab_notices || !tab_land)
return;
if(button_join)
button_join->setVisible(false);
+
if(is_null_group_id)//creating new group
{
if(!tab_general->getDisplayChildren())
@@ -404,7 +428,6 @@ void LLPanelGroup::setGroupID(const LLUUID& group_id)
getChild<LLUICtrl>("group_name")->setVisible(false);
getChild<LLUICtrl>("group_name_editor")->setVisible(true);
-
}
else
{
@@ -424,6 +447,8 @@ void LLPanelGroup::setGroupID(const LLUUID& group_id)
getChild<LLUICtrl>("group_name")->setVisible(true);
getChild<LLUICtrl>("group_name_editor")->setVisible(false);
}
+
+ reposButtons();
}
bool LLPanelGroup::apply(LLPanelGroupTab* tab)