Merge pull request #3061 from psikoi/obsidian-redesign-tweaks

Obsidian redesign tweaks
This commit is contained in:
Adam
2018-05-22 17:27:09 -04:00
committed by GitHub
4 changed files with 18 additions and 5 deletions

View File

@@ -399,8 +399,6 @@ public class ConfigPanel extends PluginPanel
if (component instanceof JComboBox)
{
JComboBox jComboBox = (JComboBox) component;
jComboBox.setRenderer(new ComboBoxListRenderer());
jComboBox.setForeground(Color.WHITE);
configManager.setConfiguration(cd.getGroup().keyName(), cid.getItem().keyName(), ((Enum) jComboBox.getSelectedItem()).name());
}
}
@@ -411,6 +409,7 @@ public class ConfigPanel extends PluginPanel
removeAll();
String name = cd.getGroup().name() + " Configuration";
JLabel title = new JLabel(name);
title.setForeground(Color.WHITE);
title.setToolTipText(cd.getGroup().description());
add(title, SwingConstants.CENTER);
@@ -425,6 +424,7 @@ public class ConfigPanel extends PluginPanel
item.setLayout(new BorderLayout());
name = cid.getItem().name();
JLabel configEntryName = new JLabel(name);
configEntryName.setForeground(Color.WHITE);
configEntryName.setToolTipText("<html>" + name + ":<br>" + cid.getItem().description() + "</html>");
item.add(configEntryName, BorderLayout.CENTER);

View File

@@ -99,7 +99,6 @@ class XpInfoBox extends JPanel
popupMenu.setBorder(new EmptyBorder(5, 5, 5, 5));
popupMenu.add(openXpTracker);
popupMenu.add(reset);
container.setComponentPopupMenu(popupMenu);
JLabel skillIcon = new JLabel(new ImageIcon(iconManager.getSkillImage(skill)));
skillIcon.setHorizontalAlignment(SwingConstants.CENTER);
@@ -153,6 +152,9 @@ class XpInfoBox extends JPanel
container.add(headerPanel, BorderLayout.NORTH);
container.add(progressWrapper, BorderLayout.SOUTH);
container.setComponentPopupMenu(popupMenu);
progressBar.setComponentPopupMenu(popupMenu);
add(container, BorderLayout.NORTH);
}

View File

@@ -70,8 +70,6 @@ public class IconTextField extends JPanel
this.textField = new JTextField();
this.textField.setBorder(null);
this.textField.setOpaque(false);
this.textField.setSelectedTextColor(Color.WHITE);
this.textField.setSelectionColor(ColorScheme.BRAND_ORANGE_TRANSPARENT);
add(iconWrapperLabel, BorderLayout.WEST);
add(textField, BorderLayout.CENTER);
@@ -161,6 +159,13 @@ public class IconTextField extends JPanel
}
}
@Override
public boolean requestFocusInWindow()
{
super.requestFocusInWindow();
return textField.requestFocusInWindow();
}
public Document getDocument()
{
return textField.getDocument();

View File

@@ -90,6 +90,12 @@ public class SwingUtil
UIManager.put("MenuItem.foreground", Color.WHITE);
UIManager.put("Panel.background", ColorScheme.DARK_GRAY_COLOR);
UIManager.put("ScrollBarUI", CustomScrollBarUI.class.getName());
UIManager.put("TextField.selectionBackground", ColorScheme.BRAND_ORANGE_TRANSPARENT);
UIManager.put("TextField.selectionForeground", Color.WHITE);
UIManager.put("FormattedTextField.selectionBackground", ColorScheme.BRAND_ORANGE_TRANSPARENT);
UIManager.put("FormattedTextField.selectionForeground", Color.WHITE);
UIManager.put("TextArea.selectionBackground", ColorScheme.BRAND_ORANGE_TRANSPARENT);
UIManager.put("TextArea.selectionForeground", Color.WHITE);
// Do not render shadows under popups/tooltips.
// Fixes black boxes under popups that are above the game applet.