Skip to content
This repository was archived by the owner on Feb 9, 2022. It is now read-only.

Commit eb256b0

Browse files
author
Explv
committed
Circumvent OSBot's L&F to have buttons without backgrounds.
1 parent d7838e1 commit eb256b0

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>org.explv.explv_osbot_manager</groupId>
88
<artifactId>explvs_aio</artifactId>
9-
<version>v3.1.5</version>
9+
<version>v3.1.6</version>
1010
<repositories>
1111
<repository>
1212
<id>local-repo</id>

src/main/java/gui/IconButton.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,20 @@
99

1010
public class IconButton {
1111
public static JButton createButton(final String toolTip, final String icon, final String rolloverIcon, ActionListener callback) {
12-
JButton button = new JButton();
12+
JButton button = new JButton() {
13+
@Override
14+
public void paintComponent(Graphics g) {
15+
if (this.model.isRollover()) {
16+
int drawX = (this.getWidth() / 2) - (this.getRolloverIcon().getIconWidth() / 2);
17+
int drawY = (this.getHeight() / 2) - (this.getRolloverIcon().getIconHeight() / 2);
18+
this.getRolloverIcon().paintIcon(this, g, drawX, drawY);
19+
} else {
20+
int drawX = (this.getWidth() / 2) - (this.getIcon().getIconWidth() / 2);
21+
int drawY = (this.getHeight() / 2) - (this.getIcon().getIconHeight() / 2);
22+
this.getIcon().paintIcon(this, g, drawX, drawY);
23+
}
24+
}
25+
};
1326
button.setToolTipText(toolTip);
1427

1528
BufferedImage iconImage = ImageManager.loadImage(icon);

src/main/java/script/AIO.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
@ScriptManifest(author = "Explv", name = "Explv's AIO " + AIO.VERSION, info = "AIO", version = 0, logo = "http://i.imgur.com/58Zz0fb.png")
3131
public class AIO extends Script {
3232

33-
static final String VERSION = "v3.1.5";
33+
static final String VERSION = "v3.1.6";
3434

3535
private Gui gui;
3636
private Paint paint;

0 commit comments

Comments
 (0)