implemented EXT-2515 "Docked floaters should be resizeable";

--HG--
branch : product-engine
master
Alexei Arabadji 2009-11-17 14:33:07 +02:00
parent 4b80c9978c
commit d43e33400a
10 changed files with 23 additions and 17 deletions

View File

@ -217,6 +217,16 @@ void LLDockableFloater::draw()
LLFloater::draw();
}
void LLDockableFloater::reshape(S32 width, S32 height, BOOL called_from_parent)
{
if (isDocked())
{
setDocked(false);
}
LLFloater::reshape(width, height, called_from_parent);
}
void LLDockableFloater::setDockControl(LLDockControl* dockControl)
{
mDockControl.reset(dockControl);

View File

@ -65,6 +65,7 @@ public:
/* virtula */BOOL postBuild();
/* virtual */void setDocked(bool docked, bool pop_on_undock = true);
/* virtual */void draw();
/* virtual */void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
/**
* If descendant class overrides setVisible() then it must still invoke its

View File

@ -266,6 +266,11 @@ void LLDockControl::off()
mEnabled = false;
}
void LLDockControl::forceRecalculatePosition()
{
mRecalculateDocablePosition = true;
}
void LLDockControl::drawToungue()
{
if (mEnabled)

View File

@ -63,6 +63,7 @@ public:
public:
void on();
void off();
void forceRecalculatePosition();
void setDock(LLView* dockWidget);
LLView* getDock()
{

View File

@ -367,8 +367,6 @@ void LLIMFloater::setDocked(bool docked, bool pop_on_undock)
LLNotificationsUI::LLScreenChannel* channel = dynamic_cast<LLNotificationsUI::LLScreenChannel*>
(LLNotificationsUI::LLChannelManager::getInstance()->
findChannelByID(LLUUID(gSavedSettings.getString("NotificationChannelUUID"))));
setCanResize(!docked);
LLTransientDockableFloater::setDocked(docked, pop_on_undock);

View File

@ -89,8 +89,6 @@ BOOL LLNearbyChat::postBuild()
mChatHistory = getChild<LLChatHistory>("chat_history");
setCanResize(true);
if(!LLDockableFloater::postBuild())
return false;
@ -98,7 +96,7 @@ BOOL LLNearbyChat::postBuild()
{
setDockControl(new LLDockControl(
LLBottomTray::getInstance()->getNearbyChatBar(), this,
getDockTongue(), LLDockControl::LEFT, boost::bind(&LLNearbyChat::getAllowedRect, this, _1)));
getDockTongue(), LLDockControl::TOP, boost::bind(&LLNearbyChat::getAllowedRect, this, _1)));
}
return true;
@ -187,13 +185,6 @@ void LLNearbyChat::onOpen(const LLSD& key )
}
}
void LLNearbyChat::setDocked (bool docked, bool pop_on_undock)
{
LLDockableFloater::setDocked(docked, pop_on_undock);
setCanResize(!docked);
}
void LLNearbyChat::setRect (const LLRect &rect)
{
LLDockableFloater::setRect(rect);

View File

@ -51,8 +51,6 @@ public:
void onNearbyChatContextMenuItemClicked(const LLSD& userdata);
bool onNearbyChatCheckContextMenuItem(const LLSD& userdata);
void setDocked (bool docked, bool pop_on_undock = true);
/*virtual*/ void onOpen (const LLSD& key);
virtual void setRect (const LLRect &rect);

View File

@ -332,7 +332,9 @@ void LLSysWellWindow::reshapeWindow()
new_window_height = MAX_WINDOW_HEIGHT;
}
S32 newY = curRect.mTop + new_window_height - curRect.getHeight();
curRect.setLeftTopAndSize(curRect.mLeft, newY, MIN_WINDOW_WIDTH, new_window_height);
S32 newWidth = curRect.getWidth() < MIN_WINDOW_WIDTH ? MIN_WINDOW_WIDTH
: curRect.getWidth();
curRect.setLeftTopAndSize(curRect.mLeft, newY, newWidth, new_window_height);
reshape(curRect.getWidth(), curRect.getHeight(), TRUE);
setRect(curRect);

View File

@ -3,7 +3,7 @@
legacy_header_height="18"
can_minimize="true"
can_tear_off="false"
can_resize="false"
can_resize="true"
can_drag_on_left="false"
can_close="false"
can_dock="true"

View File

@ -15,7 +15,7 @@
height="23"
can_minimize="true"
can_tear_off="false"
can_resize="false"
can_resize="true"
can_drag_on_left="false"
can_close="false"
can_dock="true"