From cbe1f7663293d6d96b7d5a79ea281740181dda38 Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Sat, 16 Aug 2008 06:14:41 +0000 Subject: [PATCH] It's the return of the chat prompter! What's this white box on the control bar? Now it says "type to chat" right in there when empty and unfocused. My life is empty and unfocused, checking this in at 11:15 on friday night. Things like this were tried in the past, and were always screwing up and getting in the way of chatting or using the room. This is a skin, not actual text, so it's more fuckup-proof. git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@633 ed5b42cb-e716-0410-a449-f6a68f950b19 --- src/as/com/threerings/flex/ChatInput.as | 16 ++++++++++++++++ src/as/com/threerings/flex/typetochat.png | Bin 0 -> 830 bytes 2 files changed, 16 insertions(+) create mode 100644 src/as/com/threerings/flex/typetochat.png diff --git a/src/as/com/threerings/flex/ChatInput.as b/src/as/com/threerings/flex/ChatInput.as index 5d2442cb..4749b975 100644 --- a/src/as/com/threerings/flex/ChatInput.as +++ b/src/as/com/threerings/flex/ChatInput.as @@ -20,6 +20,12 @@ public class ChatInput extends TextInput { styleName = "chatInput"; width = 147; + showPrompt(true); + } + + protected function showPrompt (show :Boolean) :void + { + setStyle("backgroundImage", (show && ("" == text)) ? PROMPT : undefined); } override protected function focusInHandler (event :FocusEvent) :void @@ -32,6 +38,16 @@ public class ChatInput extends TextInput } finally { textField.selectable = oldValue; } + showPrompt(false); } + + override protected function focusOutHandler (event :FocusEvent) :void + { + super.focusOutHandler(event); + showPrompt(true); + } + + [Embed(source="typetochat.png")] + protected static const PROMPT :Class; } } diff --git a/src/as/com/threerings/flex/typetochat.png b/src/as/com/threerings/flex/typetochat.png new file mode 100644 index 0000000000000000000000000000000000000000..f1774626475a46949a040ab266ed8aefa54892dd GIT binary patch literal 830 zcmV-E1Ht@>P)X1^@s6F+0qb00009a7bBm000XU z000XU0RWnu7ytkQ@JU2LRA}Dq*v+d|WfaHp&lSylp|H3nBnX!Vp->aC1R*ntvc#f5 z6a!7IXjaYyX9`XH3&fCU7!6Et5)o+%dW%wNa<7_M2;oFcuW8=hWF6Q%?DMkEIhS)U zK3_N-_TFnR*6%s%dDdEoOeT}bWHOmdCi75JWZlz)*?kOrC@1xdS%YS=cBP@yBpRB* z3znH;X7%{~v-k^hllu$tH=c-u`v7COhl|)=;p;8@f`4%hpLLMrTk#X_;s(CLa817j zKEWTD>@uFB^j#z;_lFn{?c>{2#BdI4!tXE+*_gG!>c_$?`KKj68N?W@WAui()56awyxF7fl=)E^+9k`)K~4yxaRiH< z^L=7FuR_$F()Dfp7oP`FR*Iy&)M*au_$?~RdbjbUOf=Cx(ZbK2u<1qj2#!UmE1GDo zVr-B}v?Wd-*pGK>CeZ|*?9-@Q)b!iz$L~ixQMq@_ceSOxIOH zKE);Mt*{*{HK~op`kj)^E4Yr$SP(mLZ8WpJEM_NutNe5m&(&yVhmywnVrXt?ztpC& z-VhsdT{O-kI8syh1?-7aa0Px%o>#>>(8jvKW6|6VSJ*a2{QI$pRlEEpd>1}$*c|4tyDAR3eyA`!uPNGaElgVT|0}~0qzNwq0{{R307*qo IM6N<$f*1Fdp8x;= literal 0 HcmV?d00001