ui fixes
This commit is contained in:
parent
c1e2bce59c
commit
2f0e1df9c9
@ -2827,17 +2827,17 @@ public class FilePanelTab extends JPanel {
|
||||
|
||||
private void showAssociationDialog(File file) {
|
||||
String name = file.getName();
|
||||
String ext = "";
|
||||
String initialPattern = "";
|
||||
int lastDot = name.lastIndexOf('.');
|
||||
if (lastDot > 0 && lastDot < name.length() - 1) {
|
||||
ext = name.substring(lastDot + 1);
|
||||
initialPattern = "*." + name.substring(lastDot + 1).toLowerCase();
|
||||
} else {
|
||||
ext = name; // fallback to full name if no extension
|
||||
initialPattern = name; // fallback to full name if no extension
|
||||
}
|
||||
|
||||
String pattern = JOptionPane.showInputDialog(this,
|
||||
"File pattern (e.g. *.txt or txt):",
|
||||
ext);
|
||||
initialPattern);
|
||||
|
||||
if (pattern == null || pattern.trim().isEmpty()) return;
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@ import java.awt.*;
|
||||
* Custom icon for files with type-specific indicators.
|
||||
*/
|
||||
public class FileSpecificIcon implements Icon {
|
||||
public enum Type { IMAGE, VIDEO, AUDIO, ARCHIVE, CODE, TEXT, DOC, EXEC, OTHER }
|
||||
public enum Type { IMAGE, VIDEO, AUDIO, ARCHIVE, CODE, TEXT, DOC, EXEC, SHELL, OTHER }
|
||||
private final Type type;
|
||||
private final Color color;
|
||||
|
||||
@ -22,6 +22,7 @@ public class FileSpecificIcon implements Icon {
|
||||
case TEXT: this.color = Color.GRAY; break;
|
||||
case DOC: this.color = new Color(70, 90, 180); break; // Darker blue
|
||||
case EXEC: this.color = new Color(0, 128, 128); break; // Teal
|
||||
case SHELL: this.color = new Color(40, 44, 52); break; // Dark grey
|
||||
default: this.color = Color.LIGHT_GRAY; break;
|
||||
}
|
||||
}
|
||||
@ -48,9 +49,11 @@ public class FileSpecificIcon implements Icon {
|
||||
if (name.endsWith(".java") || name.endsWith(".c") || name.endsWith(".cpp") ||
|
||||
name.endsWith(".cs") || name.endsWith(".py") || name.endsWith(".js") ||
|
||||
name.endsWith(".ts") || name.endsWith(".html") || name.endsWith(".css") ||
|
||||
name.endsWith(".xml") || name.endsWith(".json") || name.endsWith(".sh") ||
|
||||
name.endsWith(".xml") || name.endsWith(".json") ||
|
||||
name.endsWith(".bat") || name.endsWith(".pl") || name.endsWith(".php")) return Type.CODE;
|
||||
|
||||
if (name.endsWith(".sh")) return Type.SHELL;
|
||||
|
||||
if (name.endsWith(".pdf") || name.endsWith(".doc") || name.endsWith(".docx") ||
|
||||
name.endsWith(".xls") || name.endsWith(".xlsx") || name.endsWith(".ppt") ||
|
||||
name.endsWith(".pptx") || name.endsWith(".odt") || name.endsWith(".ods")) return Type.DOC;
|
||||
@ -107,6 +110,11 @@ public class FileSpecificIcon implements Icon {
|
||||
g2.drawLine(x + 9, y + 7, x + 11, y + 9); // >
|
||||
g2.drawLine(x + 9, y + 11, x + 11, y + 9);
|
||||
break;
|
||||
case SHELL:
|
||||
g2.drawLine(x + 5, y + 6, x + 7, y + 8); // >
|
||||
g2.drawLine(x + 5, y + 10, x + 7, y + 8);
|
||||
g2.drawLine(x + 8, y + 11, x + 11, y + 11); // _
|
||||
break;
|
||||
case TEXT:
|
||||
case DOC:
|
||||
g2.drawLine(x + 5, y + 6, x + 11, y + 6);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user