Skip to content

Commit ee05a4c

Browse files
committed
fix zoom on the tabs for the contrib manager
1 parent 96b7a4a commit ee05a4c

File tree

1 file changed

+16
-22
lines changed

1 file changed

+16
-22
lines changed

app/src/processing/app/contrib/ManagerTabs.java

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -48,26 +48,24 @@
4848
*/
4949
public class ManagerTabs extends Box {
5050
// height of this tab bar
51-
static final int HIGH = 34;
52-
// static final int HIGH = 29;
51+
static final int HIGH = Toolkit.zoom(34);
5352

5453
// amount of space around the entire window
55-
static final int BORDER = 8;
56-
// static final int BORDER = 12;
54+
static final int BORDER = Toolkit.zoom(8);
5755

58-
static final int CURVE_RADIUS = 6;
56+
static final int CURVE_RADIUS = Toolkit.zoom(6);
5957

60-
static final int TAB_TOP = 0;
61-
static final int TAB_BOTTOM = HIGH - 2;
58+
static final int TAB_TOP = Toolkit.zoom(0);
59+
static final int TAB_BOTTOM = HIGH - Toolkit.zoom(2);
6260
// amount of extra space between individual tabs
63-
static final int TAB_BETWEEN = 2; //4;
61+
static final int TAB_BETWEEN = Toolkit.zoom(2);
6462
// amount of margin on the left/right for the text on the tab
65-
static final int MARGIN = 14;
63+
static final int MARGIN = Toolkit.zoom(14);
6664

67-
static final int ICON_WIDTH = 16;
68-
static final int ICON_HEIGHT = 16;
69-
static final int ICON_TOP = 7;
70-
static final int ICON_MARGIN = 7;
65+
static final int ICON_WIDTH = Toolkit.zoom(16);
66+
static final int ICON_HEIGHT = Toolkit.zoom(16);
67+
static final int ICON_TOP = Toolkit.zoom(7);
68+
static final int ICON_MARGIN = Toolkit.zoom(7);
7169

7270
static final int UNSELECTED = 0;
7371
static final int SELECTED = 1;
@@ -109,7 +107,7 @@ public ManagerTabs(Base base) {
109107
tabColor[SELECTED] = mode.getColor("manager.tab.selected.color");
110108
tabColor[UNSELECTED] = mode.getColor("manager.tab.unselected.color");
111109

112-
gradient = mode.makeGradient("manager.tab", 400, HIGH);
110+
gradient = mode.makeGradient("manager.tab", Toolkit.zoom(400), HIGH);
113111

114112
setBorder(new EmptyBorder(BORDER, BORDER, BORDER, BORDER));
115113

@@ -231,24 +229,20 @@ public void paintComponent(Graphics screen) {
231229
g.drawImage(gradient, 0, 0, imageW, imageH, this);
232230

233231
g.setColor(tabColor[SELECTED]);
234-
g.fillRect(0, TAB_BOTTOM, imageW, 2);
232+
// draw the two pixel line that extends left/right below the tabs
233+
// can't be done with lines, b/c retina leaves tiny hairlines
234+
g.fillRect(0, TAB_BOTTOM, imageW, Toolkit.zoom(2));
235235

236236
// reset all tab positions
237237
for (Tab tab : tabList) {
238238
tab.textWidth = (int)
239239
font.getStringBounds(tab.name, g2.getFontRenderContext()).getWidth();
240240
}
241241

242-
placeTabs(0); //Editor.LEFT_GUTTER);
242+
placeTabs(0);
243243
// now actually draw the tabs
244244
drawTabs(g2);
245245

246-
// // draw the two pixel line that extends left/right below the tabs
247-
// g.setColor(tabColor[SELECTED]);
248-
// // can't be done with lines, b/c retina leaves tiny hairlines
249-
// g.fillRect(Editor.LEFT_GUTTER, TAB_BOTTOM,
250-
// editor.getTextArea().getWidth() - Editor.LEFT_GUTTER, 2);
251-
252246
screen.drawImage(offscreen, 0, 0, imageW, imageH, null);
253247
}
254248

0 commit comments

Comments
 (0)