|
48 | 48 | */ |
49 | 49 | public class ManagerTabs extends Box { |
50 | 50 | // 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); |
53 | 52 |
|
54 | 53 | // 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); |
57 | 55 |
|
58 | | - static final int CURVE_RADIUS = 6; |
| 56 | + static final int CURVE_RADIUS = Toolkit.zoom(6); |
59 | 57 |
|
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); |
62 | 60 | // amount of extra space between individual tabs |
63 | | - static final int TAB_BETWEEN = 2; //4; |
| 61 | + static final int TAB_BETWEEN = Toolkit.zoom(2); |
64 | 62 | // 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); |
66 | 64 |
|
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); |
71 | 69 |
|
72 | 70 | static final int UNSELECTED = 0; |
73 | 71 | static final int SELECTED = 1; |
@@ -109,7 +107,7 @@ public ManagerTabs(Base base) { |
109 | 107 | tabColor[SELECTED] = mode.getColor("manager.tab.selected.color"); |
110 | 108 | tabColor[UNSELECTED] = mode.getColor("manager.tab.unselected.color"); |
111 | 109 |
|
112 | | - gradient = mode.makeGradient("manager.tab", 400, HIGH); |
| 110 | + gradient = mode.makeGradient("manager.tab", Toolkit.zoom(400), HIGH); |
113 | 111 |
|
114 | 112 | setBorder(new EmptyBorder(BORDER, BORDER, BORDER, BORDER)); |
115 | 113 |
|
@@ -231,24 +229,20 @@ public void paintComponent(Graphics screen) { |
231 | 229 | g.drawImage(gradient, 0, 0, imageW, imageH, this); |
232 | 230 |
|
233 | 231 | 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)); |
235 | 235 |
|
236 | 236 | // reset all tab positions |
237 | 237 | for (Tab tab : tabList) { |
238 | 238 | tab.textWidth = (int) |
239 | 239 | font.getStringBounds(tab.name, g2.getFontRenderContext()).getWidth(); |
240 | 240 | } |
241 | 241 |
|
242 | | - placeTabs(0); //Editor.LEFT_GUTTER); |
| 242 | + placeTabs(0); |
243 | 243 | // now actually draw the tabs |
244 | 244 | drawTabs(g2); |
245 | 245 |
|
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 | | - |
252 | 246 | screen.drawImage(offscreen, 0, 0, imageW, imageH, null); |
253 | 247 | } |
254 | 248 |
|
|
0 commit comments