提交 3abf54aa 编写于 作者: R rupashka

6635277: Incorrect text seen when creating a new folder, when selection is on...

6635277: Incorrect text seen when creating a new folder, when selection is on the image file in JFileChooser
Summary: Corrected bounds of editor area
Reviewed-by: loneid
上级 0dc1624c
......@@ -1285,7 +1285,6 @@ public class FilePane extends JPanel implements PropertyChangeListener {
int lastIndex = -1;
File editFile = null;
int editX = 20;
private int getEditIndex() {
return lastIndex;
......@@ -1315,7 +1314,9 @@ public class FilePane extends JPanel implements PropertyChangeListener {
* @param index visual index of the file to be edited
*/
private void editFileName(int index) {
File currentDirectory = getFileChooser().getCurrentDirectory();
JFileChooser chooser = getFileChooser();
File currentDirectory = chooser.getCurrentDirectory();
if (readOnly || !canWrite(currentDirectory)) {
return;
}
......@@ -1332,9 +1333,15 @@ public class FilePane extends JPanel implements PropertyChangeListener {
editCell.setNextFocusableComponent(list);
}
list.add(editCell);
editCell.setText(getFileChooser().getName(editFile));
editCell.setText(chooser.getName(editFile));
ComponentOrientation orientation = list.getComponentOrientation();
editCell.setComponentOrientation(orientation);
Icon icon = chooser.getIcon(editFile);
// PENDING - grab padding (4) below from defaults table.
int editX = icon == null ? 20 : icon.getIconWidth() + 4;
if (orientation.isLeftToRight()) {
editCell.setBounds(editX + r.x, r.y, r.width - editX, r.height);
} else {
......@@ -1458,11 +1465,6 @@ public class FilePane extends JPanel implements PropertyChangeListener {
Icon icon = getFileChooser().getIcon(file);
if (icon != null) {
setIcon(icon);
if (isSelected) {
// PENDING - grab padding (4) below from defaults table.
editX = icon.getIconWidth() + 4;
}
} else {
if (getFileChooser().getFileSystemView().isTraversable(file)) {
setText(fileName+File.separator);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册