summaryrefslogtreecommitdiff
path: root/indra/newview/llsidepanelinventory.cpp
diff options
context:
space:
mode:
authorLeyla Farazha <leyla@lindenlab.com>2011-05-25 11:26:08 -0700
committerLeyla Farazha <leyla@lindenlab.com>2011-05-25 11:26:08 -0700
commite5ca2b4b82704d11172e0c32761138ec0f58fbe3 (patch)
tree5875b249bf68502e9e75fac24d9510496c0c9baf /indra/newview/llsidepanelinventory.cpp
parentf8907b327bb0009047b9cef54fde3d7dc6e8d6ca (diff)
parent33e4a2c7b1ab3a06f1adb5edd9850523c897ea77 (diff)
merge
Diffstat (limited to 'indra/newview/llsidepanelinventory.cpp')
-rw-r--r--indra/newview/llsidepanelinventory.cpp49
1 files changed, 28 insertions, 21 deletions
diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp
index 7f5a2e64bf..9247611257 100644
--- a/indra/newview/llsidepanelinventory.cpp
+++ b/indra/newview/llsidepanelinventory.cpp
@@ -134,38 +134,45 @@ BOOL LLSidepanelInventory::postBuild()
}
-void LLSidepanelInventory::onToggleInboxBtn()
+void manageInboxOutboxPanels(LLLayoutStack * stack,
+ LLButton * pressedButton, LLLayoutPanel * pressedPanel,
+ LLButton * otherButton, LLLayoutPanel * otherPanel)
{
- LLLayoutStack* stack = getChild<LLLayoutStack>("inventory_layout_stack");
- bool collapse = !getChild<LLButton>("inbox_btn")->getToggleState();
+ bool expand = pressedButton->getToggleState();
+ bool otherExpanded = otherButton->getToggleState();
- if (stack)
- {
- stack->collapsePanel(getChild<LLLayoutPanel>("inbox_layout_panel"), collapse);
- }
- if (!collapse)
+ if (expand && otherExpanded)
{
- stack->collapsePanel(getChild<LLLayoutPanel>("outbox_layout_panel"), true);
- getChild<LLButton>("outbox_btn")->setToggleState(false);
+ // Reshape pressedPanel to the otherPanel's height so we preserve the marketplace panel size
+ pressedPanel->reshape(pressedPanel->getRect().getWidth(), otherPanel->getRect().getHeight());
+
+ stack->collapsePanel(otherPanel, true);
+ otherButton->setToggleState(false);
}
+
+ stack->collapsePanel(pressedPanel, !expand);
}
-void LLSidepanelInventory::onToggleOutboxBtn()
+void LLSidepanelInventory::onToggleInboxBtn()
{
LLLayoutStack* stack = getChild<LLLayoutStack>("inventory_layout_stack");
- bool collapse = !getChild<LLButton>("outbox_btn")->getToggleState();
+ LLButton* pressedButton = getChild<LLButton>("inbox_btn");
+ LLLayoutPanel* pressedPanel = getChild<LLLayoutPanel>("inbox_layout_panel");
+ LLButton* otherButton = getChild<LLButton>("outbox_btn");
+ LLLayoutPanel* otherPanel = getChild<LLLayoutPanel>("outbox_layout_panel");
- if (stack)
- {
- stack->collapsePanel(getChild<LLLayoutPanel>("outbox_layout_panel"), collapse);
- }
+ manageInboxOutboxPanels(stack, pressedButton, pressedPanel, otherButton, otherPanel);
+}
- if (!collapse)
- {
- stack->collapsePanel(getChild<LLLayoutPanel>("inbox_layout_panel"), true);
- getChild<LLButton>("inbox_btn")->setToggleState(false);
- }
+void LLSidepanelInventory::onToggleOutboxBtn()
+{
+ LLLayoutStack* stack = getChild<LLLayoutStack>("inventory_layout_stack");
+ LLButton* pressedButton = getChild<LLButton>("outbox_btn");
+ LLLayoutPanel* pressedPanel = getChild<LLLayoutPanel>("outbox_layout_panel");
+ LLButton* otherButton = getChild<LLButton>("inbox_btn");
+ LLLayoutPanel* otherPanel = getChild<LLLayoutPanel>("inbox_layout_panel");
+ manageInboxOutboxPanels(stack, pressedButton, pressedPanel, otherButton, otherPanel);
}