From f61250f75b27525b9eca5f583a8327ce716981d5 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Wed, 21 Mar 2007 15:58:57 +0000 Subject: [PATCH] Allow the hint text to be put on the same line as the chat input. git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@254 c613c5cb-e716-0410-b11b-feb51c14d237 --- .../com/threerings/micasa/client/ChatPanel.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/java/com/threerings/micasa/client/ChatPanel.java b/src/java/com/threerings/micasa/client/ChatPanel.java index 984488a0..cf2aa94a 100644 --- a/src/java/com/threerings/micasa/client/ChatPanel.java +++ b/src/java/com/threerings/micasa/client/ChatPanel.java @@ -66,11 +66,15 @@ import com.threerings.crowd.util.CrowdContext; import com.threerings.micasa.Log; -public class ChatPanel - extends JPanel +public class ChatPanel extends JPanel implements ActionListener, ChatDisplay, OccupantObserver, PlaceView { public ChatPanel (CrowdContext ctx) + { + this(ctx, false); + } + + public ChatPanel (CrowdContext ctx, boolean cuddleHintLabel) { // keep this around for later _ctx = ctx; @@ -94,11 +98,17 @@ public class ChatPanel createStyles(_text); // add a label for the text entry stuff - add(new JLabel("Type here to chat:"), GroupLayout.FIXED); + JLabel hint = new JLabel("Type here to chat:"); + if (!cuddleHintLabel) { + add(hint, GroupLayout.FIXED); + } // create a horizontal group for the text entry bar gl = new HGroupLayout(GroupLayout.STRETCH); JPanel epanel = new JPanel(gl); + if (cuddleHintLabel) { + epanel.add(hint, GroupLayout.FIXED); + } epanel.add(_entry = new JTextField()); _entry.setActionCommand("send"); _entry.addActionListener(this);