Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMykola Zakharchuk2018-09-04 07:08:53 +0000
committerAndrey Loskutov2019-01-28 15:42:44 +0000
commit672b2b81259c3bab1877489434e05109b4522439 (patch)
tree76091d7cd5af5e71063a5e791bf5a9940b2958b3
parent57aef1646fef9009290374dec1cc83d8db9e8e0b (diff)
downloadeclipse.platform.text-Y20190130-0010.tar.gz
eclipse.platform.text-Y20190130-0010.tar.xz
eclipse.platform.text-Y20190130-0010.zip
This change makes proposal window more suitable for displaying long API names. Minimum height increased from 10 to 15 elements (width is depending on that as before, so it is increased accordingly). Both dimensions will be checked to be not bigger than 1/4 of the appropriate dimension of the current monitor. Change-Id: I7a00aecc6eafe70d24d00dcec691198a11aefd97 Signed-off-by: Mykola Zakharchuk <zakharchuk.vn@gmail.com> Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
-rw-r--r--org.eclipse.jface.text/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.jface.text/pom.xml2
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java11
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/ContentAssistant.java4
4 files changed, 14 insertions, 5 deletions
diff --git a/org.eclipse.jface.text/META-INF/MANIFEST.MF b/org.eclipse.jface.text/META-INF/MANIFEST.MF
index 50aad03429e..e58985b03d9 100644
--- a/org.eclipse.jface.text/META-INF/MANIFEST.MF
+++ b/org.eclipse.jface.text/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.jface.text
-Bundle-Version: 3.15.0.qualifier
+Bundle-Version: 3.15.100.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Export-Package:
diff --git a/org.eclipse.jface.text/pom.xml b/org.eclipse.jface.text/pom.xml
index 60b2b67fc73..511c0810bdf 100644
--- a/org.eclipse.jface.text/pom.xml
+++ b/org.eclipse.jface.text/pom.xml
@@ -18,6 +18,6 @@
</parent>
<groupId>org.eclipse.jface</groupId>
<artifactId>org.eclipse.jface.text</artifactId>
- <version>3.15.0-SNAPSHOT</version>
+ <version>3.15.100-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java
index c60a3ec6f16..94ce3d8b8b4 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java
@@ -57,6 +57,7 @@ import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Monitor;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableItem;
@@ -81,6 +82,7 @@ import org.eclipse.jface.preference.JFacePreferences;
import org.eclipse.jface.resource.JFaceColors;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.util.Geometry;
+import org.eclipse.jface.util.Util;
import org.eclipse.jface.viewers.StyledString;
import org.eclipse.jface.text.AbstractInformationControlManager;
@@ -637,10 +639,17 @@ class CompletionProposalPopup implements IContentAssistListener {
fProposalTable.setLayoutData(data);
fProposalShell.setSize(size);
} else {
- int height= fProposalTable.getItemHeight() * 10;
+ int height= fProposalTable.getItemHeight() * 15;
// use golden ratio as default aspect ratio
final double aspectRatio= (1 + Math.sqrt(5)) / 2;
int width= (int) (height * aspectRatio);
+
+ // Make sure our bounds still fit to the screen
+ Monitor monitor= Util.getClosestMonitor(fProposalShell.getDisplay(), getLocation());
+ Rectangle bounds= monitor.getClientArea();
+ width= Math.min(width, bounds.width / 4);
+ height= Math.min(height, bounds.height / 4);
+
Rectangle trim= fProposalTable.computeTrim(0, 0, width, height);
data.heightHint= trim.height;
data.widthHint= trim.width;
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/ContentAssistant.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/ContentAssistant.java
index 2e3ed84a799..f4c66bf62c2 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/ContentAssistant.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/ContentAssistant.java
@@ -2399,8 +2399,8 @@ public class ContentAssistant implements IContentAssistant, IContentAssistantExt
}
// Enforce an absolute minimal size
- size.x= Math.max(size.x, 30);
- size.y= Math.max(size.y, 30);
+ size.x= Math.max(size.x, 50);
+ size.y= Math.max(size.y, 50);
}
return size;

Back to the top