diff options
| author | nyamatongwe <devnull@localhost> | 2004-04-02 11:32:06 +0000 | 
|---|---|---|
| committer | nyamatongwe <devnull@localhost> | 2004-04-02 11:32:06 +0000 | 
| commit | 25b0cf489609aaefb4aeef7d0e9ca6c294f9ea74 (patch) | |
| tree | aa22cef567156ce4aff1c4494dfaa4bc98474ecc | |
| parent | e87e20b3526a9eda623263ef09de27be2ff40d4d (diff) | |
| download | scintilla-mirror-25b0cf489609aaefb4aeef7d0e9ca6c294f9ea74.tar.gz | |
Patch from Pavol Bosik to ensure calltips stay on screen.
| -rw-r--r-- | gtk/PlatGTK.cxx | 15 | ||||
| -rw-r--r-- | gtk/ScintillaGTK.cxx | 2 | 
2 files changed, 15 insertions, 2 deletions
| diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx index 18d0ea8bd..7c883e01f 100644 --- a/gtk/PlatGTK.cxx +++ b/gtk/PlatGTK.cxx @@ -1621,6 +1621,19 @@ void Window::SetPositionRelative(PRectangle rc, Window relativeTo) {  	oy += rc.top;  	if (oy < 0)  		oy = 0; + +	/* do some corrections to fit into screen */ +	int sizex = rc.right - rc.left; +	int sizey = rc.bottom - rc.top; +	int screenWidth = gdk_screen_width(); +	int screenHeight = gdk_screen_height(); +	if (sizex > screenWidth) +		ox = 0; /* the best we can do */ +	else if (ox + sizex > screenWidth) +		ox = screenWidth - sizex; +	if (oy + sizey > screenHeight) +		oy = screenHeight - sizey; +  	gtk_widget_set_uposition(PWidget(id), ox, oy);  #if 0 @@ -1631,7 +1644,7 @@ void Window::SetPositionRelative(PRectangle rc, Window relativeTo) {  	alloc.height = rc.bottom - rc.top;  	gtk_widget_size_allocate(id, &alloc);  #endif -	gtk_widget_set_usize(PWidget(id), rc.right - rc.left, rc.bottom - rc.top); +	gtk_widget_set_usize(PWidget(id), sizex, sizey);  }  PRectangle Window::GetClientPosition() { diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx index 3344a8684..a75586140 100644 --- a/gtk/ScintillaGTK.cxx +++ b/gtk/ScintillaGTK.cxx @@ -1159,7 +1159,7 @@ void ScintillaGTK::CreateCallTipWindow(PRectangle rc) {  	gtk_drawing_area_size(GTK_DRAWING_AREA(PWidget(ct.wDraw)),  	                      rc.Width(), rc.Height());  	ct.wDraw.Show(); -	ct.wCallTip.Show(); +	//ct.wCallTip.Show();  	//gtk_widget_set_usize(PWidget(ct.wCallTip), rc.Width(), rc.Height());  	gdk_window_resize(PWidget(ct.wCallTip)->window, rc.Width(), rc.Height());  } | 
