1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-03-15 12:29:26 +01:00

Fixed position of the Label of command buttons.

This commit is contained in:
Cristian Maglie 2011-08-24 11:08:10 +02:00
parent 8059abe581
commit 0fca78cc7e

View File

@ -172,8 +172,8 @@ public class EditorToolbar extends JComponent implements MouseInputListener, Key
} }
// Serial button must be on the right // Serial button must be on the right
x1[SERIAL] = width - BUTTON_WIDTH - 3; x1[SERIAL] = width - BUTTON_WIDTH - 14;
x2[SERIAL] = width - 3; x2[SERIAL] = width - 14;
} }
Graphics g = offscreen.getGraphics(); Graphics g = offscreen.getGraphics();
g.setColor(bgcolor); //getBackground()); g.setColor(bgcolor); //getBackground());
@ -200,7 +200,13 @@ public class EditorToolbar extends JComponent implements MouseInputListener, Key
if (currentRollover != -1) { if (currentRollover != -1) {
int statusY = (BUTTON_HEIGHT + g.getFontMetrics().getAscent()) / 2; int statusY = (BUTTON_HEIGHT + g.getFontMetrics().getAscent()) / 2;
String status = shiftPressed ? titleShift[currentRollover] : title[currentRollover]; String status = shiftPressed ? titleShift[currentRollover] : title[currentRollover];
g.drawString(status, buttonCount * BUTTON_WIDTH + 3 * BUTTON_GAP, statusY); if (currentRollover != SERIAL)
g.drawString(status, (buttonCount-1) * BUTTON_WIDTH + 3 * BUTTON_GAP, statusY);
else {
int statusX = x1[SERIAL] - BUTTON_GAP;
statusX -= g.getFontMetrics().stringWidth(status);
g.drawString(status, statusX, statusY);
}
} }
screen.drawImage(offscreen, 0, 0, null); screen.drawImage(offscreen, 0, 0, null);