mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Wrong foreground when already unfocused fixed
This commit is contained in:
@@ -159,6 +159,17 @@ public class PushLog extends JPanel implements TypeSafeDataProvider {
|
||||
updateChangesView();
|
||||
}
|
||||
});
|
||||
myTree.addFocusListener(new FocusAdapter() {
|
||||
@Override
|
||||
public void focusLost(FocusEvent e) {
|
||||
DefaultMutableTreeNode node = (DefaultMutableTreeNode)myTree.getLastSelectedPathComponent();
|
||||
if (node != null && node instanceof RepositoryNode && myTree.isEditing()) {
|
||||
//need to force repaint foreground for non-focused editing node
|
||||
myTree.getCellEditor().getTreeCellEditorComponent(myTree, node, true, false, false, myTree.getRowForPath(
|
||||
TreeUtil.getPathFromRoot(node)));
|
||||
}
|
||||
}
|
||||
});
|
||||
myTree.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_F2, 0), START_EDITING);
|
||||
//override default tree behaviour.
|
||||
myTree.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "");
|
||||
|
||||
@@ -161,7 +161,10 @@ public class RepositoryWithBranchPanel<T extends PushTarget> extends NonOpaquePa
|
||||
if (bounds != null) {
|
||||
setPreferredSize(new Dimension(tree.getVisibleRect().width - bounds.x, bounds.height));
|
||||
}
|
||||
myDestPushTargetPanelComponent.requestFocus();
|
||||
if (myTextRenderer.getTree().hasFocus()) {
|
||||
//delegate focus from tree to editable component if needed
|
||||
myDestPushTargetPanelComponent.requestFocus(true);
|
||||
}
|
||||
revalidate();
|
||||
return this;
|
||||
}
|
||||
@@ -218,11 +221,6 @@ public class RepositoryWithBranchPanel<T extends PushTarget> extends NonOpaquePa
|
||||
return myCheckBoxLoadingIconGapV;
|
||||
}
|
||||
|
||||
public int getVBorderOffset(@NotNull SimpleColoredComponent coloredRenderer) {
|
||||
Border border = coloredRenderer.getMyBorder();
|
||||
return border != null ? border.getBorderInsets(coloredRenderer).top : 0;
|
||||
}
|
||||
|
||||
public int getCheckBoxHeight() {
|
||||
return myCheckBoxHeight;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user