From 187fb979d365ac3052f6a95e278a1f92c3117d17 Mon Sep 17 00:00:00 2001 From: Cho Date: Wed, 4 Dec 2013 19:45:26 +0000 Subject: Add character count display to floater_twitter for ACME-1215 --- indra/newview/llfloatertwitter.cpp | 6 ++++++ indra/newview/llfloatertwitter.h | 1 + indra/newview/skins/default/xui/en/panel_twitter_photo.xml | 14 ++++++++++++++ 3 files changed, 21 insertions(+) diff --git a/indra/newview/llfloatertwitter.cpp b/indra/newview/llfloatertwitter.cpp index ea17497d95..82ed066b1a 100644 --- a/indra/newview/llfloatertwitter.cpp +++ b/indra/newview/llfloatertwitter.cpp @@ -65,6 +65,7 @@ mResolutionComboBox(NULL), mRefreshBtn(NULL), mWorkingLabel(NULL), mThumbnailPlaceholder(NULL), +mStatusCounterLabel(NULL), mStatusTextBox(NULL), mLocationCheckbox(NULL), mPhotoCheckbox(NULL), @@ -92,6 +93,7 @@ BOOL LLTwitterPhotoPanel::postBuild() mRefreshBtn = getChild("new_snapshot_btn"); mWorkingLabel = getChild("working_lbl"); mThumbnailPlaceholder = getChild("thumbnail_placeholder"); + mStatusCounterLabel = getChild("status_counter_label"); mStatusTextBox = getChild("photo_status"); mLocationCheckbox = getChild("add_location_cb"); mLocationCheckbox->setCommitCallback(boost::bind(&LLTwitterPhotoPanel::onAddLocationToggled, this)); @@ -340,6 +342,10 @@ void LLTwitterPhotoPanel::updateStatusTextLength(BOOL restore_old_status_text) } status_text_box->setText(mOldStatusText.substr(0, max_status_length)); } + + // Update the status character counter + int characters_remaining = max_status_length - status_text_box->getText().length(); + mStatusCounterLabel->setValue(characters_remaining); } } diff --git a/indra/newview/llfloatertwitter.h b/indra/newview/llfloatertwitter.h index be3a099d5f..5305143552 100644 --- a/indra/newview/llfloatertwitter.h +++ b/indra/newview/llfloatertwitter.h @@ -69,6 +69,7 @@ private: LLUICtrl * mRefreshBtn; LLUICtrl * mWorkingLabel; LLUICtrl * mThumbnailPlaceholder; + LLUICtrl * mStatusCounterLabel; LLUICtrl * mStatusTextBox; LLUICtrl * mLocationCheckbox; LLUICtrl * mPhotoCheckbox; diff --git a/indra/newview/skins/default/xui/en/panel_twitter_photo.xml b/indra/newview/skins/default/xui/en/panel_twitter_photo.xml index 3ddec9b989..14268c1bcf 100644 --- a/indra/newview/skins/default/xui/en/panel_twitter_photo.xml +++ b/indra/newview/skins/default/xui/en/panel_twitter_photo.xml @@ -25,6 +25,20 @@ type="string"> What's happening? + + 140 +