Revision: 2403
http://sourceforge.net/p/swingme/code/2403
Author: yuranet
Date: 2021-02-25 11:32:01 +0000 (Thu, 25 Feb 2021)
Log Message:
-----------
metal icons work on hi-res screens
Modified Paths:
--------------
SwingME/src/net/yura/mobile/gui/plaf/MetalIcon.java
Modified: SwingME/src/net/yura/mobile/gui/plaf/MetalIcon.java
===================================================================
--- SwingME/src/net/yura/mobile/gui/plaf/MetalIcon.java 2021-02-24 17:31:28 UTC (rev 2402)
+++ SwingME/src/net/yura/mobile/gui/plaf/MetalIcon.java 2021-02-25 11:32:01 UTC (rev 2403)
@@ -66,7 +66,6 @@
g.drawLine(x+w/3, y+h-pad,x+w-pad,y+pad);
}
}
-
}
else if (type == LookAndFeel.ICON_RADIO) {
@@ -92,20 +91,21 @@
else if (type == LookAndFeel.ICON_SPINNER_LEFT || type == LookAndFeel.ICON_ARROW_LEFT) {
g.setColor( fcolor );
int gp = 2; // gap between arrow and sides
- int side = x+((width/2)-2);
int iconHeight = height-(gp*2);
+ int iconWidth = iconHeight/2;
+ int side = x+((width/2)-(iconWidth/2));
g.fillTriangle(side,y+gp+(iconHeight/2)+1,
- side+5,y+gp+iconHeight,
- side+5,y+gp);
-
+ side+iconWidth,y+gp+iconHeight,
+ side+iconWidth,y+gp);
}
else if (type == LookAndFeel.ICON_SPINNER_RIGHT || type == LookAndFeel.ICON_ARROW_RIGHT) {
g.setColor( fcolor );
int gp = 2; // gap between arrow and sides
- int side = x+((width/2)-2);
int iconHeight = height-(gp*2);
- g.fillTriangle(side+5,y+gp+(iconHeight/2)+1,
+ int iconWidth = iconHeight/2;
+ int side = x+((width/2)-(iconWidth/2));
+ g.fillTriangle(side+iconWidth,y+gp+(iconHeight/2)+1,
side,y+gp+iconHeight,
side,y+gp);
}
@@ -116,12 +116,12 @@
g.setColor( fcolor );
int gp = 2; // gap between arrow and sides
- int top = y+((height/2)-2);
int iconWidth = width-(gp*2);
+ int iconHeight = iconWidth/2;
+ int top = y+((height/2)-(iconHeight/2));
g.fillTriangle(x+gp+(iconWidth/2)+1, top,
- x+gp+iconWidth, top+5,
- x+gp, top+5);
-
+ x+gp+iconWidth, top+iconHeight,
+ x+gp, top+iconHeight);
}
else if (type == LookAndFeel.ICON_ARROW_DOWN) {
@@ -130,14 +130,13 @@
g.setColor( fcolor );
int gp = 2; // gap between arrow and sides
- int top = y+((height/2)-2);
int iconWidth = width-(gp*2);
- g.fillTriangle(x+gp+(iconWidth/2)+1, top+5,
+ int iconHeight = iconWidth/2;
+ int top = y+((height/2)-(iconHeight/2));
+ g.fillTriangle(x+gp+(iconWidth/2)+1, top+iconHeight,
x+gp+iconWidth, top,
x+gp, top);
-
}
-
}
private void drawSelectionArrow(Component c, Graphics2D g, int x, int y, int transformation) {
@@ -148,9 +147,10 @@
g.setTransform(transformation);
int gp = 2; // gap between arrow and sides
- int top = (height/2)-2;
int iconWidth = width-(gp*2);
- g.fillTriangle(gp+(iconWidth/2)+1, top+5,
+ int iconHeight = iconWidth/2;
+ int top = (height/2)-(iconHeight/2);
+ g.fillTriangle(gp+(iconWidth/2)+1, top+iconHeight,
gp+iconWidth, top,
gp, top);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|