Added: "Show detail" context menu item for items in folder preview

This commit is contained in:
Jindra Petřík
2025-05-25 16:11:01 +02:00
parent b8adecdc6c
commit 13453cc508
10 changed files with 60 additions and 27 deletions
@@ -105,9 +105,7 @@ public class FolderPreviewPanel extends JPanel {
@Override
public void mouseClicked(MouseEvent e) {
if (e.getClickCount() > 1) {
if (selectedIndex > -1) {
mainPanel.setTagTreeSelectedNode(mainPanel.getCurrentTree(), FolderPreviewPanel.this.items.get(selectedIndex));
}
goToSelection();
}
}
@@ -151,7 +149,7 @@ public class FolderPreviewPanel extends JPanel {
}
if (SwingUtilities.isRightMouseButton(e)) {
mainPanel.getContextPopupMenu().update(getSelectedItemsSorted());
mainPanel.getContextPopupMenu().update(getSelectedItemsSorted(), true);
mainPanel.getContextPopupMenu().show(FolderPreviewPanel.this, e.getX(), e.getY());
}
repaint();
@@ -159,6 +157,12 @@ public class FolderPreviewPanel extends JPanel {
});
setFocusable(true);
}
public void goToSelection() {
if (selectedIndex > -1) {
mainPanel.setTagTreeSelectedNode(mainPanel.getCurrentTree(), FolderPreviewPanel.this.items.get(selectedIndex));
}
}
public synchronized void setItems(List<TreeItem> items) {
this.items = items;