Skip to content
Snippets Groups Projects
Commit c1a9ca33 authored by callum's avatar callum
Browse files
Changeset: 20897:084550ee5c06
parents 28b97b24 8154c245
No related branches found
No related tags found
No related merge requests found
...@@ -37,9 +37,9 @@ ...@@ -37,9 +37,9 @@
#include "llavatarnamecache.h" #include "llavatarnamecache.h"
#include "llavatariconctrl.h" #include "llavatariconctrl.h"
#include "llavatarlist.h" #include "llavatarlist.h"
#include "llbottomtray.h"
#include "lldraghandle.h" #include "lldraghandle.h"
#include "llimfloater.h" #include "llimfloater.h"
#include "llimview.h"
#include "llfloaterreg.h" #include "llfloaterreg.h"
#include "llparticipantlist.h" #include "llparticipantlist.h"
#include "llspeakers.h" #include "llspeakers.h"
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#ifndef LL_LLCALLFLOATER_H #ifndef LL_LLCALLFLOATER_H
#define LL_LLCALLFLOATER_H #define LL_LLCALLFLOATER_H
#include "lltransientdockablefloater.h" #include "llfloater.h"
#include "llvoicechannel.h" #include "llvoicechannel.h"
#include "llvoiceclient.h" #include "llvoiceclient.h"
...@@ -262,9 +262,6 @@ class LLCallFloater : public LLFloater, LLVoiceClientParticipantObserver ...@@ -262,9 +262,6 @@ class LLCallFloater : public LLFloater, LLVoiceClientParticipantObserver
*/ */
static LLVoiceChannel* sCurrentVoiceChannel; static LLVoiceChannel* sCurrentVoiceChannel;
/* virtual */
LLTransientFloaterMgr::ETransientGroup getGroup() { return LLTransientFloaterMgr::IM; }
boost::signals2::connection mVoiceChannelStateChangeConnection; boost::signals2::connection mVoiceChannelStateChangeConnection;
}; };
......
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
#include "lljoystickbutton.h" #include "lljoystickbutton.h"
#include "llviewercontrol.h" #include "llviewercontrol.h"
#include "llviewercamera.h" #include "llviewercamera.h"
#include "llbottomtray.h"
#include "lltoolmgr.h" #include "lltoolmgr.h"
#include "lltoolfocus.h" #include "lltoolfocus.h"
#include "llslider.h" #include "llslider.h"
...@@ -314,12 +313,6 @@ void LLFloaterCamera::onOpen(const LLSD& key) ...@@ -314,12 +313,6 @@ void LLFloaterCamera::onOpen(const LLSD& key)
{ {
LLFirstUse::viewPopup(); LLFirstUse::viewPopup();
LLButton *anchor_panel = LLBottomTray::getInstance()->getChild<LLButton>("camera_btn");
setDockControl(new LLDockControl(
anchor_panel, this,
getDockTongue(), LLDockControl::TOP));
mZoom->onOpen(key); mZoom->onOpen(key);
// Returns to previous mode, see EXT-2727(View tool should remember state). // Returns to previous mode, see EXT-2727(View tool should remember state).
...@@ -343,15 +336,12 @@ void LLFloaterCamera::onClose(bool app_quitting) ...@@ -343,15 +336,12 @@ void LLFloaterCamera::onClose(bool app_quitting)
if (mCurrMode == CAMERA_CTRL_MODE_PAN) if (mCurrMode == CAMERA_CTRL_MODE_PAN)
mPrevMode = CAMERA_CTRL_MODE_PAN; mPrevMode = CAMERA_CTRL_MODE_PAN;
// HACK: Should always close as docked to prevent toggleInstance without calling onOpen.
if ( !isDocked() )
setDocked(true);
switchMode(CAMERA_CTRL_MODE_PAN); switchMode(CAMERA_CTRL_MODE_PAN);
mClosed = TRUE; mClosed = TRUE;
} }
LLFloaterCamera::LLFloaterCamera(const LLSD& val) LLFloaterCamera::LLFloaterCamera(const LLSD& val)
: LLTransientDockableFloater(NULL, true, val), : LLFloater(val),
mClosed(FALSE), mClosed(FALSE),
mCurrMode(CAMERA_CTRL_MODE_PAN), mCurrMode(CAMERA_CTRL_MODE_PAN),
mPrevMode(CAMERA_CTRL_MODE_PAN) mPrevMode(CAMERA_CTRL_MODE_PAN)
...@@ -379,7 +369,7 @@ BOOL LLFloaterCamera::postBuild() ...@@ -379,7 +369,7 @@ BOOL LLFloaterCamera::postBuild()
// ensure that appearance mode is handled while building. See EXT-7796. // ensure that appearance mode is handled while building. See EXT-7796.
handleAvatarEditingAppearance(sAppearanceEditing); handleAvatarEditingAppearance(sAppearanceEditing);
return LLDockableFloater::postBuild(); return TRUE;
} }
void LLFloaterCamera::fillFlatlistFromPanel (LLFlatListView* list, LLPanel* panel) void LLFloaterCamera::fillFlatlistFromPanel (LLFlatListView* list, LLPanel* panel)
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#ifndef LLFLOATERCAMERA_H #ifndef LLFLOATERCAMERA_H
#define LLFLOATERCAMERA_H #define LLFLOATERCAMERA_H
#include "lltransientdockablefloater.h" #include "llfloater.h"
#include "lliconctrl.h" #include "lliconctrl.h"
#include "lltextbox.h" #include "lltextbox.h"
#include "llflatlistview.h" #include "llflatlistview.h"
...@@ -45,8 +45,7 @@ enum ECameraControlMode ...@@ -45,8 +45,7 @@ enum ECameraControlMode
CAMERA_CTRL_MODE_PRESETS CAMERA_CTRL_MODE_PRESETS
}; };
class LLFloaterCamera class LLFloaterCamera : public LLFloater
: public LLTransientDockableFloater
{ {
friend class LLFloaterReg; friend class LLFloaterReg;
......
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
#include "llagent.h" #include "llagent.h"
#include "llagentcamera.h" #include "llagentcamera.h"
#include "llvoavatarself.h" // to check gAgentAvatarp->isSitting() #include "llvoavatarself.h" // to check gAgentAvatarp->isSitting()
#include "llbottomtray.h"
#include "llbutton.h" #include "llbutton.h"
#include "llfirstuse.h" #include "llfirstuse.h"
#include "llfloaterreg.h" #include "llfloaterreg.h"
...@@ -46,7 +45,8 @@ ...@@ -46,7 +45,8 @@
#include "lluictrlfactory.h" #include "lluictrlfactory.h"
#include "llviewerwindow.h" #include "llviewerwindow.h"
#include "llviewercontrol.h" #include "llviewercontrol.h"
#include "llselectmgr.h" #include "llselectmgr.h"
#include "lltoolbarview.h"
#include "llviewerparcelmgr.h" #include "llviewerparcelmgr.h"
#include "llviewerregion.h" #include "llviewerregion.h"
#include "lltooltip.h" #include "lltooltip.h"
...@@ -59,15 +59,13 @@ const F32 MOVE_BUTTON_DELAY = 0.0f; ...@@ -59,15 +59,13 @@ const F32 MOVE_BUTTON_DELAY = 0.0f;
const F32 YAW_NUDGE_RATE = 0.05f; // fraction of normal speed const F32 YAW_NUDGE_RATE = 0.05f; // fraction of normal speed
const F32 NUDGE_TIME = 0.25f; // in seconds const F32 NUDGE_TIME = 0.25f; // in seconds
const std::string BOTTOM_TRAY_BUTTON_NAME = "movement_btn";
// //
// Member functions // Member functions
// //
// protected // protected
LLFloaterMove::LLFloaterMove(const LLSD& key) LLFloaterMove::LLFloaterMove(const LLSD& key)
: LLTransientDockableFloater(NULL, true, key), : LLFloater(key),
mForwardButton(NULL), mForwardButton(NULL),
mBackwardButton(NULL), mBackwardButton(NULL),
mTurnLeftButton(NULL), mTurnLeftButton(NULL),
...@@ -94,8 +92,6 @@ BOOL LLFloaterMove::postBuild() ...@@ -94,8 +92,6 @@ BOOL LLFloaterMove::postBuild()
{ {
updateTransparency(TT_ACTIVE); // force using active floater transparency (STORM-730) updateTransparency(TT_ACTIVE); // force using active floater transparency (STORM-730)
LLDockableFloater::postBuild();
// Code that implements floater buttons toggling when user moves via keyboard is located in LLAgent::propagate() // Code that implements floater buttons toggling when user moves via keyboard is located in LLAgent::propagate()
mForwardButton = getChild<LLJoystickAgentTurn>("forward btn"); mForwardButton = getChild<LLJoystickAgentTurn>("forward btn");
...@@ -153,10 +149,10 @@ BOOL LLFloaterMove::postBuild() ...@@ -153,10 +149,10 @@ BOOL LLFloaterMove::postBuild()
// virtual // virtual
void LLFloaterMove::setVisible(BOOL visible) void LLFloaterMove::setVisible(BOOL visible)
{ {
// Do nothing with Stand/Stop Flying panel in excessive calls of this method (from LLTransientFloaterMgr?). // Do nothing with Stand/Stop Flying panel in excessive calls of this method.
if (getVisible() == visible) if (getVisible() == visible)
{ {
LLTransientDockableFloater::setVisible(visible); LLFloater::setVisible(visible);
return; return;
} }
...@@ -175,7 +171,7 @@ void LLFloaterMove::setVisible(BOOL visible) ...@@ -175,7 +171,7 @@ void LLFloaterMove::setVisible(BOOL visible)
LLPanelStandStopFlying::getInstance()->reparent(NULL); LLPanelStandStopFlying::getInstance()->reparent(NULL);
} }
LLTransientDockableFloater::setVisible(visible); LLFloater::setVisible(visible);
} }
// static // static
...@@ -439,30 +435,6 @@ void LLFloaterMove::setModeTitle(const EMovementMode mode) ...@@ -439,30 +435,6 @@ void LLFloaterMove::setModeTitle(const EMovementMode mode)
setTitle(title); setTitle(title);
} }
/**
* Updates position of the floater to be center aligned with Move button.
*/
void LLFloaterMove::updatePosition()
{
LLBottomTray* tray = LLBottomTray::getInstance();
if (!tray) return;
LLButton* movement_btn = tray->findChild<LLButton>(BOTTOM_TRAY_BUTTON_NAME);
if (movement_btn)
{
//align centers of a button and a floater
S32 x = movement_btn->calcScreenRect().getCenterX() - getRect().getWidth()/2;
S32 y = 0;
if (!mModeActionsPanel->getVisible())
{
y = mModeActionsPanel->getRect().getHeight();
}
setOrigin(x, y);
}
}
//static //static
void LLFloaterMove::sUpdateFlyingStatus() void LLFloaterMove::sUpdateFlyingStatus()
{ {
...@@ -497,8 +469,6 @@ void LLFloaterMove::enableInstance(BOOL bEnable) ...@@ -497,8 +469,6 @@ void LLFloaterMove::enableInstance(BOOL bEnable)
void LLFloaterMove::onOpen(const LLSD& key) void LLFloaterMove::onOpen(const LLSD& key)
{ {
LLButton *anchor_panel = LLBottomTray::getInstance()->getChild<LLButton>("movement_btn");
if (gAgent.getFlying()) if (gAgent.getFlying())
{ {
setFlyingMode(TRUE); setFlyingMode(TRUE);
...@@ -511,19 +481,9 @@ void LLFloaterMove::onOpen(const LLSD& key) ...@@ -511,19 +481,9 @@ void LLFloaterMove::onOpen(const LLSD& key)
showModeButtons(FALSE); showModeButtons(FALSE);
} }
setDockControl(new LLDockControl(
anchor_panel, this,
getDockTongue(), LLDockControl::TOP));
sUpdateFlyingStatus(); sUpdateFlyingStatus();
} }
//virtual
void LLFloaterMove::setDocked(bool docked, bool pop_on_undock/* = true*/)
{
LLTransientDockableFloater::setDocked(docked, pop_on_undock);
}
void LLFloaterMove::setModeButtonToggleState(const EMovementMode mode) void LLFloaterMove::setModeButtonToggleState(const EMovementMode mode)
{ {
llassert_always(mModeControlButtonMap.end() != mModeControlButtonMap.find(mode)); llassert_always(mModeControlButtonMap.end() != mModeControlButtonMap.find(mode));
...@@ -734,23 +694,27 @@ void LLPanelStandStopFlying::onStopFlyingButtonClick() ...@@ -734,23 +694,27 @@ void LLPanelStandStopFlying::onStopFlyingButtonClick()
*/ */
void LLPanelStandStopFlying::updatePosition() void LLPanelStandStopFlying::updatePosition()
{ {
LLBottomTray* tray = LLBottomTray::getInstance(); if (mAttached) return;
if (!tray || mAttached) return;
LLButton* movement_btn = tray->findChild<LLButton>(BOTTOM_TRAY_BUTTON_NAME);
S32 x = 0; S32 x = 0;
if (movement_btn) S32 y = 0;
if(LLView* root = getRootView())
{ {
// Align centers of the button and the panel. x = root->calcScreenRect().getCenterX() - getRect().getWidth()/2;
x = movement_btn->calcScreenRect().getCenterX() - getRect().getWidth()/2;
} }
else
if (LLToolBar* toolbar_bottom = gToolBarView->getChild<LLToolBar>("toolbar_bottom"))
{ {
x = tray->calcScreenRect().getCenterX() - getRect().getWidth()/2; y = toolbar_bottom->getRect().getHeight();
} }
if(LLPanel* panel_ssf_container = getRootView()->getChild<LLPanel>("stand_stop_flying_container"))
{
panel_ssf_container->setOrigin(0, y);
}
setOrigin(x, 0); setOrigin(x, 0);
} }
// EOF // EOF
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#define LL_LLMOVEVIEW_H #define LL_LLMOVEVIEW_H
// Library includes // Library includes
#include "lltransientdockablefloater.h" #include "llfloater.h"
class LLButton; class LLButton;
class LLJoystickAgentTurn; class LLJoystickAgentTurn;
...@@ -38,7 +38,7 @@ class LLJoystickAgentSlide; ...@@ -38,7 +38,7 @@ class LLJoystickAgentSlide;
// Classes // Classes
// //
class LLFloaterMove class LLFloaterMove
: public LLTransientDockableFloater : public LLFloater
{ {
LOG_CLASS(LLFloaterMove); LOG_CLASS(LLFloaterMove);
friend class LLFloaterReg; friend class LLFloaterReg;
...@@ -58,7 +58,6 @@ class LLFloaterMove ...@@ -58,7 +58,6 @@ class LLFloaterMove
static void setSittingMode(BOOL bSitting); static void setSittingMode(BOOL bSitting);
static void enableInstance(BOOL bEnable); static void enableInstance(BOOL bEnable);
/*virtual*/ void onOpen(const LLSD& key); /*virtual*/ void onOpen(const LLSD& key);
/*virtual*/ void setDocked(bool docked, bool pop_on_undock = true);
static void sUpdateFlyingStatus(); static void sUpdateFlyingStatus();
...@@ -87,7 +86,6 @@ class LLFloaterMove ...@@ -87,7 +86,6 @@ class LLFloaterMove
void initModeButtonMap(); void initModeButtonMap();
void setModeButtonToggleState(const EMovementMode mode); void setModeButtonToggleState(const EMovementMode mode);
void updateButtonsWithMovementMode(const EMovementMode newMode); void updateButtonsWithMovementMode(const EMovementMode newMode);
void updatePosition();
void showModeButtons(BOOL bShow); void showModeButtons(BOOL bShow);
public: public:
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include "lliconctrl.h" #include "lliconctrl.h"
#include "llfloatersidepanelcontainer.h" #include "llfloatersidepanelcontainer.h"
#include "llfocusmgr.h" #include "llfocusmgr.h"
#include "lllogchat.h"
#include "llresizebar.h" #include "llresizebar.h"
#include "llresizehandle.h" #include "llresizehandle.h"
#include "llmenugl.h" #include "llmenugl.h"
...@@ -50,7 +51,6 @@ ...@@ -50,7 +51,6 @@
#include "lldraghandle.h" #include "lldraghandle.h"
#include "llbottomtray.h"
#include "llnearbychatbar.h" #include "llnearbychatbar.h"
#include "llfloaterreg.h" #include "llfloaterreg.h"
#include "lltrans.h" #include "lltrans.h"
......
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
#include "llfirstuse.h" #include "llfirstuse.h"
#include "llnearbychatbar.h" #include "llnearbychatbar.h"
#include "llbottomtray.h"
#include "llagent.h" #include "llagent.h"
#include "llgesturemgr.h" #include "llgesturemgr.h"
#include "llmultigesture.h" #include "llmultigesture.h"
...@@ -58,8 +57,6 @@ const S32 EXPANDED_HEIGHT = 300; ...@@ -58,8 +57,6 @@ const S32 EXPANDED_HEIGHT = 300;
// legacy callback glue // legacy callback glue
void send_chat_from_viewer(const std::string& utf8_out_text, EChatType type, S32 channel); void send_chat_from_viewer(const std::string& utf8_out_text, EChatType type, S32 channel);
static LLDefaultChildRegistry::Register<LLGestureComboList> r("gesture_combo_list");
struct LLChatTypeTrigger { struct LLChatTypeTrigger {
std::string name; std::string name;
EChatType type; EChatType type;
...@@ -70,351 +67,6 @@ static LLChatTypeTrigger sChatTypeTriggers[] = { ...@@ -70,351 +67,6 @@ static LLChatTypeTrigger sChatTypeTriggers[] = {
{ "/shout" , CHAT_TYPE_SHOUT} { "/shout" , CHAT_TYPE_SHOUT}
}; };
//ext-7367
//Problem: gesture list control (actually LLScrollListCtrl) didn't actually process mouse wheel message.
// introduce new gesture list subclass to "eat" mouse wheel messages (and probably some other messages)
class LLGestureScrollListCtrl: public LLScrollListCtrl
{
protected:
friend class LLUICtrlFactory;
LLGestureScrollListCtrl(const LLScrollListCtrl::Params& params)
:LLScrollListCtrl(params)
{
}
public:
BOOL handleScrollWheel(S32 x, S32 y, S32 clicks)
{
LLScrollListCtrl::handleScrollWheel( x, y, clicks );
return TRUE;
}
//See EXT-6598
//Mouse hover over separator will result in not processing tooltip message
//So eat this message
BOOL handleToolTip(S32 x, S32 y, MASK mask)
{
LLScrollListCtrl::handleToolTip( x, y, mask );
return TRUE;
}
};
LLGestureComboList::Params::Params()
: combo_button("combo_button"),
combo_list("combo_list"),
get_more("get_more", true),
view_all("view_all", true)
{
}
LLGestureComboList::LLGestureComboList(const LLGestureComboList::Params& p)
: LLUICtrl(p),
mLabel(p.label),
mViewAllItemIndex(-1),
mGetMoreItemIndex(-1),
mShowViewAll(p.view_all),
mShowGetMore(p.get_more)
{
LLBottomtrayButton::Params button_params = p.combo_button;
button_params.follows.flags(FOLLOWS_LEFT|FOLLOWS_BOTTOM|FOLLOWS_RIGHT);
mButton = LLUICtrlFactory::create<LLBottomtrayButton>(button_params);
mButton->reshape(getRect().getWidth(),getRect().getHeight());
mButton->setCommitCallback(boost::bind(&LLGestureComboList::onButtonCommit, this));
addChild(mButton);
LLGestureScrollListCtrl::Params params(p.combo_list);
params.name("GestureComboList");
params.commit_callback.function(boost::bind(&LLGestureComboList::onItemSelected, this, _2));
params.visible(false);
params.commit_on_keyboard_movement(false);
mList = LLUICtrlFactory::create<LLGestureScrollListCtrl>(params);
addChild(mList);
//****************************Gesture Part********************************/
setCommitCallback(boost::bind(&LLGestureComboList::onCommitGesture, this));
// now register us as observer since we have a place to put the results
LLGestureMgr::instance().addObserver(this);
// refresh list from current active gestures
refreshGestures();
setFocusLostCallback(boost::bind(&LLGestureComboList::hideList, this));
}
BOOL LLGestureComboList::handleKeyHere(KEY key, MASK mask)
{
BOOL handled = FALSE;
if (key == KEY_ESCAPE && mask == MASK_NONE )
{
hideList();
handled = TRUE;
}
else
{
handled = mList->handleKeyHere(key, mask);
}
return handled;
}
void LLGestureComboList::draw()
{
LLUICtrl::draw();
if(mButton->getToggleState())
{
showList();
}
}
void LLGestureComboList::showList()
{
LLRect rect = mList->getRect();
LLRect button_rect = mButton->getRect();
// Calculating amount of space between the navigation bar and gestures combo
LLNavigationBar* nb = LLNavigationBar::getInstance();
S32 x, nb_bottom;
nb->localPointToOtherView(0, 0, &x, &nb_bottom, this);
S32 max_height = nb_bottom - button_rect.mTop;
mList->calcColumnWidths();
rect.setOriginAndSize(button_rect.mLeft, button_rect.mTop, llmax(mList->getMaxContentWidth(),mButton->getRect().getWidth()), max_height);
mList->setRect(rect);
mList->fitContents( llmax(mList->getMaxContentWidth(),mButton->getRect().getWidth()), max_height);
gFocusMgr.setKeyboardFocus(this);
// Show the list and push the button down
mButton->setToggleState(TRUE);
mList->setVisible(TRUE);
sendChildToFront(mList);
LLUI::addPopup(mList);
}
void LLGestureComboList::onButtonCommit()
{
if (!mList->getVisible())
{
// highlight the last selected item from the original selection before potentially selecting a new item
// as visual cue to original value of combo box
LLScrollListItem* last_selected_item = mList->getLastSelectedItem();
if (last_selected_item)
{
mList->mouseOverHighlightNthItem(mList->getItemIndex(last_selected_item));
}
if (mList->getItemCount() != 0)
{
showList();
}
}
else
{
hideList();
}
}
void LLGestureComboList::hideList()
{
if (mList->getVisible())
{
mButton->setToggleState(FALSE);
mList->setVisible(FALSE);
mList->mouseOverHighlightNthItem(-1);
LLUI::removePopup(mList);
gFocusMgr.setKeyboardFocus(NULL);
}
}
S32 LLGestureComboList::getCurrentIndex() const
{
LLScrollListItem* item = mList->getFirstSelected();
if( item )
{
return mList->getItemIndex( item );
}
return -1;
}
void LLGestureComboList::onItemSelected(const LLSD& data)
{
const std::string name = mList->getSelectedItemLabel();
S32 cur_id = getCurrentIndex();
mLastSelectedIndex = cur_id;
if (cur_id != mList->getItemCount()-1 && cur_id != -1)
{
mButton->setLabel(name);
}
// hiding the list reasserts the old value stored in the text editor/dropdown button
hideList();
// commit does the reverse, asserting the value in the list
onCommit();
}
void LLGestureComboList::sortByName(bool ascending)
{
mList->sortOnce(0, ascending);
}
LLSD LLGestureComboList::getValue() const
{
LLScrollListItem* item = mList->getFirstSelected();
if( item )
{
return item->getValue();
}
else
{
return LLSD();
}
}
void LLGestureComboList::refreshGestures()
{
//store current selection so we can maintain it
LLSD cur_gesture = getValue();
mList->selectFirstItem();
mList->clearRows();
mGestures.clear();
LLGestureMgr::item_map_t::const_iterator it;
const LLGestureMgr::item_map_t& active_gestures = LLGestureMgr::instance().getActiveGestures();
LLSD::Integer idx(0);
for (it = active_gestures.begin(); it != active_gestures.end(); ++it)
{
LLMultiGesture* gesture = (*it).second;
if (gesture)
{
mList->addSimpleElement(gesture->mName, ADD_BOTTOM, LLSD(idx));
mGestures.push_back(gesture);
idx++;
}
}
sortByName();
// store indices for Get More and View All items (idx is the index followed by the last added Gesture)
if (mShowGetMore)
{
mGetMoreItemIndex = idx;
mList->addSimpleElement(LLTrans::getString("GetMoreGestures"), ADD_BOTTOM, LLSD(mGetMoreItemIndex));
}
if (mShowViewAll)
{
mViewAllItemIndex = idx + 1;
mList->addSimpleElement(LLTrans::getString("ViewAllGestures"), ADD_BOTTOM, LLSD(mViewAllItemIndex));
}
// Insert label after sorting, at top, with separator below it
mList->addSeparator(ADD_TOP);
mList->addSimpleElement(mLabel, ADD_TOP);
if (cur_gesture.isDefined())
{
mList->selectByValue(cur_gesture);
}
else
{
mList->selectFirstItem();
}
LLCtrlListInterface* gestures = getListInterface();
LLMultiGesture* gesture = NULL;
if (gestures)
{
S32 sel_index = gestures->getFirstSelectedIndex();
if (sel_index != 0)
{
S32 index = gestures->getSelectedValue().asInteger();
if (index<0 || index >= (S32)mGestures.size())
{
llwarns << "out of range gesture access" << llendl;
}
else
{
gesture = mGestures.at(index);
}
}
}
if(gesture && LLGestureMgr::instance().isGesturePlaying(gesture))
{
return;
}
mButton->setLabel(mLabel);
}
void LLGestureComboList::onCommitGesture()
{
LLCtrlListInterface* gestures = getListInterface();
if (gestures)
{
S32 sel_index = gestures->getFirstSelectedIndex();
if (sel_index == 0)
{
return;
}
S32 index = gestures->getSelectedValue().asInteger();
if (mViewAllItemIndex == index)
{
// The same behavior as Ctrl+G. EXT-823
LLFloaterReg::toggleInstance("gestures");
gestures->selectFirstItem();
return;
}
if (mGetMoreItemIndex == index)
{
LLWeb::loadURLExternal(gSavedSettings.getString("GesturesMarketplaceURL"));
return;
}
if (index<0 || index >= (S32)mGestures.size())
{
llwarns << "out of range gesture index" << llendl;
}
else
{
LLMultiGesture* gesture = mGestures.at(index);
if(gesture)
{
LLGestureMgr::instance().playGesture(gesture);
if(!gesture->mReplaceText.empty())
{
LLNearbyChatBar::sendChatFromViewer(gesture->mReplaceText, CHAT_TYPE_NORMAL, FALSE);
}
}
}
}
}
LLGestureComboList::~LLGestureComboList()
{
LLGestureMgr::instance().removeObserver(this);
}
LLCtrlListInterface* LLGestureComboList::getListInterface()
{
return mList;
}
LLNearbyChatBar::LLNearbyChatBar(const LLSD& key) LLNearbyChatBar::LLNearbyChatBar(const LLSD& key)
: LLFloater(key), : LLFloater(key),
mChatBox(NULL) mChatBox(NULL)
...@@ -839,11 +491,6 @@ void LLNearbyChatBar::startChat(const char* line) ...@@ -839,11 +491,6 @@ void LLNearbyChatBar::startChat(const char* line)
// static // static
void LLNearbyChatBar::stopChat() void LLNearbyChatBar::stopChat()
{ {
LLBottomTray *bt = LLBottomTray::getInstance();
if (!bt)
return;
LLNearbyChatBar* cb = LLNearbyChatBar::getInstance(); LLNearbyChatBar* cb = LLNearbyChatBar::getInstance();
if (!cb) if (!cb)
......
...@@ -27,73 +27,15 @@ ...@@ -27,73 +27,15 @@
#ifndef LL_LLNEARBYCHATBAR_H #ifndef LL_LLNEARBYCHATBAR_H
#define LL_LLNEARBYCHATBAR_H #define LL_LLNEARBYCHATBAR_H
#include "llpanel.h" #include "llfloater.h"
#include "llcombobox.h" #include "llcombobox.h"
#include "llgesturemgr.h" #include "llgesturemgr.h"
#include "llchat.h" #include "llchat.h"
#include "llvoiceclient.h" #include "llvoiceclient.h"
#include "lloutputmonitorctrl.h" #include "lloutputmonitorctrl.h"
#include "llspeakers.h" #include "llspeakers.h"
#include "llbottomtray.h"
class LLNearbyChatBar : public LLFloater
class LLGestureComboList
: public LLGestureManagerObserver
, public LLUICtrl
{
public:
struct Params : public LLInitParam::Block<Params, LLUICtrl::Params>
{
Optional<LLBottomtrayButton::Params> combo_button;
Optional<LLScrollListCtrl::Params> combo_list;
Optional<bool> get_more,
view_all;
Params();
};
protected:
friend class LLUICtrlFactory;
LLGestureComboList(const Params&);
std::vector<LLMultiGesture*> mGestures;
std::string mLabel;
bool mShowViewAll;
bool mShowGetMore;
LLSD::Integer mViewAllItemIndex;
LLSD::Integer mGetMoreItemIndex;
public:
~LLGestureComboList();
LLCtrlListInterface* getListInterface();
virtual void showList();
virtual void hideList();
virtual BOOL handleKeyHere(KEY key, MASK mask);
virtual void draw();
S32 getCurrentIndex() const;
void onItemSelected(const LLSD& data);
void sortByName(bool ascending = true);
void refreshGestures();
void onCommitGesture();
void onButtonCommit();
virtual LLSD getValue() const;
// LLGestureManagerObserver trigger
virtual void changed() { refreshGestures(); }
private:
LLButton* mButton;
LLScrollListCtrl* mList;
S32 mLastSelectedIndex;
};
class LLNearbyChatBar
: public LLFloater
{ {
public: public:
// constructor for inline chat-bars (e.g. hosted in chat history window) // constructor for inline chat-bars (e.g. hosted in chat history window)
......
<?xml version="1.0" encoding="utf-8" standalone="yes" ?> <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<floater <floater
legacy_header_height="18" legacy_header_height="18"
can_dock="true"
can_minimize="true" can_minimize="true"
can_close="false" can_close="true"
follows="bottom" follows="bottom"
height="164" height="164"
layout="topleft" layout="topleft"
...@@ -11,7 +10,6 @@ ...@@ -11,7 +10,6 @@
help_topic="camera_floater" help_topic="camera_floater"
save_rect="true" save_rect="true"
save_visibility="true" save_visibility="true"
save_dock_state="true"
single_instance="true" single_instance="true"
width="228"> width="228">
<floater.string <floater.string
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment