Right click on Inbox or Outbox toggles up down arrow but has no action
master
Leyla Farazha 2011-06-16 16:39:30 -07:00
parent f42d2607be
commit 64f978dc81
4 changed files with 39 additions and 25 deletions

View File

@ -100,7 +100,8 @@ LLButton::Params::Params()
hover_glow_amount("hover_glow_amount"),
commit_on_return("commit_on_return", true),
use_draw_context_alpha("use_draw_context_alpha", true),
badge("badge")
badge("badge"),
handle_right_mouse("handle_right_mouse")
{
addSynonym(is_toggle, "toggle");
held_down_delay.seconds = 0.5f;
@ -162,7 +163,8 @@ LLButton::LLButton(const LLButton::Params& p)
mMouseDownSignal(NULL),
mMouseUpSignal(NULL),
mHeldDownSignal(NULL),
mUseDrawContextAlpha(p.use_draw_context_alpha)
mUseDrawContextAlpha(p.use_draw_context_alpha),
mHandleRightMouse(p.handle_right_mouse)
{
static LLUICachedControl<S32> llbutton_orig_h_pad ("UIButtonOrigHPad", 0);
static Params default_params(LLUICtrlFactory::getDefaultParams<LLButton>());
@ -457,7 +459,7 @@ BOOL LLButton::handleMouseUp(S32 x, S32 y, MASK mask)
BOOL LLButton::handleRightMouseDown(S32 x, S32 y, MASK mask)
{
if (!childrenHandleRightMouseDown(x, y, mask))
if (mHandleRightMouse && !childrenHandleRightMouseDown(x, y, mask))
{
// Route future Mouse messages here preemptively. (Release on mouse up.)
gFocusMgr.setMouseCapture( this );
@ -470,37 +472,42 @@ BOOL LLButton::handleRightMouseDown(S32 x, S32 y, MASK mask)
// if (pointInView(x, y))
// {
// }
// send the mouse down signal
LLUICtrl::handleRightMouseDown(x,y,mask);
// *TODO: Return result of LLUICtrl call above? Should defer to base class
// but this might change the mouse handling of existing buttons in a bad way
// if they are not mouse opaque.
}
// send the mouse down signal
LLUICtrl::handleRightMouseDown(x,y,mask);
// *TODO: Return result of LLUICtrl call above? Should defer to base class
// but this might change the mouse handling of existing buttons in a bad way
// if they are not mouse opaque.
return TRUE;
}
BOOL LLButton::handleRightMouseUp(S32 x, S32 y, MASK mask)
{
// We only handle the click if the click both started and ended within us
if( hasMouseCapture() )
if (mHandleRightMouse)
{
// Always release the mouse
gFocusMgr.setMouseCapture( NULL );
// We only handle the click if the click both started and ended within us
if( hasMouseCapture() )
{
// Always release the mouse
gFocusMgr.setMouseCapture( NULL );
// if (pointInView(x, y))
// {
// mRightMouseUpSignal(this, x,y,mask);
// }
// if (pointInView(x, y))
// {
// mRightMouseUpSignal(this, x,y,mask);
// }
}
else
{
childrenHandleRightMouseUp(x, y, mask);
}
// send the mouse up signal
LLUICtrl::handleRightMouseUp(x,y,mask);
// *TODO: Return result of LLUICtrl call above? Should defer to base class
// but this might change the mouse handling of existing buttons in a bad way.
// if they are not mouse opaque.
}
else
{
childrenHandleRightMouseUp(x, y, mask);
}
// send the mouse up signal
LLUICtrl::handleRightMouseUp(x,y,mask);
// *TODO: Return result of LLUICtrl call above? Should defer to base class
// but this might change the mouse handling of existing buttons in a bad way.
// if they are not mouse opaque.
return TRUE;
}

View File

@ -129,6 +129,8 @@ public:
Optional<LLBadge::Params> badge;
Optional<bool> handle_right_mouse;
Params();
};
@ -359,6 +361,8 @@ private:
bool mForcePressedState;
LLFrameTimer mFlashingTimer;
bool mHandleRightMouse;
};
// Build time optimization, generate once in .cpp file

View File

@ -76,6 +76,7 @@
image_unselected="MarketplaceBtn_Off"
image_selected="MarketplaceBtn_Selected"
halign="left"
handle_right_mouse="false"
follows="top|left|right"
is_toggle="true"
tab_stop="false"
@ -154,6 +155,7 @@
<button
label="Merchant Outbox"
is_toggle="true"
handle_right_mouse="false"
name="outbox_btn"
follows="top|left|right"
image_unselected="MarketplaceBtn_Off"

View File

@ -25,5 +25,6 @@
pad_bottom="3"
height="23"
scale_image="true"
handle_right_mouse="true"
use_draw_context_alpha="true">
</button>