mirror of
https://github.com/processing/processing4.git
synced 2026-02-11 01:29:17 +01:00
only draw when >0 updates
This commit is contained in:
@@ -281,22 +281,24 @@ public class EditorFooter extends Box {
|
||||
|
||||
|
||||
private void drawUpdates(Graphics2D g2) {
|
||||
FontRenderContext frc = g2.getFontRenderContext();
|
||||
final int GAP = 5;
|
||||
final String updateLabel = "Updates";
|
||||
String updatesStr = "" + updateCount;
|
||||
double countWidth = font.getStringBounds(updatesStr, frc).getWidth();
|
||||
float diameter = (float) (countWidth * 1.65f);
|
||||
float ex = getWidth() - Editor.RIGHT_GUTTER - diameter;
|
||||
float ey = (getHeight() - diameter) / 2;
|
||||
g2.setColor(updateColor);
|
||||
g2.fill(new Ellipse2D.Float(ex, ey, diameter, diameter));
|
||||
g2.setColor(textColor[SELECTED]);
|
||||
int baseline = (getHeight() + fontAscent) / 2;
|
||||
g2.drawString(updatesStr, (int) (ex + (diameter - countWidth)/2), baseline);
|
||||
double updatesWidth = font.getStringBounds(updateLabel, frc).getWidth();
|
||||
g2.setColor(textColor[UNSELECTED]);
|
||||
g2.drawString(updateLabel, (int) (ex - updatesWidth - GAP), baseline);
|
||||
if (updateCount != 0) {
|
||||
FontRenderContext frc = g2.getFontRenderContext();
|
||||
final int GAP = 5;
|
||||
final String updateLabel = "Updates";
|
||||
String updatesStr = "" + updateCount;
|
||||
double countWidth = font.getStringBounds(updatesStr, frc).getWidth();
|
||||
float diameter = (float) (countWidth * 1.65f);
|
||||
float ex = getWidth() - Editor.RIGHT_GUTTER - diameter;
|
||||
float ey = (getHeight() - diameter) / 2;
|
||||
g2.setColor(updateColor);
|
||||
g2.fill(new Ellipse2D.Float(ex, ey, diameter, diameter));
|
||||
g2.setColor(textColor[SELECTED]);
|
||||
int baseline = (getHeight() + fontAscent) / 2;
|
||||
g2.drawString(updatesStr, (int) (ex + (diameter - countWidth)/2), baseline);
|
||||
double updatesWidth = font.getStringBounds(updateLabel, frc).getWidth();
|
||||
g2.setColor(textColor[UNSELECTED]);
|
||||
g2.drawString(updateLabel, (int) (ex - updatesWidth - GAP), baseline);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
12
todo.txt
12
todo.txt
@@ -16,6 +16,11 @@ X https://github.com/processing/processing/pull/3887
|
||||
X grab bag of CM work from Jakub
|
||||
X https://github.com/processing/processing/issues/3895
|
||||
X https://github.com/processing/processing/pull/3897
|
||||
X show number of updates available in the footer
|
||||
X https://github.com/processing/processing/issues/3518
|
||||
X https://github.com/processing/processing/pull/3896
|
||||
X https://github.com/processing/processing/pull/3901
|
||||
o total number of updates available is not correct? (may be fixed)
|
||||
|
||||
gui
|
||||
X distinguish errors and warnings
|
||||
@@ -93,12 +98,7 @@ _ bring back the # of updates on the update tab
|
||||
_ use this instead of the 'icon' stuff?
|
||||
_ or in addition, since only the 'updates' tab has it
|
||||
_ https://github.com/processing/processing/issues/3855
|
||||
_ show number of updates available in the footer
|
||||
_ https://github.com/processing/processing/issues/3518
|
||||
X https://github.com/processing/processing/pull/3896
|
||||
X https://github.com/processing/processing/pull/3901
|
||||
_ and have it be clickable so to open the manager
|
||||
_ total number of updates available is not correct? (may be fixed)
|
||||
_ for updates available, have it be clickable to open the manager
|
||||
_ ugly white gap at the top of scroll bar
|
||||
_ the table header doesn't extend far enough
|
||||
_ scrolling "past" top/bottom causes the screen to jiggle (OS X and Trackpad)
|
||||
|
||||
Reference in New Issue
Block a user