diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/llui/lltabcontainer.cpp | 81 |
1 files changed, 45 insertions, 36 deletions
diff --git a/linden/indra/llui/lltabcontainer.cpp b/linden/indra/llui/lltabcontainer.cpp index 44940ae..01c06c3 100644 --- a/linden/indra/llui/lltabcontainer.cpp +++ b/linden/indra/llui/lltabcontainer.cpp | |||
@@ -51,6 +51,7 @@ | |||
51 | #include "llglheaders.h" | 51 | #include "llglheaders.h" |
52 | 52 | ||
53 | const F32 SCROLL_STEP_TIME = 0.4f; | 53 | const F32 SCROLL_STEP_TIME = 0.4f; |
54 | const F32 SCROLL_DELAY_TIME = 0.5f; | ||
54 | const S32 TAB_PADDING = 15; | 55 | const S32 TAB_PADDING = 15; |
55 | const S32 TABCNTR_TAB_MIN_WIDTH = 60; | 56 | const S32 TABCNTR_TAB_MIN_WIDTH = 60; |
56 | const S32 TABCNTR_TAB_MAX_WIDTH = 150; | 57 | const S32 TABCNTR_TAB_MAX_WIDTH = 150; |
@@ -81,6 +82,7 @@ LLTabContainerCommon::LLTabContainerCommon( | |||
81 | mLockedTabCount(0) | 82 | mLockedTabCount(0) |
82 | { | 83 | { |
83 | setMouseOpaque(FALSE); | 84 | setMouseOpaque(FALSE); |
85 | mDragAndDropDelayTimer.stop(); | ||
84 | } | 86 | } |
85 | 87 | ||
86 | 88 | ||
@@ -101,9 +103,11 @@ LLTabContainerCommon::LLTabContainerCommon( | |||
101 | mCallbackUserdata( callback_userdata ), | 103 | mCallbackUserdata( callback_userdata ), |
102 | mTitleBox(NULL), | 104 | mTitleBox(NULL), |
103 | mTopBorderHeight(LLPANEL_BORDER_WIDTH), | 105 | mTopBorderHeight(LLPANEL_BORDER_WIDTH), |
104 | mTabPosition(pos) | 106 | mTabPosition(pos), |
107 | mLockedTabCount(0) | ||
105 | { | 108 | { |
106 | setMouseOpaque(FALSE); | 109 | setMouseOpaque(FALSE); |
110 | mDragAndDropDelayTimer.stop(); | ||
107 | } | 111 | } |
108 | 112 | ||
109 | 113 | ||
@@ -731,8 +735,8 @@ LLTabContainer::LLTabContainer( | |||
731 | : | 735 | : |
732 | LLTabContainerCommon(name, rect, pos, close_callback, callback_userdata, bordered), | 736 | LLTabContainerCommon(name, rect, pos, close_callback, callback_userdata, bordered), |
733 | mLeftArrowBtn(NULL), | 737 | mLeftArrowBtn(NULL), |
734 | mRightArrowBtn(NULL), | ||
735 | mJumpLeftArrowBtn(NULL), | 738 | mJumpLeftArrowBtn(NULL), |
739 | mRightArrowBtn(NULL), | ||
736 | mJumpRightArrowBtn(NULL), | 740 | mJumpRightArrowBtn(NULL), |
737 | mRightTabBtnOffset(0), | 741 | mRightTabBtnOffset(0), |
738 | mMinTabWidth(TABCNTR_TAB_MIN_WIDTH), | 742 | mMinTabWidth(TABCNTR_TAB_MIN_WIDTH), |
@@ -749,8 +753,8 @@ LLTabContainer::LLTabContainer( | |||
749 | : | 753 | : |
750 | LLTabContainerCommon(name, rect_control, pos, close_callback, callback_userdata, bordered), | 754 | LLTabContainerCommon(name, rect_control, pos, close_callback, callback_userdata, bordered), |
751 | mLeftArrowBtn(NULL), | 755 | mLeftArrowBtn(NULL), |
752 | mRightArrowBtn(NULL), | ||
753 | mJumpLeftArrowBtn(NULL), | 756 | mJumpLeftArrowBtn(NULL), |
757 | mRightArrowBtn(NULL), | ||
754 | mJumpRightArrowBtn(NULL), | 758 | mJumpRightArrowBtn(NULL), |
755 | mRightTabBtnOffset(0), | 759 | mRightTabBtnOffset(0), |
756 | mMinTabWidth(TABCNTR_TAB_MIN_WIDTH), | 760 | mMinTabWidth(TABCNTR_TAB_MIN_WIDTH), |
@@ -1576,43 +1580,48 @@ BOOL LLTabContainer::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDrag | |||
1576 | { | 1580 | { |
1577 | BOOL has_scroll_arrows = (mMaxScrollPos > 0); | 1581 | BOOL has_scroll_arrows = (mMaxScrollPos > 0); |
1578 | 1582 | ||
1579 | if (has_scroll_arrows) | 1583 | if( mDragAndDropDelayTimer.getElapsedTimeF32() > SCROLL_DELAY_TIME ) |
1580 | { | 1584 | { |
1581 | if (mJumpLeftArrowBtn->getRect().pointInRect(x, y)) | 1585 | |
1582 | { | 1586 | if (has_scroll_arrows) |
1583 | S32 local_x = x - mJumpLeftArrowBtn->getRect().mLeft; | ||
1584 | S32 local_y = y - mJumpLeftArrowBtn->getRect().mBottom; | ||
1585 | mJumpLeftArrowBtn->handleHover(local_x, local_y, mask); | ||
1586 | } | ||
1587 | if (mJumpRightArrowBtn->getRect().pointInRect(x, y)) | ||
1588 | { | ||
1589 | S32 local_x = x - mJumpRightArrowBtn->getRect().mLeft; | ||
1590 | S32 local_y = y - mJumpRightArrowBtn->getRect().mBottom; | ||
1591 | mJumpRightArrowBtn->handleHover(local_x, local_y, mask); | ||
1592 | } | ||
1593 | if (mLeftArrowBtn->getRect().pointInRect(x, y)) | ||
1594 | { | ||
1595 | S32 local_x = x - mLeftArrowBtn->getRect().mLeft; | ||
1596 | S32 local_y = y - mLeftArrowBtn->getRect().mBottom; | ||
1597 | mLeftArrowBtn->handleHover(local_x, local_y, mask); | ||
1598 | } | ||
1599 | else if (mRightArrowBtn->getRect().pointInRect(x, y)) | ||
1600 | { | 1587 | { |
1601 | S32 local_x = x - mRightArrowBtn->getRect().mLeft; | 1588 | if (mJumpLeftArrowBtn->getRect().pointInRect(x, y)) |
1602 | S32 local_y = y - mRightArrowBtn->getRect().mBottom; | 1589 | { |
1603 | mRightArrowBtn->handleHover(local_x, local_y, mask); | 1590 | S32 local_x = x - mJumpLeftArrowBtn->getRect().mLeft; |
1591 | S32 local_y = y - mJumpLeftArrowBtn->getRect().mBottom; | ||
1592 | mJumpLeftArrowBtn->handleHover(local_x, local_y, mask); | ||
1593 | } | ||
1594 | if (mJumpRightArrowBtn->getRect().pointInRect(x, y)) | ||
1595 | { | ||
1596 | S32 local_x = x - mJumpRightArrowBtn->getRect().mLeft; | ||
1597 | S32 local_y = y - mJumpRightArrowBtn->getRect().mBottom; | ||
1598 | mJumpRightArrowBtn->handleHover(local_x, local_y, mask); | ||
1599 | } | ||
1600 | if (mLeftArrowBtn->getRect().pointInRect(x, y)) | ||
1601 | { | ||
1602 | S32 local_x = x - mLeftArrowBtn->getRect().mLeft; | ||
1603 | S32 local_y = y - mLeftArrowBtn->getRect().mBottom; | ||
1604 | mLeftArrowBtn->handleHover(local_x, local_y, mask); | ||
1605 | } | ||
1606 | else if (mRightArrowBtn->getRect().pointInRect(x, y)) | ||
1607 | { | ||
1608 | S32 local_x = x - mRightArrowBtn->getRect().mLeft; | ||
1609 | S32 local_y = y - mRightArrowBtn->getRect().mBottom; | ||
1610 | mRightArrowBtn->handleHover(local_x, local_y, mask); | ||
1611 | } | ||
1604 | } | 1612 | } |
1605 | } | ||
1606 | 1613 | ||
1607 | for(tuple_list_t::iterator iter = mTabList.begin(); iter != mTabList.end(); ++iter) | 1614 | for(tuple_list_t::iterator iter = mTabList.begin(); iter != mTabList.end(); ++iter) |
1608 | { | ||
1609 | LLTabTuple* tuple = *iter; | ||
1610 | tuple->mButton->setVisible( TRUE ); | ||
1611 | S32 local_x = x - tuple->mButton->getRect().mLeft; | ||
1612 | S32 local_y = y - tuple->mButton->getRect().mBottom; | ||
1613 | if (tuple->mButton->pointInView(local_x, local_y) && tuple->mButton->getEnabled() && !tuple->mTabPanel->getVisible()) | ||
1614 | { | 1615 | { |
1615 | tuple->mButton->onCommit(); | 1616 | LLTabTuple* tuple = *iter; |
1617 | tuple->mButton->setVisible( TRUE ); | ||
1618 | S32 local_x = x - tuple->mButton->getRect().mLeft; | ||
1619 | S32 local_y = y - tuple->mButton->getRect().mBottom; | ||
1620 | if (tuple->mButton->pointInView(local_x, local_y) && tuple->mButton->getEnabled() && !tuple->mTabPanel->getVisible()) | ||
1621 | { | ||
1622 | tuple->mButton->onCommit(); | ||
1623 | mDragAndDropDelayTimer.stop(); | ||
1624 | } | ||
1616 | } | 1625 | } |
1617 | } | 1626 | } |
1618 | 1627 | ||
@@ -1641,4 +1650,4 @@ void LLTabContainer::setTabImage(LLPanel* child, std::string image_name) | |||
1641 | // tabs have changed size, might need to scroll to see current tab | 1650 | // tabs have changed size, might need to scroll to see current tab |
1642 | updateMaxScrollPos(); | 1651 | updateMaxScrollPos(); |
1643 | } | 1652 | } |
1644 | } \ No newline at end of file | 1653 | } |