* make it look better (e.g. window shadows) by forcing heavy-weight windows
This commit is contained in:
parent
015f997ba2
commit
2dd24e53a7
|
@ -1,7 +1,5 @@
|
|||
|
||||
package net.sourceforge.tuned.ui;
|
||||
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
|
@ -17,7 +15,6 @@ import javax.swing.JSeparator;
|
|||
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
|
||||
|
||||
public class ActionPopup extends JPopupMenu {
|
||||
|
||||
protected final JLabel headerLabel = new JLabel();
|
||||
|
@ -26,7 +23,6 @@ public class ActionPopup extends JPopupMenu {
|
|||
|
||||
protected final JPanel actionPanel = new JPanel(new MigLayout("nogrid, insets 0, fill"));
|
||||
|
||||
|
||||
public ActionPopup(String label, Icon icon) {
|
||||
headerLabel.setText(label);
|
||||
headerLabel.setIcon(icon);
|
||||
|
@ -44,25 +40,24 @@ public class ActionPopup extends JPopupMenu {
|
|||
add(actionPanel, "growx, wrap 0px");
|
||||
add(new JSeparator(), "growx, wrap 0px");
|
||||
add(statusLabel, "growx, h 11px!, gapx 3px, wrap 1px");
|
||||
}
|
||||
|
||||
// make it look better (e.g. window shadows) by forcing heavy-weight windows
|
||||
setLightWeightPopupEnabled(false);
|
||||
}
|
||||
|
||||
public void addDescription(JComponent component) {
|
||||
actionPanel.add(component, "gapx 4px, wrap 3px");
|
||||
}
|
||||
|
||||
|
||||
public void addAction(JComponent component) {
|
||||
actionPanel.add(component, "gapx 12px 12px, growx, wrap");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addSeparator() {
|
||||
actionPanel.add(new JSeparator(), "growx, wrap 1px");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public JMenuItem add(Action a) {
|
||||
LinkButton link = new LinkButton(a);
|
||||
|
@ -81,34 +76,28 @@ public class ActionPopup extends JPopupMenu {
|
|||
return null;
|
||||
}
|
||||
|
||||
|
||||
public void clear() {
|
||||
actionPanel.removeAll();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setLabel(String label) {
|
||||
headerLabel.setText(label);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getLabel() {
|
||||
return headerLabel.getText();
|
||||
}
|
||||
|
||||
|
||||
public void setStatus(String string) {
|
||||
statusLabel.setText(string);
|
||||
}
|
||||
|
||||
|
||||
public String getStatus() {
|
||||
return statusLabel.getText();
|
||||
}
|
||||
|
||||
|
||||
private final ActionListener closeListener = new ActionListener() {
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue