From ebb492089498450d858126bce35fecf09e62324d Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 28 Sep 2010 17:13:24 -0700 Subject: added xui param to turn off drag-and-drop reordering of bottom tray buttons --- indra/newview/llbottomtray.cpp | 52 +++++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 24 deletions(-) (limited to 'indra/newview/llbottomtray.cpp') diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index 33d006578d..b5fa198bae 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -65,31 +65,42 @@ LLDefaultChildRegistry::Register bottomtray_button("bottomtr // virtual BOOL LLBottomtrayButton::handleHover(S32 x, S32 y, MASK mask) { - S32 screenX, screenY; - localPointToScreen(x, y, &screenX, &screenY); - // pass hover to bottomtray - LLBottomTray::getInstance()->onDraggableButtonHover(screenX, screenY); - return FALSE; + if (mCanDrag) + { + S32 screenX, screenY; + localPointToScreen(x, y, &screenX, &screenY); + // pass hover to bottomtray + LLBottomTray::getInstance()->onDraggableButtonHover(screenX, screenY); + return TRUE; + } + else + { + return LLButton::handleHover(x, y, mask); + } } //virtual BOOL LLBottomtrayButton::handleMouseUp(S32 x, S32 y, MASK mask) { - S32 screenX, screenY; - localPointToScreen(x, y, &screenX, &screenY); - // pass mouse up to bottomtray - LLBottomTray::getInstance()->onDraggableButtonMouseUp(this, screenX, screenY); - LLButton::handleMouseUp(x, y, mask); - return FALSE; + if (mCanDrag) + { + S32 screenX, screenY; + localPointToScreen(x, y, &screenX, &screenY); + // pass mouse up to bottomtray + LLBottomTray::getInstance()->onDraggableButtonMouseUp(this, screenX, screenY); + } + return LLButton::handleMouseUp(x, y, mask); } //virtual BOOL LLBottomtrayButton::handleMouseDown(S32 x, S32 y, MASK mask) { - S32 screenX, screenY; - localPointToScreen(x, y, &screenX, &screenY); - // pass mouse up to bottomtray - LLBottomTray::getInstance()->onDraggableButtonMouseDown(this, screenX, screenY); - LLButton::handleMouseDown(x, y, mask); - return FALSE; + if (mCanDrag) + { + S32 screenX, screenY; + localPointToScreen(x, y, &screenX, &screenY); + // pass mouse up to bottomtray + LLBottomTray::getInstance()->onDraggableButtonMouseDown(this, screenX, screenY); + } + return LLButton::handleMouseDown(x, y, mask); } static void update_build_button_enable_state() @@ -150,8 +161,6 @@ public: { mFactoryMap["chat_bar"] = LLCallbackMap(LLBottomTray::createNearbyChatBar, NULL); buildFromFile("panel_bottomtray_lite.xml"); - // Necessary for focus movement among child controls - setFocusRoot(TRUE); } BOOL postBuild() @@ -211,16 +220,11 @@ LLBottomTray::LLBottomTray(const LLSD&) buildFromFile("panel_bottomtray.xml"); - LLUICtrl::CommitCallbackRegistry::defaultRegistrar().add("CameraPresets.ChangeView", boost::bind(&LLFloaterCamera::onClickCameraItem, _2)); - //this is to fix a crash that occurs because LLBottomTray is a singleton //and thus is deleted at the end of the viewers lifetime, but to be cleanly //destroyed LLBottomTray requires some subsystems that are long gone //LLUI::getRootView()->addChild(this); - // Necessary for focus movement among child controls - setFocusRoot(TRUE); - { mBottomTrayLite = new LLBottomTrayLite(); mBottomTrayLite->setFollowsAll(); -- cgit v1.2.3 From 01b28ddf5ddc7118bc8b2047d899aee0293a8721 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Wed, 6 Oct 2010 20:10:36 -0700 Subject: EXP-156 WIP Implement custom Skylight hints --- indra/newview/llbottomtray.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llbottomtray.cpp') diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index e47009c540..d869850b7c 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -517,6 +517,7 @@ void LLBottomTray::toggleCameraControls() BOOL LLBottomTray::postBuild() { + LLHints::registerHintTarget("dest_guide_btn", getChild("destinations_btn")->getHandle()); LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("NearbyChatBar.Action", boost::bind(&LLBottomTray::onContextMenuItemClicked, this, _2)); LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("NearbyChatBar.EnableMenuItem", boost::bind(&LLBottomTray::onContextMenuItemEnabled, this, _2)); -- cgit v1.2.3 From d8e40a49ed6b57c5f2b0325803a11cf04b987652 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 7 Oct 2010 15:35:17 -0700 Subject: EXP-156 FIXED custom Skylight hints moved move hint down to bottom of screen made destination hint go away on teleport --- indra/newview/llbottomtray.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llbottomtray.cpp') diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index d869850b7c..fd11045f56 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -517,6 +517,7 @@ void LLBottomTray::toggleCameraControls() BOOL LLBottomTray::postBuild() { + LLHints::registerHintTarget("bottom_tray", LLView::getHandle()); LLHints::registerHintTarget("dest_guide_btn", getChild("destinations_btn")->getHandle()); LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("NearbyChatBar.Action", boost::bind(&LLBottomTray::onContextMenuItemClicked, this, _2)); -- cgit v1.2.3 From 7c256e5a13dc32af12aa5c9f90a1be040e4e64e2 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Mon, 11 Oct 2010 15:48:36 -0700 Subject: EXP-166 FIXED Front an Side Preset Views not accessible in Skylight viewer --- indra/newview/llbottomtray.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llbottomtray.cpp') diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index fd11045f56..758bc7be64 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -220,6 +220,8 @@ LLBottomTray::LLBottomTray(const LLSD&) buildFromFile("panel_bottomtray.xml"); + LLUICtrl::CommitCallbackRegistry::defaultRegistrar().add("CameraPresets.ChangeView", boost::bind(&LLFloaterCamera::onClickCameraItem, _2)); + //this is to fix a crash that occurs because LLBottomTray is a singleton //and thus is deleted at the end of the viewers lifetime, but to be cleanly //destroyed LLBottomTray requires some subsystems that are long gone -- cgit v1.2.3 From e638204dc2d8b409f17f7cdf8938deb97d137dbc Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 21 Oct 2010 17:14:14 -0700 Subject: EXP-273 WIP added avatar picker popup and hint --- indra/newview/llbottomtray.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llbottomtray.cpp') diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index 758bc7be64..1ba2a69289 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -521,6 +521,7 @@ BOOL LLBottomTray::postBuild() { LLHints::registerHintTarget("bottom_tray", LLView::getHandle()); LLHints::registerHintTarget("dest_guide_btn", getChild("destinations_btn")->getHandle()); + LLHints::registerHintTarget("avatar_picker_btn", getChild("avatar_picker_btn")->getHandle()); LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("NearbyChatBar.Action", boost::bind(&LLBottomTray::onContextMenuItemClicked, this, _2)); LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("NearbyChatBar.EnableMenuItem", boost::bind(&LLBottomTray::onContextMenuItemEnabled, this, _2)); -- cgit v1.2.3 From 4df678e33461e960cbe49bdb1cb23afe799b6cdb Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 26 Oct 2010 11:24:32 -0700 Subject: EXP-331 FIXED Avatar and Destination Guild UI Hints not showing --- indra/newview/llbottomtray.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llbottomtray.cpp') diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index 1ba2a69289..5dfb9bda3c 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -520,8 +520,8 @@ void LLBottomTray::toggleCameraControls() BOOL LLBottomTray::postBuild() { LLHints::registerHintTarget("bottom_tray", LLView::getHandle()); - LLHints::registerHintTarget("dest_guide_btn", getChild("destinations_btn")->getHandle()); - LLHints::registerHintTarget("avatar_picker_btn", getChild("avatar_picker_btn")->getHandle()); + LLHints::registerHintTarget("dest_guide_btn", getChild("destination_btn")->getHandle()); + LLHints::registerHintTarget("avatar_picker_btn", getChild("avatar_btn")->getHandle()); LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("NearbyChatBar.Action", boost::bind(&LLBottomTray::onContextMenuItemClicked, this, _2)); LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("NearbyChatBar.EnableMenuItem", boost::bind(&LLBottomTray::onContextMenuItemEnabled, this, _2)); -- cgit v1.2.3 From 2b39cf6c2d732c13517072c7c928588cdc41a3d1 Mon Sep 17 00:00:00 2001 From: Andrew Productengine Date: Thu, 25 Nov 2010 17:51:33 +0200 Subject: STORM-344 FIXED Fixed Speak button label shrinking when bottom bar has enough space for displaying full Speak label. Bug was caused by counting only width added by last resize as usable for Speak button extending, so widening viewer window by few pixels many times when Speak is shrink would never let it expand regardless of available space. - Added check for possible chiclet panel shrinking width- cause spare space goes to it when extending. If there is enough space to give from chiclets to Speak, Speak is extended. --- indra/newview/llbottomtray.cpp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'indra/newview/llbottomtray.cpp') diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index 29c2b7565e..6ccb5aaf54 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -1365,20 +1365,33 @@ void LLBottomTray::processExtendButtons(S32& available_width) processExtendButton(*it, available_width); } + const S32 chiclet_panel_width = mChicletPanel->getParent()->getRect().getWidth(); + static const S32 chiclet_panel_min_width = mChicletPanel->getMinWidth(); + const S32 available_width_chiclet = chiclet_panel_width - chiclet_panel_min_width; + // then try to extend Speak button - if (available_width > 0) + if (available_width > 0 || available_width_chiclet > 0) { S32 panel_max_width = mObjectDefaultWidthMap[RS_BUTTON_SPEAK]; S32 panel_width = mSpeakPanel->getRect().getWidth(); S32 possible_extend_width = panel_max_width - panel_width; - if (possible_extend_width >= 0 && possible_extend_width <= available_width) // HACK: this button doesn't change size so possible_extend_width will be 0 + + if (possible_extend_width >= 0 && possible_extend_width <= available_width + available_width_chiclet) // HACK: this button doesn't change size so possible_extend_width will be 0 { mSpeakBtn->setLabelVisible(true); mSpeakPanel->reshape(panel_max_width, mSpeakPanel->getRect().getHeight()); log(mSpeakBtn, "speak button is extended"); - available_width -= possible_extend_width; - + if( available_width > possible_extend_width) + { + available_width -= possible_extend_width; + } + else + { + S32 required_width = possible_extend_width - available_width; + available_width = 0; + mChicletPanel->getParent()->reshape(mChicletPanel->getParent()->getRect().getWidth() - required_width, mChicletPanel->getParent()->getRect().getHeight()); + } lldebugs << "Extending Speak button panel: " << mSpeakPanel->getName() << ", extended width: " << possible_extend_width << ", rest width to process: " << available_width -- cgit v1.2.3