mirror of
https://github.com/igniterealtime/Spark.git
synced 2025-12-01 12:27:58 +00:00
OSX work.
git-svn-id: http://svn.igniterealtime.org/svn/repos/spark/trunk@7631 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
@ -11,6 +11,7 @@
|
||||
package org.jivesoftware.spark.ui;
|
||||
|
||||
import org.jivesoftware.resource.Default;
|
||||
import org.jivesoftware.Spark;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.FlowLayout;
|
||||
@ -30,17 +31,24 @@ public class CommandPanel extends JPanel {
|
||||
private final Image backgroundImage;
|
||||
|
||||
public CommandPanel() {
|
||||
setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
|
||||
if (Spark.isWindows()) {
|
||||
setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
|
||||
}
|
||||
else {
|
||||
setLayout(new FlowLayout(FlowLayout.LEFT, 5, 5));
|
||||
}
|
||||
|
||||
|
||||
backgroundImage = Default.getImageIcon(Default.TOP_BOTTOM_BACKGROUND_IMAGE).getImage();
|
||||
|
||||
setBorder(BorderFactory.createMatteBorder(1, 1, 0, 1, new Color(197, 213, 230)));
|
||||
}
|
||||
|
||||
|
||||
public void paintComponent(Graphics g) {
|
||||
double scaleX = getWidth() / (double)backgroundImage.getWidth(null);
|
||||
double scaleY = getHeight() / (double)backgroundImage.getHeight(null);
|
||||
double scaleX = getWidth() / (double) backgroundImage.getWidth(null);
|
||||
double scaleY = getHeight() / (double) backgroundImage.getHeight(null);
|
||||
AffineTransform xform = AffineTransform.getScaleInstance(scaleX, scaleY);
|
||||
((Graphics2D)g).drawImage(backgroundImage, xform, this);
|
||||
((Graphics2D) g).drawImage(backgroundImage, xform, this);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user