no message

This commit is contained in:
2024-10-09 22:01:19 +03:00
parent 63b7f7dfd2
commit 90b5abb70f
451 changed files with 1127 additions and 886 deletions

View File

@@ -0,0 +1,35 @@
package Common.Visual.Controls;
import Common.Utils.CommonUtils;
import Common.Visual.CommonUI;
import Common.Visual.Fonts.VisualiserFonts;
import javax.swing.*;
import java.awt.*;
//https://java-online.ru/swing-jbutton.xhtml
public class MenuBarButton extends JButton {
public MenuBarButton() {
super();
setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.Menu));
//
setBorderPainted(false);
setContentAreaFilled(false);
setOpaque(false);
//setFocusPainted(false);
//-
setMinimumSize(new Dimension(38, 30)); //иначе сужаются вертикально.
}
@Override
protected void paintComponent(Graphics g) {
if (getModel().isPressed()) {
g.setColor(new Color(163, 184, 204));
g.fillRect(0, 0, getWidth(), getHeight());
}
super.paintComponent(g);
}
public void setIcon(String icon_path) {
setIcon(CommonUtils.getIcon(icon_path));
}
public void setFont(VisualiserFonts font_in){
setFont(CommonUI.getTheme().Fonts.get(font_in));
}
}