GUI, preferences: improved theme switch at runtime (fixed skip and step buttons update);

This commit is contained in:
Oleg Agafonov 2024-07-05 18:11:09 +04:00
parent 6c0f7ebb90
commit 9864cdd46c
5 changed files with 186 additions and 155 deletions

View file

@ -353,6 +353,10 @@ public class HoverButton extends JPanel implements MouseListener {
this.isSelected = !this.isSelected;
}
public String getText() {
return this.text;
}
public void setText(String text) {
this.text = text;
}
@ -365,13 +369,17 @@ public class HoverButton extends JPanel implements MouseListener {
this.drawSet = true;
}
public void update(String text, Image image) {
update(text, image, this.hoverImage, this.selectedImage, this.disabledImage, this.imageSize);
}
public void update(String text, Image image, Image hover, Image selected, Image disabled, Rectangle size) {
this.text = text;
this.image = image;
this.hoverImage = hover;
this.selectedImage = selected;
this.disabledImage = disabled;
this.imageSize = size;
this.text = text;
repaint();
}