Skip to content

Commit 112ebe8

Browse files
committed
fix: show watermark text on mac
1 parent d0a4a83 commit 112ebe8

File tree

1 file changed

+22
-27
lines changed

1 file changed

+22
-27
lines changed

plugin/src/software/aws/toolkits/eclipse/amazonq/inlineChat/InlineChatUIManager.java

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@
3535
import software.aws.toolkits.eclipse.amazonq.chat.models.CursorState;
3636
import software.aws.toolkits.eclipse.amazonq.plugin.Activator;
3737
import software.aws.toolkits.eclipse.amazonq.util.Constants;
38-
import software.aws.toolkits.eclipse.amazonq.util.PluginPlatform;
39-
import software.aws.toolkits.eclipse.amazonq.util.PluginUtils;
4038
import software.aws.toolkits.eclipse.amazonq.util.ToolkitNotification;
4139

4240
public final class InlineChatUIManager {
@@ -139,37 +137,34 @@ protected Control createDialogArea(final Composite parent) {
139137
composite.setLayout(new GridLayout(1, false));
140138

141139
inputField = new Text(composite, SWT.BORDER | SWT.MULTI);
142-
if (PluginUtils.getPlatform() == PluginPlatform.WINDOWS) {
143-
Display.getDefault().asyncExec(() -> {
144-
inputField.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_GRAY));
145-
inputField.setText(inputPromptMessage);
146-
});
140+
Display.getDefault().asyncExec(() -> {
141+
inputField.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_GRAY));
142+
inputField.setText(inputPromptMessage);
143+
});
147144

148-
inputField.addKeyListener(new KeyAdapter() {
149-
@Override
150-
public void keyPressed(final KeyEvent e) {
151-
// If this is the first character being typed
152-
boolean backspace = (e.keyCode == SWT.DEL || e.keyCode == SWT.BS);
153-
if (inputField.getText().equals(inputPromptMessage)) {
154-
if (!backspace) {
155-
inputField.setText("");
156-
inputField.setForeground(isDarkTheme
157-
? Display.getDefault().getSystemColor(SWT.COLOR_WHITE)
158-
: Display.getDefault().getSystemColor(SWT.COLOR_BLACK));
159-
}
160-
e.doit = !backspace;
161-
} else if (backspace && inputField.getText().length() <= 1) {
162-
inputField.setText(inputPromptMessage);
163-
inputField.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_GRAY));
145+
inputField.addKeyListener(new KeyAdapter() {
146+
@Override
147+
public void keyPressed(final KeyEvent e) {
148+
// If this is the first character being typed
149+
boolean backspace = (e.keyCode == SWT.DEL || e.keyCode == SWT.BS);
150+
if (inputField.getText().equals(inputPromptMessage)) {
151+
if (!backspace) {
152+
inputField.setText("");
153+
inputField.setForeground(isDarkTheme
154+
? Display.getDefault().getSystemColor(SWT.COLOR_WHITE)
155+
: Display.getDefault().getSystemColor(SWT.COLOR_BLACK));
164156
}
157+
e.doit = !backspace;
158+
} else if (backspace && inputField.getText().length() <= 1) {
159+
inputField.setText(inputPromptMessage);
160+
inputField.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_GRAY));
165161
}
166-
});
167-
} else {
168-
inputField.setMessage(inputPromptMessage);
169-
}
162+
}
163+
});
170164

171165
GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
172166
gridData.widthHint = 350;
167+
gridData.heightHint = 25;
173168
inputField.setLayoutData(gridData);
174169

175170
inputField.addKeyListener(new KeyAdapter() {

0 commit comments

Comments
 (0)