clean up the updates panel in the manager

This commit is contained in:
Ben Fry
2022-07-26 07:58:46 -04:00
parent e9e2aed9c7
commit 51696a3281
4 changed files with 20 additions and 5 deletions
@@ -144,13 +144,15 @@ public class ListPanel extends JPanel implements Scrollable {
scrollPane.setBorder(BorderFactory.createEmptyBorder());
table.setFillsViewportHeight(true);
table.setDefaultRenderer(Contribution.class, new ContribStatusRenderer());
// table.setFont(ManagerFrame.NORMAL_PLAIN);
table.setRowHeight(Toolkit.zoom(28));
table.setRowMargin(Toolkit.zoom(6));
table.getColumnModel().setColumnMargin(0);
table.getColumnModel().getColumn(0).setMaxWidth(ManagerFrame.STATUS_WIDTH);
table.getColumnModel().getColumn(2).setMinWidth(ManagerFrame.AUTHOR_WIDTH);
table.getColumnModel().getColumn(2).setMaxWidth(ManagerFrame.AUTHOR_WIDTH);
TableColumnModel tcm = table.getColumnModel();
tcm.setColumnMargin(0);
tcm.getColumn(0).setMaxWidth(ManagerFrame.STATUS_WIDTH);
tcm.getColumn(2).setMinWidth(ManagerFrame.AUTHOR_WIDTH);
tcm.getColumn(2).setMaxWidth(ManagerFrame.AUTHOR_WIDTH);
table.setShowGrid(false);
table.setColumnSelectionAllowed(false);
table.setCellSelectionEnabled(false);
@@ -188,6 +190,7 @@ public class ListPanel extends JPanel implements Scrollable {
}
table.getTableHeader().setDefaultRenderer(new ContribHeaderRenderer());
table.getTableHeader().setReorderingAllowed(false);
table.getTableHeader().setResizingAllowed(true);
table.setVisible(true);
setLayout(new BorderLayout());
@@ -41,6 +41,7 @@ public class ManagerFrame {
static final int AUTHOR_WIDTH = Toolkit.zoom(240);
static final int STATUS_WIDTH = Toolkit.zoom(66);
static final int VERSION_WIDTH = Toolkit.zoom(66);
static final String title = "Contribution Manager";
@@ -20,6 +20,8 @@
*/
package processing.app.contrib;
import javax.swing.table.TableColumnModel;
public class UpdateListPanel extends ListPanel {
Contribution.Filter contribFilter;
@@ -34,7 +36,15 @@ public class UpdateListPanel extends ListPanel {
ContributionColumn.INSTALLED_VERSION,
ContributionColumn.AVAILABLE_VERSION);
TableColumnModel tcm = table.getColumnModel();
tcm.getColumn(3).setMaxWidth(ManagerFrame.VERSION_WIDTH);
tcm.getColumn(4).setMaxWidth(ManagerFrame.VERSION_WIDTH);
this.contribFilter = contribFilter;
// This is apparently a hack to prevent rows from being sorted by
// clicking on the column headers, which makes a mess because this
// list has sub-headers for the categories mixed into the list.
// However, unfortunately it also breaks column resizing. [fry 220726]
table.getTableHeader().setEnabled(false);
}
+1
View File
@@ -171,6 +171,7 @@ X icons in the status bar (using emojis at the moment, now out of place)
X console collapse/expand button
X copy to clipboard button
X contribs exclamation looks like an error, not "update available"
X clean up the updates panel in the manager
manager
X make ContributionTab.FilterField into a static class