Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wolf2019-12-21 13:54:56 +0000
committerThomas Wolf2019-12-24 14:27:03 +0000
commitb7c9cd5be3ceac2aad7908334e1fc7c328a34eb4 (patch)
tree23193ab6ad03f47fb26edf39260b7e0fa9275f71
parent24468cf1126fce9484019edc49cb1785e4d95c0c (diff)
downloadegit-b7c9cd5be3ceac2aad7908334e1fc7c328a34eb4.tar.gz
egit-b7c9cd5be3ceac2aad7908334e1fc7c328a34eb4.tar.xz
egit-b7c9cd5be3ceac2aad7908334e1fc7c328a34eb4.zip
[repo view] Work-around for SWT regression on GTK
Remove the focus cell manager. It is needed only for keyboard activation of inline cell editing, but we don't use that anyway since we always go through the rename command, which is a programmatic editor activation. The focus manager ensures the focus cell is visible by calling Tree.showItem(), which is specified to do nothing if the cell is already visible. But since the changes made in the GTK version of SWT for bug 552096, showItem() _always_ scrolls the item to the center of the tree, which is quite annoying and makes double-clicking an item impossible unless it already is in the center of the view. As a work-around, remove that unnecessary focus manager. Bug: 558496 Change-Id: I69f5c4274350a909dd0288a0f8650346ba8da175 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java9
1 files changed, 1 insertions, 8 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java
index 8ec480e19..a094e5dc2 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java
@@ -98,7 +98,6 @@ import org.eclipse.jface.viewers.ColumnViewerEditorActivationEvent;
import org.eclipse.jface.viewers.ColumnViewerEditorActivationStrategy;
import org.eclipse.jface.viewers.DecoratingStyledCellLabelProvider;
import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.FocusCellHighlighter;
import org.eclipse.jface.viewers.IBaseLabelProvider;
import org.eclipse.jface.viewers.ICellModifier;
import org.eclipse.jface.viewers.IDoubleClickListener;
@@ -112,7 +111,6 @@ import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TextCellEditor;
import org.eclipse.jface.viewers.TreeSelection;
import org.eclipse.jface.viewers.TreeViewerEditor;
-import org.eclipse.jface.viewers.TreeViewerFocusCellManager;
import org.eclipse.jface.window.Window;
import org.eclipse.jgit.events.ConfigChangedEvent;
import org.eclipse.jgit.events.ConfigChangedListener;
@@ -612,11 +610,6 @@ public class RepositoriesView extends CommonNavigator implements IShowInSource,
}
private void setupInlineEditing(CommonViewer viewer) {
- TreeViewerFocusCellManager focusCellManager = new TreeViewerFocusCellManager(
- viewer, new FocusCellHighlighter(viewer) {
- // Empty; SWT highlights already.
- });
-
ColumnViewerEditorActivationStrategy editorActivation = new ColumnViewerEditorActivationStrategy(
viewer) {
@@ -633,7 +626,7 @@ public class RepositoriesView extends CommonNavigator implements IShowInSource,
// tabbing. It may jump otherwise into an open editor (closing the cell
// editor), and when the user is typing he may then inadvertently modify
// that file.
- TreeViewerEditor.create(viewer, focusCellManager, editorActivation,
+ TreeViewerEditor.create(viewer, editorActivation,
ColumnViewerEditor.TABBING_HORIZONTAL);
// Record the initial value so that the validator can avoid producing an

Back to the top