From b6858df0dd9fa06ec8fa56c5ba63925a790b4811 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 8 Nov 2011 13:47:08 -0800 Subject: LLHandle is now implicitly convertable to LLHandle and LLHandle can be downcast to LLHandle using the LLHandleProvider mixin --- indra/llui/llbutton.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui/llbutton.cpp') diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 74b8885e1f..a01dccc7ab 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -115,7 +115,7 @@ LLButton::Params::Params() LLButton::LLButton(const LLButton::Params& p) : LLUICtrl(p), - LLBadgeOwner(LLView::getHandle()), + LLBadgeOwner(getHandle()), mMouseDownFrame(0), mMouseHeldDownCount(0), mBorderEnabled( FALSE ), -- cgit v1.2.3 From 7d78c63c05579f72dc6998913245d793a2fbd87c Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 10 Nov 2011 17:10:47 -0800 Subject: EXP-1504 : Allow opening of tab in tab containers when drag and dropping things. Added new param to LLButton to handle this (off by default). Refactor lltabcontainer code a bit while at it. --- indra/llui/llbutton.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'indra/llui/llbutton.cpp') diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 74b8885e1f..be657dbb9b 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -104,6 +104,7 @@ LLButton::Params::Params() use_draw_context_alpha("use_draw_context_alpha", true), badge("badge"), handle_right_mouse("handle_right_mouse"), + click_on_drag_and_drop("click_on_drag_and_drop", false), held_down_delay("held_down_delay"), button_flash_count("button_flash_count"), button_flash_rate("button_flash_rate") @@ -171,6 +172,7 @@ LLButton::LLButton(const LLButton::Params& p) mHeldDownSignal(NULL), mUseDrawContextAlpha(p.use_draw_context_alpha), mHandleRightMouse(p.handle_right_mouse), + mClickOnDragAndDrop(p.click_on_drag_and_drop), // if true, hovering on button while dragging -> click mButtonFlashCount(p.button_flash_count), mButtonFlashRate(p.button_flash_rate) { @@ -1240,3 +1242,29 @@ BOOL LLButton::handleDoubleClick(S32 x, S32 y, MASK mask) // just treat a double click as a second click return handleMouseDown(x, y, mask); } + +// virtual +BOOL LLButton::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType type, void* cargo_data, EAcceptance *accept, std::string &tooltip) +{ + const F32 CLICK_ON_DAD_DELAY_TIME = 0.5f; + if (mClickOnDragAndDrop) + { + // In that case, though the button doesn't really handles drops, it'll "click" if hovering on it + // while dragging something. That allows for instance drilling into tabbed containers. + // Note: we use the same timer as mouse down just as convenience and to avoid duplication. + if (mMouseDownTimer.getStarted()) + { + if (mMouseDownTimer.getElapsedTimeF32() > CLICK_ON_DAD_DELAY_TIME ) + { + onCommit(); + mMouseDownTimer.stop(); + } + } + else + { + mMouseDownTimer.start(); + } + } + // The true DaD effect is handled at the View level if any. + return LLView::handleDragAndDrop(x, y, mask, drop, type, cargo_data, accept, tooltip); +} -- cgit v1.2.3 From 4afb450225d83fef55bfee2f63290dcfbc3cfbec Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 11 Nov 2011 09:31:07 -0800 Subject: EXP-1504 : Move the tab opening stuff to lltabcontainer and out of llbutton. Added an xui param to allow drill through tabs. Set that param for build panel only. --- indra/llui/llbutton.cpp | 29 ----------------------------- 1 file changed, 29 deletions(-) (limited to 'indra/llui/llbutton.cpp') diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index be657dbb9b..f9e2ad8554 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -104,7 +104,6 @@ LLButton::Params::Params() use_draw_context_alpha("use_draw_context_alpha", true), badge("badge"), handle_right_mouse("handle_right_mouse"), - click_on_drag_and_drop("click_on_drag_and_drop", false), held_down_delay("held_down_delay"), button_flash_count("button_flash_count"), button_flash_rate("button_flash_rate") @@ -172,7 +171,6 @@ LLButton::LLButton(const LLButton::Params& p) mHeldDownSignal(NULL), mUseDrawContextAlpha(p.use_draw_context_alpha), mHandleRightMouse(p.handle_right_mouse), - mClickOnDragAndDrop(p.click_on_drag_and_drop), // if true, hovering on button while dragging -> click mButtonFlashCount(p.button_flash_count), mButtonFlashRate(p.button_flash_rate) { @@ -1236,35 +1234,8 @@ void LLButton::resetMouseDownTimer() mMouseDownTimer.reset(); } - BOOL LLButton::handleDoubleClick(S32 x, S32 y, MASK mask) { // just treat a double click as a second click return handleMouseDown(x, y, mask); } - -// virtual -BOOL LLButton::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType type, void* cargo_data, EAcceptance *accept, std::string &tooltip) -{ - const F32 CLICK_ON_DAD_DELAY_TIME = 0.5f; - if (mClickOnDragAndDrop) - { - // In that case, though the button doesn't really handles drops, it'll "click" if hovering on it - // while dragging something. That allows for instance drilling into tabbed containers. - // Note: we use the same timer as mouse down just as convenience and to avoid duplication. - if (mMouseDownTimer.getStarted()) - { - if (mMouseDownTimer.getElapsedTimeF32() > CLICK_ON_DAD_DELAY_TIME ) - { - onCommit(); - mMouseDownTimer.stop(); - } - } - else - { - mMouseDownTimer.start(); - } - } - // The true DaD effect is handled at the View level if any. - return LLView::handleDragAndDrop(x, y, mask, drop, type, cargo_data, accept, tooltip); -} -- cgit v1.2.3