diff options
author | nyamatongwe <unknown> | 2004-04-02 11:32:06 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2004-04-02 11:32:06 +0000 |
commit | 9cdfd99f604c738656504beb18ebe6c7dd8ba99c (patch) | |
tree | aa22cef567156ce4aff1c4494dfaa4bc98474ecc /gtk | |
parent | 2e76e66e207e90a152f6be501c62aeee0b8e442c (diff) | |
download | scintilla-mirror-9cdfd99f604c738656504beb18ebe6c7dd8ba99c.tar.gz |
Patch from Pavol Bosik to ensure calltips stay on screen.
Diffstat (limited to 'gtk')
-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()); } |