1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-01-31 20:52:13 +01:00

Merge pull request #9875 from matthijskooijman/manager-title-colors

Set foreground color on board/library titles in managers
This commit is contained in:
Martino Facchin 2020-03-16 09:05:14 +01:00 committed by GitHub
commit 2e53557465
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 6 deletions

View File

@ -34,6 +34,7 @@ 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,
@ -41,6 +42,11 @@ public class ContributedLibraryTableCellJPanel extends JPanel {
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"));
@ -120,9 +126,7 @@ public class ContributedLibraryTableCellJPanel extends JPanel {
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;
@ -271,5 +275,7 @@ public class ContributedLibraryTableCellJPanel extends JPanel {
// The description is not opaque, so copy our foreground color to it.
if (description != null)
description.setForeground(c);
if (titledBorder != null)
titledBorder.setTitleColor(c);
}
}

View File

@ -67,6 +67,7 @@ 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");
@ -74,6 +75,11 @@ public class ContributedPlatformTableCellJPanel extends JPanel {
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);
@ -186,9 +192,7 @@ public class ContributedPlatformTableCellJPanel extends JPanel {
}
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;
@ -311,5 +315,7 @@ public class ContributedPlatformTableCellJPanel extends JPanel {
// The description is not opaque, so copy our foreground color to it.
if (description != null)
description.setForeground(c);
if (titledBorder != null)
titledBorder.setTitleColor(c);
}
}