Skip to content

Commit

Permalink
Merge pull request #619 from k33ptoo/gui
Browse files Browse the repository at this point in the history
UI Fix Search Field Glitch
SPARK-2214
  • Loading branch information
wrooot authored Apr 6, 2021
2 parents 45f895e + 0250a59 commit 00dcc86
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@
import javax.swing.plaf.basic.BasicTextUI;

/**
* Creates a Firefox Search type box that allows for icons inside of a textfield. This
* could be used to build out your own search objects.
* Creates a Firefox Search type box that allows for icons inside of a
* textfield. This could be used to build out your own search objects.
*/
public class IconTextField extends JPanel {

private static final long serialVersionUID = -7000758637988415370L;
private final JTextField textField;
private final JLabel imageComponent;
Expand All @@ -49,13 +50,13 @@ public class IconTextField extends JPanel {
*/
public IconTextField(Icon icon) {
setLayout(new GridBagLayout());
setBackground((Color)UIManager.get("TextField.background"));
setBackground((Color) UIManager.get("TextField.background"));

textField = new JTextField();
textField.setUI(new BasicTextFieldUI());
textField.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
setBorder(new JTextField().getBorder());

//setBorder(new JTextField().getBorder());
this.setBorder(BorderFactory.createLineBorder(Color.lightGray));
imageComponent = new JLabel(icon);
downOption = new JLabel(SparkRes.getImageIcon(SparkRes.DOWN_OPTION_IMAGE));

Expand Down Expand Up @@ -124,9 +125,3 @@ public JTextField getTextComponent() {
return textField;
}
}






Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import java.awt.event.MouseEvent;
import java.awt.geom.AffineTransform;
import java.util.Collection;
import javax.swing.plaf.basic.BasicPanelUI;

public class SearchService extends JPanel {

Expand All @@ -60,6 +61,7 @@ public SearchService() {

backgroundImage = Default.getImageIcon(Default.TOP_BOTTOM_BACKGROUND_IMAGE).getImage();

this.setUI(new BasicPanelUI());
final JLabel findLabel = new JLabel();

ResourceUtils.resLabel(findLabel, findField, Res.getString("label.find"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,6 @@ private void handleMessageNotification(final ChatRoom chatRoom, boolean customMs
if (chatFrame.isVisible() && (chatFrame.getState() == Frame.ICONIFIED || chatFrame.getInactiveTime() > 20000)) {
int tabLocation = indexOfComponent(chatRoom);
//setSelectedIndex(tabLocation);
System.err.println("Inactive for Long "+ tabLocation);
groupChatMessageCheck(chatRoom, customMsg, customMsgText, customMsgTitle);
return;
}
Expand Down

0 comments on commit 00dcc86

Please sign in to comment.