diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2023-09-11 10:26:41 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2023-09-11 10:26:41 -0400 |
commit | 947483cf14bdfcea5e0456fe00662aedfe068809 (patch) | |
tree | ffddb6bc27a2cf1bcc662f28bf1024c80291c997 /indra/llui | |
parent | dc8f2ae2ba1a1348f86f412df7f769e6cc2fe541 (diff) | |
parent | 7b54f077b48740c69559c0a2089b6133ed8eb605 (diff) |
DRTVWR-588: Merge 'DRTVWR-588-maint-W' into DRTVWR-588-cleanup-timers
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/lldraghandle.cpp | 1 | ||||
-rw-r--r-- | indra/llui/llfolderviewitem.cpp | 19 | ||||
-rw-r--r-- | indra/llui/lllayoutstack.cpp | 2 | ||||
-rw-r--r-- | indra/llui/llresizehandle.cpp | 5 | ||||
-rw-r--r-- | indra/llui/llresizehandle.h | 1 | ||||
-rw-r--r-- | indra/llui/llstatbar.cpp | 28 | ||||
-rw-r--r-- | indra/llui/llstatbar.h | 8 | ||||
-rw-r--r-- | indra/llui/lltextbase.cpp | 8 |
8 files changed, 32 insertions, 40 deletions
diff --git a/indra/llui/lldraghandle.cpp b/indra/llui/lldraghandle.cpp index 48bf5bb80f..220f5ee825 100644 --- a/indra/llui/lldraghandle.cpp +++ b/indra/llui/lldraghandle.cpp @@ -68,6 +68,7 @@ LLDragHandle::LLDragHandle(const LLDragHandle::Params& p) LLDragHandle::~LLDragHandle() { + gFocusMgr.removeKeyboardFocusWithoutCallback(this); removeChild(mTitleBox); delete mTitleBox; } diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index e2b5279aab..8883626d78 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -177,18 +177,23 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p) LLFolderViewItem::~LLFolderViewItem() { mViewModelItem = NULL; + gFocusMgr.removeKeyboardFocusWithoutCallback(this); } BOOL LLFolderViewItem::postBuild() { - LLFolderViewModelItem& vmi = *getViewModelItem(); - // getDisplayName() is expensive (due to internal getLabelSuffix() and name building) - // it also sets search strings so it requires a filter reset - mLabel = vmi.getDisplayName(); - setToolTip(vmi.getName()); + LLFolderViewModelItem* vmi = getViewModelItem(); + llassert(vmi); // not supposed to happen, if happens, find out why and fix + if (vmi) + { + // getDisplayName() is expensive (due to internal getLabelSuffix() and name building) + // it also sets search strings so it requires a filter reset + mLabel = vmi->getDisplayName(); + setToolTip(vmi->getName()); - // Dirty the filter flag of the model from the view (CHUI-849) - vmi.dirtyFilter(); + // Dirty the filter flag of the model from the view (CHUI-849) + vmi->dirtyFilter(); + } // Don't do full refresh on constructor if it is possible to avoid // it significantly slows down bulk view creation. diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index ae9dba5945..7b22f9dbdc 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -89,6 +89,8 @@ LLLayoutPanel::~LLLayoutPanel() // probably not necessary, but... delete mResizeBar; mResizeBar = NULL; + + gFocusMgr.removeKeyboardFocusWithoutCallback(this); } F32 LLLayoutPanel::getAutoResizeFactor() const diff --git a/indra/llui/llresizehandle.cpp b/indra/llui/llresizehandle.cpp index 24794305ac..13ef0fdb7f 100644 --- a/indra/llui/llresizehandle.cpp +++ b/indra/llui/llresizehandle.cpp @@ -70,6 +70,11 @@ LLResizeHandle::LLResizeHandle(const LLResizeHandle::Params& p) } } +LLResizeHandle::~LLResizeHandle() +{ + gFocusMgr.removeKeyboardFocusWithoutCallback(this); +} + BOOL LLResizeHandle::handleMouseDown(S32 x, S32 y, MASK mask) { diff --git a/indra/llui/llresizehandle.h b/indra/llui/llresizehandle.h index 7541b9e6c0..ae20ecaa77 100644 --- a/indra/llui/llresizehandle.h +++ b/indra/llui/llresizehandle.h @@ -45,6 +45,7 @@ public: Params(); }; + ~LLResizeHandle(); protected: LLResizeHandle(const LLResizeHandle::Params&); friend class LLUICtrlFactory; diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index 2449100952..fc3024c0de 100644 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -181,7 +181,7 @@ LLStatBar::LLStatBar(const Params& p) mTargetMinBar(llmin(p.bar_min, p.bar_max)), mTargetMaxBar(llmax(p.bar_max, p.bar_min)), mCurMaxBar(p.bar_max), - mCurMinBar(0), + mCurMinBar(0), mDecimalDigits(p.decimal_digits), mNumHistoryFrames(p.num_frames), mNumShortHistoryFrames(p.num_frames_short), @@ -222,9 +222,6 @@ BOOL LLStatBar::handleHover(S32 x, S32 y, MASK mask) case STAT_SAMPLE: LLToolTipMgr::instance().show(LLToolTip::Params().message(mStat.sampleStatp->getDescription()).sticky_rect(calcScreenRect())); break; - case STAT_MEM: - LLToolTipMgr::instance().show(LLToolTip::Params().message(mStat.memStatp->getDescription()).sticky_rect(calcScreenRect())); - break; default: break; } @@ -373,18 +370,6 @@ void LLStatBar::draw() } } break; - case STAT_MEM: - { - const LLTrace::StatType<LLTrace::MemAccumulator>& mem_stat = *mStat.memStatp; - - unit_label = mUnitLabel.empty() ? mem_stat.getUnitLabel() : mUnitLabel; - current = last_frame_recording.getLastValue(mem_stat).value(); - min = frame_recording.getPeriodMin(mem_stat, num_frames).value(); - max = frame_recording.getPeriodMax(mem_stat, num_frames).value(); - mean = frame_recording.getPeriodMean(mem_stat, num_frames).value(); - display_value = current; - } - break; default: break; } @@ -500,11 +485,6 @@ void LLStatBar::draw() max_value = recording.getMax(*mStat.sampleStatp); num_samples = recording.getSampleCount(*mStat.sampleStatp); break; - case STAT_MEM: - min_value = recording.getMin(*mStat.memStatp).value(); - max_value = recording.getMax(*mStat.memStatp).value(); - num_samples = 1; - break; default: break; } @@ -583,14 +563,8 @@ void LLStatBar::setStat(const std::string& stat_name) mStat.sampleStatp = sample_stat.get(); mStatType = STAT_SAMPLE; } - else if (auto mem_stat = StatType<MemAccumulator>::getInstance(stat_name)) - { - mStat.memStatp = mem_stat.get(); - mStatType = STAT_MEM; - } } - void LLStatBar::setRange(F32 bar_min, F32 bar_max) { mTargetMinBar = llmin(bar_min, bar_max); diff --git a/indra/llui/llstatbar.h b/indra/llui/llstatbar.h index 6b481ca68f..384d0950a6 100644 --- a/indra/llui/llstatbar.h +++ b/indra/llui/llstatbar.h @@ -95,17 +95,15 @@ private: STAT_NONE, STAT_COUNT, STAT_EVENT, - STAT_SAMPLE, - STAT_MEM + STAT_SAMPLE } mStatType; union { - void* valid; + void* valid; const LLTrace::StatType<LLTrace::CountAccumulator>* countStatp; const LLTrace::StatType<LLTrace::EventAccumulator>* eventStatp; - const LLTrace::StatType<LLTrace::SampleAccumulator>* sampleStatp; - const LLTrace::StatType<LLTrace::MemAccumulator>* memStatp; + const LLTrace::StatType<LLTrace::SampleAccumulator>* sampleStatp; } mStat; LLUIString mLabel; diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 26a38bd541..b6d27a3211 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1550,7 +1550,13 @@ S32 LLTextBase::getLeftOffset(S32 width) case LLFontGL::HCENTER: return mHPad + llmax(0, (mVisibleTextRect.getWidth() - width - mHPad) / 2); case LLFontGL::RIGHT: - return mVisibleTextRect.getWidth() - width; + { + // Font's rendering rounds string size, if value gets rounded + // down last symbol might not have enough space to render, + // compensate by adding an extra pixel as padding + const S32 right_padding = 1; + return llmax(mHPad, mVisibleTextRect.getWidth() - width - right_padding); + } default: return mHPad; } |