MCPcopy Index your code
hub / github.com/benfry/processing4 / updateTheme

Method updateTheme

app/src/processing/app/contrib/StatusPanel.java:223–292  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

221
222
223 protected void updateTheme() {
224 setBackground(Theme.getColor("manager.panel.background.color"));
225
226 Font detailFont = Theme.getFont("manager.panel.font");
227 detailStyle =
228 "body { " +
229 " margin: 0; " +
230 " padding: 0;" +
231 " font-family: " + detailFont.getName() + ", sans-serif;" +
232 " font-size: " + detailFont.getSize() + "px;" +
233 " color: " + Theme.get("manager.panel.text.color") + ";" +
234 "}" +
235 "a { " +
236 " color: " + Theme.get("manager.panel.link.color") + ";" +
237 " text-decoration: none;" +
238 "}";
239
240 updateLabel.setForeground(Theme.getColor("manager.panel.text.color"));
241 foundationIcon = Toolkit.renderIcon("manager/foundation", Theme.get("manager.panel.foundation.color"), 32);
242
243 updateButtonTheme(installButton, "install");
244 updateButtonTheme(updateButton, "update");
245 updateButtonTheme(removeButton, "remove");
246
247 StatusDetail currentDetail =
248 // I'm not circuitous, *you're* circuitous.
249 contributionTab.listPanel.getSelectedDetail();
250 if (currentDetail != null) {
251 applyDetail(currentDetail);
252 // TODO This only updates the scroll bar, and only the current selection.
253 // So if the theme is updated with the manager opened, selecting
254 // another contrib and installing/updating/removing it will result
255 // in a progress bar being used that's not the correct theme.
256 // But the progress bars need to be removed anyway. [fry 230114]
257 currentDetail.updateTheme();
258 }
259
260 if (progressBar.getUI() instanceof PdeProgressBarUI) {
261 ((PdeProgressBarUI) progressBar.getUI()).updateTheme();
262 } else {
263 progressBar.setUI(new PdeProgressBarUI("manager.progress"));
264 }
265
266 /*
267 if (installButton.getUI() instanceof PdeButtonUI) {
268 ((PdeButtonUI) installButton.getUI()).updateTheme();
269 } else {
270 installButton.setUI(new PdeButtonUI("manager.button"));
271 }
272 */
273
274 /*
275 installButton.setForeground(Theme.getColor("manager.button.text.color"));
276 installButton.setBackground(Theme.getColor("manager.button.background.color"));
277 //installButton.setBorder(new EmptyBorder(2, 14, 2, 14));
278 //installButton.setBorder(new LineBorder(Color.ORANGE, 1, true));
279
280 // draws correctly, but specifying rounded doesn't help

Callers 1

updateButtonThemeMethod · 0.45

Calls 10

getColorMethod · 0.95
getFontMethod · 0.95
getMethod · 0.95
renderIconMethod · 0.95
updateButtonThemeMethod · 0.95
applyDetailMethod · 0.95
updateThemeMethod · 0.95
getSizeMethod · 0.80
getSelectedDetailMethod · 0.80
getNameMethod · 0.45

Tested by

no test coverage detected