adding more colors for themes in contrib manager

This commit is contained in:
Ben Fry
2022-04-28 16:00:49 -04:00
parent 91d3f4d149
commit 9c5bd8f485
3 changed files with 39 additions and 4 deletions
@@ -37,6 +37,7 @@ import processing.app.Base;
import processing.app.Language;
import processing.app.Library;
import processing.app.ui.Editor;
import processing.app.ui.Theme;
import processing.app.ui.Toolkit;
@@ -86,8 +87,13 @@ public class ContributionTab extends JPanel {
protected void updateTheme() {
//statusPanel.updateTheme(); // nothing yet
setBackground(Theme.getColor("manager.list.background.color"));
filterField.updateTheme();
listPanel.updateTheme();
//statusPanel.updateTheme(); // nothing yet
}
@@ -158,7 +164,6 @@ public class ContributionTab extends JPanel {
layout.setHonorsVisibility(listPanel, false);
layout.setHonorsVisibility(categoryChooser, false);
setBackground(Color.WHITE);
setBorder(null);
}
@@ -334,6 +339,10 @@ public class ContributionTab extends JPanel {
class FilterField extends JTextField {
List<String> filters;
Color textColor;
Color placeholderColor;
Color backgroundColor;
public FilterField () {
super("");
@@ -404,6 +413,8 @@ public class ContributionTab extends JPanel {
applyFilter();
}
});
updateTheme();
}
public void applyFilter() {
@@ -415,6 +426,14 @@ public class ContributionTab extends JPanel {
filters = Arrays.asList(filter.split(" "));
filterLibraries(category, filters);
}
protected void updateTheme() {
textColor = Theme.getColor("manager.list.search.text.color");
placeholderColor = Theme.getColor("manager.list.search.placeholder.color");
backgroundColor = Theme.getColor("manager.list.search.background.color");
setBackground(backgroundColor);
}
}
@@ -71,6 +71,8 @@ public class ListPanel extends JPanel implements Scrollable {
Color selectionColor;
Color rowColor;
Color textColor;
Color incompatibleColor;
static final SectionHeaderContribution[] sections = {
new SectionHeaderContribution(ContributionType.LIBRARY),
@@ -185,6 +187,9 @@ public class ListPanel extends JPanel implements Scrollable {
sectionColor = Theme.getColor("manager.list.section.color");
selectionColor = Theme.getColor("manager.list.selection.color");
textColor = Theme.getColor("manager.list.text.color");
incompatibleColor = Theme.getColor("manager.list.incompatible.color");
rowColor = Theme.getColor("manager.list.background.color");
table.setBackground(rowColor);
}
@@ -348,8 +353,10 @@ public class ListPanel extends JPanel implements Scrollable {
break;
}
if (!contribution.isCompatible(Base.getRevision())) {
label.setForeground(Color.LIGHT_GRAY);
if (contribution.isCompatible(Base.getRevision())) {
label.setForeground(textColor);
} else {
label.setForeground(incompatibleColor);
}
return label;
}
+9
View File
@@ -196,12 +196,21 @@ manager.tab.gradient.bottom = #6BA0C7
manager.tab.background = #6BA0C7
## ContributionTab
manager.list.search.text.color = #000000
manager.list.search.placeholder.color = #cccccc
manager.list.search.background.color = #ffffff
## ListPanel the listing inside a Contribution Manager tab ##
manager.list.background.color = #FFFFFF
manager.list.header.color = #EBEBEB
manager.list.section.color = #f8f8f8
manager.list.selection.color = #e0fffd
manager.list.text.color = #000000
manager.list.incompatible.color = #CCCCCC
## ZoomTreeCellRenderer - tree for Examples and Sketchbook windows ##