Skip to content

Set foreground color on board/library titles in managers #9875

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,19 @@ public class ContributedLibraryTableCellJPanel extends JPanel {
final JPanel inactiveButtonsPanel;
final JLabel statusLabel;
final JTextPane description;
final TitledBorder titledBorder;
private final String moreInfoLbl = tr("More info");

public ContributedLibraryTableCellJPanel(JTable parentTable, Object value,
boolean isSelected) {
super();
setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));

// Actual title set below
titledBorder = BorderFactory.createTitledBorder("");
titledBorder.setTitleFont(getFont().deriveFont(Font.BOLD));
setBorder(titledBorder);

moreInfoButton = new JButton(moreInfoLbl);
moreInfoButton.setVisible(false);
installButton = new JButton(tr("Install"));
Expand Down Expand Up @@ -120,9 +126,7 @@ public ContributedLibraryTableCellJPanel(JTable parentTable, Object value,
return;

ContributedLibrary selected = releases.getSelected();
TitledBorder titledBorder = BorderFactory.createTitledBorder(selected.getName());
titledBorder.setTitleFont(getFont().deriveFont(Font.BOLD));
setBorder(titledBorder);
titledBorder.setTitle(selected.getName());
Optional<ContributedLibrary> mayInstalled = releases.getInstalled();

boolean installable, upgradable;
Expand Down Expand Up @@ -271,5 +275,7 @@ public void setForeground(Color c) {
// The description is not opaque, so copy our foreground color to it.
if (description != null)
description.setForeground(c);
if (titledBorder != null)
titledBorder.setTitleColor(c);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,19 @@ public class ContributedPlatformTableCellJPanel extends JPanel {
final JPanel inactiveButtonsPanel;
final JLabel statusLabel;
final JTextPane description;
final TitledBorder titledBorder;
private final String moreInfoLbl = tr("More Info");
private final String onlineHelpLbl = tr("Online Help");

public ContributedPlatformTableCellJPanel() {
super();
setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));

// Actual title set by update()
titledBorder = BorderFactory.createTitledBorder("");
titledBorder.setTitleFont(getFont().deriveFont(Font.BOLD));
setBorder(titledBorder);

{
installButton = new JButton(tr("Install"));
moreInfoButton = new JButton(moreInfoLbl);
Expand Down Expand Up @@ -186,9 +192,7 @@ void update(JTable parentTable, Object value, boolean hasBuiltInRelease) {
}

ContributedPlatform selected = releases.getSelected();
TitledBorder titledBorder = BorderFactory.createTitledBorder(selected.getName());
titledBorder.setTitleFont(getFont().deriveFont(Font.BOLD));
setBorder(titledBorder);
titledBorder.setTitle(selected.getName());
ContributedPlatform installed = releases.getInstalled();

boolean removable, installable, upgradable;
Expand Down Expand Up @@ -311,5 +315,7 @@ public void setForeground(Color c) {
// The description is not opaque, so copy our foreground color to it.
if (description != null)
description.setForeground(c);
if (titledBorder != null)
titledBorder.setTitleColor(c);
}
}