mirror of
https://github.com/mitb-archive/filebot
synced 2024-08-13 17:03:45 -04:00
* improved CRC32 highlighting
This commit is contained in:
parent
aefc84085b
commit
1ad60f8e97
@ -15,16 +15,11 @@ class FileNameTableCellRenderer extends DefaultTableCellRenderer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
|
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
|
||||||
|
|
||||||
super.getTableCellRendererComponent(table, value, isSelected, false, row, column);
|
super.getTableCellRendererComponent(table, value, isSelected, false, row, column);
|
||||||
|
|
||||||
if (hasFocus) {
|
// highlight CRC32 checksum patterns by using a smaller font-size and changing the font-color to a dark green
|
||||||
// do not highlight checksum patterns in focused cells, that would look weird
|
// do not change the font-color if cell is selected, because that would look ugly (imagine green text on blue background ...)
|
||||||
return this;
|
String htmlText = value.toString().replaceAll("\\[(\\p{XDigit}{8})\\]", "[<span style='font-size: smaller;" + (!isSelected ? "color: #009900;" : "") + "'>$1</span>]");
|
||||||
}
|
|
||||||
|
|
||||||
// change font-color of checksum pattern
|
|
||||||
String htmlText = value.toString().replaceAll("\\[(\\p{XDigit}{8})\\]", "[<font color='#009900'>$1</font>]");
|
|
||||||
|
|
||||||
// use no-break, because we really don't want line-wrapping in our table cells
|
// use no-break, because we really don't want line-wrapping in our table cells
|
||||||
setText("<html><nobr>" + htmlText + "</nobr></html>");
|
setText("<html><nobr>" + htmlText + "</nobr></html>");
|
||||||
|
Loading…
Reference in New Issue
Block a user