[anjuta-extras] scintilla: Display calltip above corresponding line



commit 48f8e8c2001c0b2443c1fd9124f066a41fc8711d
Author: SÃbastien Granjoux <seb sfo free fr>
Date:   Sat Sep 17 12:14:19 2011 +0200

    scintilla: Display calltip above corresponding line

 plugins/scintilla/scintilla/CallTip.cxx            |    2 +-
 plugins/scintilla/scintilla/ScintillaBase.cxx      |    9 ++--
 .../scintilla/patches/scintilla-calltip-above.diff |   42 ++++++++++++++++++++
 3 files changed, 47 insertions(+), 6 deletions(-)
---
diff --git a/plugins/scintilla/scintilla/CallTip.cxx b/plugins/scintilla/scintilla/CallTip.cxx
index cdc30fc..1db9720 100644
--- a/plugins/scintilla/scintilla/CallTip.cxx
+++ b/plugins/scintilla/scintilla/CallTip.cxx
@@ -294,7 +294,7 @@ PRectangle CallTip::CallTipStart(int pos, Point pt, const char *defn,
 	// the tip text, else to the tip text left edge.
 	int height = lineHeight * numLines - surfaceMeasure->InternalLeading(font) + 2 + 2;
 	delete surfaceMeasure;
-	return PRectangle(pt.x - offsetMain, pt.y + 1, pt.x + width - offsetMain, pt.y + 1 + height);
+	return PRectangle(pt.x - offsetMain, pt.y - 1 - height, pt.x + width - offsetMain, pt.y - 1);
 }
 
 void CallTip::CallTipCancel() {
diff --git a/plugins/scintilla/scintilla/ScintillaBase.cxx b/plugins/scintilla/scintilla/ScintillaBase.cxx
index da6b03e..76db98a 100644
--- a/plugins/scintilla/scintilla/ScintillaBase.cxx
+++ b/plugins/scintilla/scintilla/ScintillaBase.cxx
@@ -405,7 +405,6 @@ int ScintillaBase::AutoCompleteGetCurrentText(char *buffer) {
 
 void ScintillaBase::CallTipShow(Point pt, const char *defn) {
 	ac.Cancel();
-	pt.y += vs.lineHeight;
 	// If container knows about STYLE_CALLTIP then use it in place of the
 	// STYLE_DEFAULT for the face name, size and character set. Also use it
 	// for the foreground and background colour.
@@ -421,12 +420,12 @@ void ScintillaBase::CallTipShow(Point pt, const char *defn) {
 		vs.styles[ctStyle].characterSet,
 		wMain);
 	// If the call-tip window would be out of the client
-	// space, adjust so it displays above the text.
+	// space, adjust so it displays below the text.
 	PRectangle rcClient = GetClientRectangle();
-	if (rc.bottom > rcClient.bottom) {
+	if (rc.top < rcClient.top) {
 		int offset = vs.lineHeight + rc.Height();
-		rc.top -= offset;
-		rc.bottom -= offset;
+		rc.top += offset;
+		rc.bottom += offset;
 	}
 	// Now display the window.
 	CreateCallTipWindow(rc);
diff --git a/plugins/scintilla/scintilla/patches/scintilla-calltip-above.diff b/plugins/scintilla/scintilla/patches/scintilla-calltip-above.diff
new file mode 100644
index 0000000..2982df3
--- /dev/null
+++ b/plugins/scintilla/scintilla/patches/scintilla-calltip-above.diff
@@ -0,0 +1,42 @@
+diff --git a/plugins/scintilla/scintilla/CallTip.cxx b/plugins/scintilla/scintilla/CallTip.cxx
+index cdc30fc..1db9720 100644
+--- a/plugins/scintilla/scintilla/CallTip.cxx
++++ b/plugins/scintilla/scintilla/CallTip.cxx
+@@ -294,7 +294,7 @@ PRectangle CallTip::CallTipStart(int pos, Point pt, const char *defn,
+ 	// the tip text, else to the tip text left edge.
+ 	int height = lineHeight * numLines - surfaceMeasure->InternalLeading(font) + 2 + 2;
+ 	delete surfaceMeasure;
+-	return PRectangle(pt.x - offsetMain, pt.y + 1, pt.x + width - offsetMain, pt.y + 1 + height);
++	return PRectangle(pt.x - offsetMain, pt.y - 1 - height, pt.x + width - offsetMain, pt.y - 1);
+ }
+ 
+ void CallTip::CallTipCancel() {
+diff --git a/plugins/scintilla/scintilla/ScintillaBase.cxx b/plugins/scintilla/scintilla/ScintillaBase.cxx
+index da6b03e..76db98a 100644
+--- a/plugins/scintilla/scintilla/ScintillaBase.cxx
++++ b/plugins/scintilla/scintilla/ScintillaBase.cxx
+@@ -405,7 +405,6 @@ int ScintillaBase::AutoCompleteGetCurrentText(char *buffer) {
+ 
+ void ScintillaBase::CallTipShow(Point pt, const char *defn) {
+ 	ac.Cancel();
+-	pt.y += vs.lineHeight;
+ 	// If container knows about STYLE_CALLTIP then use it in place of the
+ 	// STYLE_DEFAULT for the face name, size and character set. Also use it
+ 	// for the foreground and background colour.
+@@ -421,12 +420,12 @@ void ScintillaBase::CallTipShow(Point pt, const char *defn) {
+ 		vs.styles[ctStyle].characterSet,
+ 		wMain);
+ 	// If the call-tip window would be out of the client
+-	// space, adjust so it displays above the text.
++	// space, adjust so it displays below the text.
+ 	PRectangle rcClient = GetClientRectangle();
+-	if (rc.bottom > rcClient.bottom) {
++	if (rc.top < rcClient.top) {
+ 		int offset = vs.lineHeight + rc.Height();
+-		rc.top -= offset;
+-		rc.bottom -= offset;
++		rc.top += offset;
++		rc.bottom += offset;
+ 	}
+ 	// Now display the window.
+ 	CreateCallTipWindow(rc);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]