From fc46e6147ee3d0304793188e3fbf4c2a7854ecfa Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 3 Sep 2024 08:16:22 +0300 Subject: viewer#2310 Fix snapshot's size string dropping color during upload --- indra/newview/llfloatersnapshot.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'indra/newview/llfloatersnapshot.cpp') diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index f7c82621fb..1f52f1d180 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -324,7 +324,6 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshotBase* floater) bool got_bytes = previewp && previewp->getDataSize() > 0; bool got_snap = previewp && previewp->getSnapshotUpToDate(); - // *TODO: Separate maximum size for Web images from postcards LL_DEBUGS() << "Is snapshot up-to-date? " << got_snap << LL_ENDL; LLLocale locale(LLLocale::USER_LOCALE); @@ -343,7 +342,8 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshotBase* floater) image_res_tb->setTextArg("[HEIGHT]", llformat("%d", previewp->getEncodedImageHeight())); } - floater->getChild("file_size_label")->setTextArg("[SIZE]", got_snap ? bytes_string : floater->getString("unknown")); + LLTextBox* file_size_label = floater->getChild("file_size_label"); + file_size_label->setTextArg("[SIZE]", got_snap ? bytes_string : floater->getString("unknown")); LLUIColor color = LLUIColorTable::instance().getColor( "LabelTextColor" ); if (shot_type == LLSnapshotModel::SNAPSHOT_POSTCARD @@ -359,7 +359,8 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshotBase* floater) color = LLUIColor(LLColor4::red); } - floater->getChild("file_size_label")->setColor(color); + file_size_label->setColor(color); + file_size_label->setReadOnlyColor(color); // field gets disabled during upload // Update the width and height spinners based on the corresponding resolution combos. (?) switch(shot_type) -- cgit v1.2.3 From 7e4cdc30f3af701eb34306c124f1ce32f60c14ef Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Thu, 19 Sep 2024 20:34:33 +0300 Subject: Don't keep updating snapshot preview when the floater is closed --- indra/newview/llfloatersnapshot.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfloatersnapshot.cpp') diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 1f52f1d180..fb4537f22a 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -1297,7 +1297,8 @@ bool LLFloaterSnapshotBase::ImplBase::updatePreviewList(bool initialized) void LLFloaterSnapshotBase::ImplBase::updateLivePreview() { - if (ImplBase::updatePreviewList(true) && mFloater) + // don't update preview for hidden floater + if (mFloater && mFloater->isInVisibleChain() && ImplBase::updatePreviewList(true)) { LL_DEBUGS() << "changed" << LL_ENDL; updateControls(mFloater); -- cgit v1.2.3