Skip to content

Commit b2b975e

Browse files
committed
a little further along with the cleanups
1 parent 54dbff8 commit b2b975e

5 files changed

Lines changed: 51 additions & 34 deletions

File tree

app/src/processing/app/Editor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2601,7 +2601,7 @@ public void updateTitle() {
26012601
getRootPane().putClientProperty("Window.documentFile", null);
26022602
}
26032603

2604-
toolbar.setText(sketch.getName());
2604+
// toolbar.setText(sketch.getName());
26052605
}
26062606

26072607

app/src/processing/app/EditorHeader.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ public class EditorHeader extends JComponent {
4747
// distance from the righthand side of a tab to the drop-down arrow
4848
// static final int ARROW_GAP_WIDTH = 8;
4949
// indent x/y for notch on the tab
50-
static final int ARROW_TOP = 14;
51-
static final int ARROW_BOTTOM = 23;
50+
static final int ARROW_TOP = 12;
51+
static final int ARROW_BOTTOM = 20;
5252
static final int ARROW_WIDTH = 9;
5353

5454
// static final int NOTCH = 0;

app/src/processing/app/EditorToolbar.java

Lines changed: 39 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ abstract public class EditorToolbar extends JPanel {
5050

5151
protected EditorButton runButton;
5252
protected EditorButton stopButton;
53-
protected EditorButton currentButton;
53+
// protected EditorButton currentButton;
5454

5555
protected Box box;
5656
protected JLabel label;
@@ -96,14 +96,20 @@ public void actionPerformed(ActionEvent e) {
9696

9797
box = Box.createHorizontalBox();
9898
box.add(Box.createHorizontalStrut(Editor.LEFT_GUTTER));
99+
99100
box.add(runButton);
101+
box.add(Box.createHorizontalStrut(GAP));
102+
box.add(stopButton);
100103

101104
box.add(Box.createHorizontalStrut(LABEL_GAP));
102105
label = new JLabel();
103-
label.setFont(mode.getFont("toolbar.sketch.font"));
104-
label.setForeground(mode.getColor("toolbar.sketch.color"));
106+
label.setFont(mode.getFont("toolbar.rollover.font"));
107+
label.setForeground(mode.getColor("toolbar.rollover.color"));
105108
box.add(label);
106-
currentButton = runButton;
109+
// currentButton = runButton;
110+
111+
runButton.setRolloverLabel(label);
112+
stopButton.setRolloverLabel(label);
107113

108114
box.add(Box.createHorizontalGlue());
109115
addModeButtons(box);
@@ -125,9 +131,9 @@ public void actionPerformed(ActionEvent e) {
125131
// }
126132

127133

128-
public void setText(String text) {
129-
label.setText(text);
130-
}
134+
// public void setText(String text) {
135+
// label.setText(text);
136+
// }
131137

132138

133139
public void paintComponent(Graphics g) {
@@ -152,22 +158,22 @@ public void addGap(Box box) {
152158
// }
153159

154160

155-
protected void swapButton(EditorButton replacement) {
156-
if (currentButton != replacement) {
157-
box.remove(currentButton);
158-
box.add(replacement, 1); // has to go after the strut
159-
box.revalidate();
160-
box.repaint(); // may be needed
161-
currentButton = replacement;
162-
}
163-
}
161+
// protected void swapButton(EditorButton replacement) {
162+
// if (currentButton != replacement) {
163+
// box.remove(currentButton);
164+
// box.add(replacement, 1); // has to go after the strut
165+
// box.revalidate();
166+
// box.repaint(); // may be needed
167+
// currentButton = replacement;
168+
// }
169+
// }
164170

165171

166172
public void activateRun() {
167-
//runButton.setPressed(true);
168-
// Rectangle bounds = runButton.getBounds();
169-
// remove(runButton);
170-
swapButton(stopButton);
173+
// //runButton.setPressed(true);
174+
//// Rectangle bounds = runButton.getBounds();
175+
//// remove(runButton);
176+
// swapButton(stopButton);
171177
}
172178

173179

@@ -181,7 +187,7 @@ public void activateStop() {
181187

182188

183189
public void deactivateStop() {
184-
swapButton(runButton);
190+
// swapButton(runButton);
185191
}
186192

187193

@@ -218,14 +224,16 @@ class ModeSelector extends JPanel {
218224

219225
final int MODE_GAP_WIDTH = 13;
220226
final int ARROW_GAP_WIDTH = 6;
221-
final int ARROW_WIDTH = 8;
222-
final int ARROW_TOP = 21;
223-
final int ARROW_BOTTOM = 29;
227+
final int ARROW_WIDTH = 6;
228+
final int ARROW_TOP = 15;
229+
final int ARROW_BOTTOM = 21;
224230

225231
int[] triangleX = new int[3];
226232
int[] triangleY = new int[] { ARROW_TOP, ARROW_TOP, ARROW_BOTTOM };
227233

228-
Image background;
234+
// Image background;
235+
Color backgroundColor;
236+
229237

230238
@SuppressWarnings("deprecation")
231239
public ModeSelector() {
@@ -243,7 +251,8 @@ public void mousePressed(MouseEvent event) {
243251
}
244252
});
245253

246-
background = mode.getGradient("reversed", 100, EditorButton.DIM);
254+
//background = mode.getGradient("reversed", 100, EditorButton.DIM);
255+
backgroundColor = mode.getColor("mode.background.color");
247256
}
248257

249258
@Override
@@ -276,10 +285,12 @@ public void paintComponent(Graphics screen) {
276285
FontMetrics metrics = g.getFontMetrics();
277286
titleWidth = metrics.stringWidth(title);
278287

279-
g.drawImage(background, 0, 0, width, height, this);
288+
//g.drawImage(background, 0, 0, width, height, this);
289+
g.setColor(backgroundColor);
290+
g.fillRect(0, 0, width, height);
280291

281292
g.setColor(titleColor);
282-
g.drawString(title, MODE_GAP_WIDTH, (height + titleAscent) / 2);
293+
g.drawString(title.toUpperCase(), MODE_GAP_WIDTH, (height + titleAscent) / 2);
283294

284295
int x = MODE_GAP_WIDTH + titleWidth + ARROW_GAP_WIDTH;
285296
triangleX[0] = x;

build/shared/lib/theme.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,22 @@ divider.dot.color = #505050
5050
# TOOLBAR BUTTON TEXT
5151
#buttons.status.font = processing.sans,bold,13
5252
#buttons.status.color = #ffffff
53-
toolbar.sketch.font = processing.sans,plain,24
54-
toolbar.sketch.color = #ffffff
53+
#toolbar.sketch.font = processing.sans,plain,24
54+
#toolbar.sketch.color = #ffffff
55+
toolbar.rollover.font = processing.sans,plain,12
56+
toolbar.rollover.color = #ffffff
5557
toolbar.gradient.top = #142c40
5658
toolbar.gradient.bottom = #132638
5759

5860
# MODE SELECTOR
59-
mode.title.font = processing.sans,bold,15
61+
#mode.title.font = processing.sans,bold,15
62+
mode.title.font = processing.sans,plain,12
6063
mode.title.color = #ffffff
6164
# outline color of the mode button
6265
#mode.button.color = #ffffff
6366
#mode.button.gap = 13
6467
#mode.arrow.width
68+
mode.background.color = #3D5362
6569

6670
# LINE STATUS
6771
# The editor line number status bar at the bottom of the screen

java/src/processing/mode/java/JavaToolbar.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public JavaToolbar(Editor editor) {
4141
}
4242

4343

44+
/*
4445
public void addModeButtons(Box box) {
4546
EditorButton debugButton = new EditorButton(mode, "/lib/toolbar/debug",
4647
Language.text("toolbar.debug")) {
@@ -54,6 +55,7 @@ public void actionPerformed(ActionEvent e) {
5455
box.add(debugButton);
5556
addGap(box);
5657
}
58+
*/
5759

5860

5961
@Override

0 commit comments

Comments
 (0)