summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCho <cho@lindenlab.com>2013-12-04 19:45:26 +0000
committerCho <cho@lindenlab.com>2013-12-04 19:45:26 +0000
commit187fb979d365ac3052f6a95e278a1f92c3117d17 (patch)
treeadfb076b7351f0ff38392cfe501b353d798b3651
parentb6d02ae9c84e185f2507323c47c0475ce43f9e7a (diff)
Add character count display to floater_twitter for ACME-1215
-rw-r--r--indra/newview/llfloatertwitter.cpp6
-rw-r--r--indra/newview/llfloatertwitter.h1
-rw-r--r--indra/newview/skins/default/xui/en/panel_twitter_photo.xml14
3 files changed, 21 insertions, 0 deletions
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<LLUICtrl>("new_snapshot_btn");
mWorkingLabel = getChild<LLUICtrl>("working_lbl");
mThumbnailPlaceholder = getChild<LLUICtrl>("thumbnail_placeholder");
+ mStatusCounterLabel = getChild<LLUICtrl>("status_counter_label");
mStatusTextBox = getChild<LLUICtrl>("photo_status");
mLocationCheckbox = getChild<LLUICtrl>("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?
</text>
+ <text
+ length="1"
+ follows="top|left"
+ font="SansSerif"
+ text_color="EmphasisColor"
+ halign="right"
+ height="16"
+ width="30"
+ left="227"
+ name="status_counter_label"
+ top="3"
+ type="string">
+ 140
+ </text>
<text_editor
follows="left|top"
height="87"