|
35 | 35 | import software.aws.toolkits.eclipse.amazonq.chat.models.CursorState; |
36 | 36 | import software.aws.toolkits.eclipse.amazonq.plugin.Activator; |
37 | 37 | 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; |
40 | 38 | import software.aws.toolkits.eclipse.amazonq.util.ToolkitNotification; |
41 | 39 |
|
42 | 40 | public final class InlineChatUIManager { |
@@ -139,37 +137,34 @@ protected Control createDialogArea(final Composite parent) { |
139 | 137 | composite.setLayout(new GridLayout(1, false)); |
140 | 138 |
|
141 | 139 | 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 | + }); |
147 | 144 |
|
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)); |
164 | 156 | } |
| 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)); |
165 | 161 | } |
166 | | - }); |
167 | | - } else { |
168 | | - inputField.setMessage(inputPromptMessage); |
169 | | - } |
| 162 | + } |
| 163 | + }); |
170 | 164 |
|
171 | 165 | GridData gridData = new GridData(GridData.FILL_HORIZONTAL); |
172 | 166 | gridData.widthHint = 350; |
| 167 | + gridData.heightHint = 25; |
173 | 168 | inputField.setLayoutData(gridData); |
174 | 169 |
|
175 | 170 | inputField.addKeyListener(new KeyAdapter() { |
|
0 commit comments