From 0110fd8ff1f70ebc88247d4f65f44df3d7ddc8d0 Mon Sep 17 00:00:00 2001 From: Federico Fissore Date: Fri, 13 Mar 2015 15:09:20 +0100 Subject: [PATCH] Core/lib manager: INSTALLED label --- .../ui/ContributedLibraryTableCell.java | 31 ++++++++++++------- .../ui/ContributedPlatformTableCell.java | 8 ++--- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/app/src/cc/arduino/libraries/contributions/ui/ContributedLibraryTableCell.java b/app/src/cc/arduino/libraries/contributions/ui/ContributedLibraryTableCell.java index 152850ac6..a14ae0b60 100644 --- a/app/src/cc/arduino/libraries/contributions/ui/ContributedLibraryTableCell.java +++ b/app/src/cc/arduino/libraries/contributions/ui/ContributedLibraryTableCell.java @@ -77,8 +77,8 @@ public class ContributedLibraryTableCell extends InstallerTableCell { HTMLDocument html = (HTMLDocument) doc; StyleSheet stylesheet = html.getStyleSheet(); stylesheet.addRule("body { margin: 0; padding: 0;" - + "font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;" - + "font-size: 100%;" + "font-size: 0.95em; }"); + + "font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;" + + "font-size: 100%;" + "font-size: 0.95em; }"); } description.setOpaque(false); description.setBorder(new EmptyBorder(4, 7, 7, 7)); @@ -138,12 +138,12 @@ public class ContributedLibraryTableCell extends InstallerTableCell { downgradeButton.setEnabled(!disableDowngrade); } }); - + panel = new JPanel(); panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS)); panel.add(description); - + { buttonsPanel = new JPanel(); buttonsPanel.setLayout(new BoxLayout(buttonsPanel, BoxLayout.X_AXIS)); @@ -165,7 +165,7 @@ public class ContributedLibraryTableCell extends InstallerTableCell { panel.add(buttonsPanel); } - + { inactiveButtonsPanel = new JPanel(); inactiveButtonsPanel.setLayout(new BoxLayout(inactiveButtonsPanel, BoxLayout.X_AXIS)); @@ -286,24 +286,31 @@ public class ContributedLibraryTableCell extends InstallerTableCell { if (installedLib != null && installedLib.isReadOnly()) { desc += "Built-In "; } - + // ...author... desc += format("", midcolor); if (author != null && !author.isEmpty()) { desc += format(" by {0}", author); } - + // ...version. if (installedLib != null) { String installedVer = installedLib.getVersion(); - if (installedVer == null) + if (installedVer == null) { desc += " " + _("Version unknown"); - else + } else { desc += " " + format(_("Version {0}"), installedVer); + } } else { // not installed... } - desc += "
"; + desc += ""; + + if (installedLib != null) { + desc += " INSTALLED"; + } + + desc += "
"; // Description if (sentence != null) { @@ -319,7 +326,7 @@ public class ContributedLibraryTableCell extends InstallerTableCell { desc += ""; description.setText(desc); description.setBackground(Color.WHITE); - + // If the selected lib is available from repository... if (url != null) { removeButton.setText(_("Remove")); @@ -365,7 +372,7 @@ public class ContributedLibraryTableCell extends InstallerTableCell { buttonsPanel.setVisible(enabled); inactiveButtonsPanel.setVisible(!enabled); } - + public void enable(boolean enabled) { installButton.setEnabled(enabled); removeButton.setEnabled(enabled); diff --git a/app/src/cc/arduino/packages/contributions/ui/ContributedPlatformTableCell.java b/app/src/cc/arduino/packages/contributions/ui/ContributedPlatformTableCell.java index 0437c78e0..3405d2f34 100644 --- a/app/src/cc/arduino/packages/contributions/ui/ContributedPlatformTableCell.java +++ b/app/src/cc/arduino/packages/contributions/ui/ContributedPlatformTableCell.java @@ -78,8 +78,8 @@ public class ContributedPlatformTableCell extends InstallerTableCell { HTMLDocument html = (HTMLDocument) doc; StyleSheet stylesheet = html.getStyleSheet(); stylesheet.addRule("body { margin: 0; padding: 0;" - + "font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;" - + "font-size: 100%;" + "font-size: 0.95em; }"); + + "font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;" + + "font-size: 100%;" + "font-size: 0.95em; }"); } description.setOpaque(false); description.setBorder(new EmptyBorder(4, 7, 7, 7)); @@ -268,7 +268,7 @@ public class ContributedPlatformTableCell extends InstallerTableCell { desc += " " + format("by {0}", author); } if (removable) { - desc += " " + format(_("version {0}"), installedPlatform.getVersion()); + desc += " " + format(_("version {0}"), installedPlatform.getVersion()) + " INSTALLED"; } desc += "
"; @@ -287,7 +287,7 @@ public class ContributedPlatformTableCell extends InstallerTableCell { int width = parentTable.getBounds().width; setJTextPaneDimensionToFitContainedText(description, width); - + if (isSelected) { panel.setBackground(parentTable.getSelectionBackground()); panel.setForeground(parentTable.getSelectionForeground());