diff options
-rw-r--r-- | indra/llui/llfloater.cpp | 7 | ||||
-rw-r--r-- | indra/llui/llfloater.h | 4 | ||||
-rw-r--r-- | indra/llui/llscrolllistcell.cpp | 4 | ||||
-rw-r--r-- | indra/llui/llscrolllistcell.h | 5 | ||||
-rw-r--r-- | indra/llui/llscrolllistctrl.h | 5 | ||||
-rw-r--r-- | indra/newview/lldebugview.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llfasttimerview.cpp | 34 | ||||
-rw-r--r-- | indra/newview/llfasttimerview.h | 4 | ||||
-rw-r--r-- | indra/newview/llnamelistctrl.cpp | 23 | ||||
-rw-r--r-- | indra/newview/llnamelistctrl.h | 2 |
10 files changed, 84 insertions, 6 deletions
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index b6d73cda3c..e91d753a39 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -1554,7 +1554,12 @@ void LLFloater::onClickClose( LLFloater* self ) { if (!self) return; - self->closeFloater(false); + self->onClickCloseBtn(); +} + +void LLFloater::onClickCloseBtn() +{ + closeFloater(false); } diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 19e8288807..c1e8813f87 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -307,6 +307,8 @@ protected: void destroy() { die(); } // Don't call this directly. You probably want to call closeFloater() + virtual void onClickCloseBtn(); + private: void setForeground(BOOL b); // called only by floaterview void cleanupHandles(); // remove handles to dead floaters @@ -346,6 +348,7 @@ protected: LLResizeBar* mResizeBar[4]; LLResizeHandle* mResizeHandle[4]; + LLButton* mButtons[BUTTON_COUNT]; private: LLRect mExpandedRect; @@ -379,7 +382,6 @@ private: handle_set_t mDependents; bool mButtonsEnabled[BUTTON_COUNT]; - LLButton* mButtons[BUTTON_COUNT]; F32 mButtonScale; BOOL mAutoFocus; LLHandle<LLFloater> mSnappedTo; diff --git a/indra/llui/llscrolllistcell.cpp b/indra/llui/llscrolllistcell.cpp index 3cc92baa8d..d17be8b94a 100644 --- a/indra/llui/llscrolllistcell.cpp +++ b/indra/llui/llscrolllistcell.cpp @@ -185,6 +185,8 @@ LLScrollListText::LLScrollListText(const LLScrollListCell::Params& p) { sCount++; + mTextWidth = getWidth(); + // initialize rounded rect image if (!mRoundedRectImage) { @@ -340,7 +342,7 @@ void LLScrollListText::draw(const LLColor4& color, const LLColor4& highlight_col 0, LLFontGL::NO_SHADOW, string_chars, - getWidth(), + getTextWidth(), &right_x, TRUE); } diff --git a/indra/llui/llscrolllistcell.h b/indra/llui/llscrolllistcell.h index 5fecf5aade..b1c8901fc4 100644 --- a/indra/llui/llscrolllistcell.h +++ b/indra/llui/llscrolllistcell.h @@ -151,11 +151,16 @@ public: /*virtual*/ const std::string & getToolTip() const; /*virtual*/ BOOL needsToolTip() const; + S32 getTextWidth() const { return mTextWidth;} + void setTextWidth(S32 value) { mTextWidth = value;} + virtual void setWidth(S32 width) { LLScrollListCell::setWidth(width); mTextWidth = width; } + void setText(const LLStringExplicit& text); void setFontStyle(const U8 font_style); private: LLUIString mText; + S32 mTextWidth; const LLFontGL* mFont; LLColor4 mColor; U8 mUseColor; diff --git a/indra/llui/llscrolllistctrl.h b/indra/llui/llscrolllistctrl.h index e819c5fdea..ebdc82115f 100644 --- a/indra/llui/llscrolllistctrl.h +++ b/indra/llui/llscrolllistctrl.h @@ -219,7 +219,10 @@ public: void deselectAllItems(BOOL no_commit_on_change = FALSE); // by default, go ahead and commit on selection change void clearHighlightedItems(); - void mouseOverHighlightNthItem( S32 index ); + + virtual void mouseOverHighlightNthItem( S32 index ); + + S32 getHighlightedItemInx() const { return mHighlightedItem; } void setDoubleClickCallback( callback_t cb ) { mOnDoubleClickCallback = cb; } void setMaximumSelectCallback( callback_t cb) { mOnMaximumSelectCallback = cb; } diff --git a/indra/newview/lldebugview.cpp b/indra/newview/lldebugview.cpp index 169a963d0d..f113cc49d4 100644 --- a/indra/newview/lldebugview.cpp +++ b/indra/newview/lldebugview.cpp @@ -81,11 +81,13 @@ void LLDebugView::init() r.setLeftTopAndSize(25, rect.getHeight() - 50, (S32) (gViewerWindow->getWindowRectScaled().getWidth() * 0.75f), (S32) (gViewerWindow->getWindowRectScaled().getHeight() * 0.75f)); + mFastTimerView = new LLFastTimerView(r); mFastTimerView->setFollowsTop(); mFastTimerView->setFollowsLeft(); mFastTimerView->setVisible(FALSE); // start invisible addChild(mFastTimerView); + mFastTimerView->setRect(rect); r.setLeftTopAndSize(25, rect.getHeight() - 50, (S32) (gViewerWindow->getWindowRectScaled().getWidth() * 0.75f), (S32) (gViewerWindow->getWindowRectScaled().getHeight() * 0.75f)); diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index 4fa97e789b..48fc60d529 100644 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -44,6 +44,7 @@ #include "llfontgl.h" #include "llsdserialize.h" #include "lltooltip.h" +#include "llbutton.h" #include "llappviewer.h" #include "llviewertexturelist.h" @@ -99,6 +100,8 @@ LLFastTimerView::LLFastTimerView(const LLRect& rect) FTV_NUM_TIMERS = LLFastTimer::NamedTimer::instanceCount(); mPrintStats = -1; mAverageCyclesPerTimer = 0; + setCanMinimize(false); + setCanClose(true); } @@ -139,6 +142,18 @@ LLFastTimer::NamedTimer* LLFastTimerView::getLegendID(S32 y) BOOL LLFastTimerView::handleMouseDown(S32 x, S32 y, MASK mask) { + + { + S32 local_x = x - mButtons[BUTTON_CLOSE]->getRect().mLeft; + S32 local_y = y - mButtons[BUTTON_CLOSE]->getRect().mBottom; + if(mButtons[BUTTON_CLOSE]->getVisible() + && mButtons[BUTTON_CLOSE]->pointInView(local_x, local_y) ) + { + return LLFloater::handleMouseDown(x, y, mask);; + } + } + + if (x < mBarRect.mLeft) { LLFastTimer::NamedTimer* idp = getLegendID(y); @@ -188,11 +203,25 @@ BOOL LLFastTimerView::handleMouseDown(S32 x, S32 y, MASK mask) BOOL LLFastTimerView::handleMouseUp(S32 x, S32 y, MASK mask) { + { + S32 local_x = x - mButtons[BUTTON_CLOSE]->getRect().mLeft; + S32 local_y = y - mButtons[BUTTON_CLOSE]->getRect().mBottom; + if(mButtons[BUTTON_CLOSE]->getVisible() + && mButtons[BUTTON_CLOSE]->pointInView(local_x, local_y) ) + { + return LLFloater::handleMouseUp(x, y, mask);; + } + } return FALSE; } BOOL LLFastTimerView::handleHover(S32 x, S32 y, MASK mask) { + /*if(y>getRect().getHeight()-20) + { + return LLFloater::handleMouseDown(x, y, mask); + }*/ + mHoverTimer = NULL; mHoverID = NULL; @@ -1191,5 +1220,8 @@ void LLFastTimerView::doAnalysis(std::string baseline, std::string target, std:: return ; } } - +void LLFastTimerView::onClickCloseBtn() +{ + setVisible(false); +} diff --git a/indra/newview/llfasttimerview.h b/indra/newview/llfasttimerview.h index f5c8f23818..ac06990913 100644 --- a/indra/newview/llfasttimerview.h +++ b/indra/newview/llfasttimerview.h @@ -63,7 +63,9 @@ public: LLFastTimer::NamedTimer* getLegendID(S32 y); F64 getTime(const std::string& name); - + +protected: + virtual void onClickCloseBtn(); private: typedef std::vector<std::vector<S32> > bar_positions_t; bar_positions_t mBarStart; diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp index 114fef8712..d6073aa0d8 100644 --- a/indra/newview/llnamelistctrl.cpp +++ b/indra/newview/llnamelistctrl.cpp @@ -138,6 +138,29 @@ void LLNameListCtrl::showInspector(const LLUUID& avatar_id, bool is_group) LLFloaterReg::showInstance("inspect_avatar", LLSD().with("avatar_id", avatar_id)); } +void LLNameListCtrl::mouseOverHighlightNthItem( S32 target_index ) +{ + if (getHighlightedItemInx()!= target_index) + { + if(getHighlightedItemInx()!=-1) + { + LLScrollListItem* item = getItemList()[getHighlightedItemInx()]; + LLScrollListText* cell = dynamic_cast<LLScrollListText*>(item->getColumn(mNameColumnIndex)); + if(cell) + cell->setTextWidth(cell->getTextWidth() + 16); + } + if(target_index != -1) + { + LLScrollListItem* item = getItemList()[target_index]; + LLScrollListText* cell = dynamic_cast<LLScrollListText*>(item->getColumn(mNameColumnIndex)); + if(cell) + cell->setTextWidth(cell->getTextWidth() - 16); + } + } + + LLScrollListCtrl::mouseOverHighlightNthItem(target_index); +} + //virtual BOOL LLNameListCtrl::handleToolTip(S32 x, S32 y, MASK mask) { diff --git a/indra/newview/llnamelistctrl.h b/indra/newview/llnamelistctrl.h index 23b1cb6897..1c26ee5db4 100644 --- a/indra/newview/llnamelistctrl.h +++ b/indra/newview/llnamelistctrl.h @@ -120,6 +120,8 @@ public: void setAllowCallingCardDrop(BOOL b) { mAllowCallingCardDrop = b; } /*virtual*/ void updateColumns(); + + /*virtual*/ void mouseOverHighlightNthItem( S32 index ); private: void showInspector(const LLUUID& avatar_id, bool is_group); |